Skip to content

Commit 42f49a6

Browse files
Rajesh Shahgregkh
authored andcommitted
[PATCH] acpi hotplug: convert acpiphp to use generic resource code
This patch converts acpiphp to use the generic PCI resource assignment code. It's quite large, but most of it is deleting the acpiphp_pci and acpiphp_res files. It's tested on an hp Integrity rx8620 (which won't work without this patch). Testers with other hardware welcomed. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 4ce448e commit 42f49a6

6 files changed

Lines changed: 134 additions & 1530 deletions

File tree

‎drivers/pci/hotplug/Makefile‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ ibmphp-objs := ibmphp_core.o \
3636
ibmphp_hpc.o
3737

3838
acpiphp-objs := acpiphp_core.o \
39-
acpiphp_glue.o \
40-
acpiphp_pci.o \
41-
acpiphp_res.o
39+
acpiphp_glue.o
4240

4341
rpaphp-objs := rpaphp_core.o \
4442
rpaphp_pci.o \

‎drivers/pci/hotplug/acpiphp.h‎

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
88
* Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
99
* Copyright (C) 2002,2003 NEC Corporation
10+
* Copyright (C) 2003-2005 Matthew Wilcox (matthew.wilcox@hp.com)
11+
* Copyright (C) 2003-2005 Hewlett Packard
1012
*
1113
* All rights reserved.
1214
*
@@ -52,7 +54,6 @@
5254

5355
struct acpiphp_bridge;
5456
struct acpiphp_slot;
55-
struct pci_resource;
5657

5758
/*
5859
* struct slot - slot information for each *physical* slot
@@ -65,15 +66,6 @@ struct slot {
6566
struct acpiphp_slot *acpi_slot;
6667
};
6768

68-
/*
69-
* struct pci_resource - describes pci resource (mem, pfmem, io, bus)
70-
*/
71-
struct pci_resource {
72-
struct pci_resource * next;
73-
u64 base;
74-
u32 length;
75-
};
76-
7769
/**
7870
* struct hpp_param - ACPI 2.0 _HPP Hot Plug Parameters
7971
* @cache_line_size in DWORD
@@ -101,10 +93,6 @@ struct acpiphp_bridge {
10193
int type;
10294
int nr_slots;
10395

104-
u8 seg;
105-
u8 bus;
106-
u8 sub;
107-
10896
u32 flags;
10997

11098
/* This bus (host bridge) or Secondary bus (PCI-to-PCI bridge) */
@@ -117,12 +105,6 @@ struct acpiphp_bridge {
117105
struct hpp_param hpp;
118106

119107
spinlock_t res_lock;
120-
121-
/* available resources on this bus */
122-
struct pci_resource *mem_head;
123-
struct pci_resource *p_mem_head;
124-
struct pci_resource *io_head;
125-
struct pci_resource *bus_head;
126108
};
127109

128110

@@ -163,12 +145,6 @@ struct acpiphp_func {
163145

164146
u8 function; /* pci function# */
165147
u32 flags; /* see below */
166-
167-
/* resources used for this function */
168-
struct pci_resource *mem_head;
169-
struct pci_resource *p_mem_head;
170-
struct pci_resource *io_head;
171-
struct pci_resource *bus_head;
172148
};
173149

174150
/**
@@ -243,25 +219,6 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
243219
extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
244220
extern u32 acpiphp_get_address (struct acpiphp_slot *slot);
245221

246-
/* acpiphp_pci.c */
247-
extern struct pci_dev *acpiphp_allocate_pcidev (struct pci_bus *pbus, int dev, int fn);
248-
extern int acpiphp_configure_slot (struct acpiphp_slot *slot);
249-
extern int acpiphp_configure_function (struct acpiphp_func *func);
250-
extern void acpiphp_unconfigure_function (struct acpiphp_func *func);
251-
extern int acpiphp_detect_pci_resource (struct acpiphp_bridge *bridge);
252-
extern int acpiphp_init_func_resource (struct acpiphp_func *func);
253-
254-
/* acpiphp_res.c */
255-
extern struct pci_resource *acpiphp_get_io_resource (struct pci_resource **head, u32 size);
256-
extern struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size);
257-
extern struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, u64 base, u32 size);
258-
extern int acpiphp_resource_sort_and_combine (struct pci_resource **head);
259-
extern struct pci_resource *acpiphp_make_resource (u64 base, u32 length);
260-
extern void acpiphp_move_resource (struct pci_resource **from, struct pci_resource **to);
261-
extern void acpiphp_free_resource (struct pci_resource **res);
262-
extern void acpiphp_dump_resource (struct acpiphp_bridge *bridge); /* debug */
263-
extern void acpiphp_dump_func_resource (struct acpiphp_func *func); /* debug */
264-
265222
/* variables */
266223
extern int acpiphp_debug;
267224

‎drivers/pci/hotplug/acpiphp_core.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
88
* Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
99
* Copyright (C) 2002,2003 NEC Corporation
10+
* Copyright (C) 2003-2005 Matthew Wilcox (matthew.wilcox@hp.com)
11+
* Copyright (C) 2003-2005 Hewlett Packard
1012
*
1113
* All rights reserved.
1214
*
@@ -53,8 +55,8 @@ int acpiphp_debug;
5355
static int num_slots;
5456
static struct acpiphp_attention_info *attention_info;
5557

56-
#define DRIVER_VERSION "0.4"
57-
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kochi@bq.jp.nec.com>"
58+
#define DRIVER_VERSION "0.5"
59+
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kochi@bq.jp.nec.com>, Matthew Wilcox <willy@hp.com>"
5860
#define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver"
5961

6062
MODULE_AUTHOR(DRIVER_AUTHOR);
@@ -281,8 +283,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
281283
/**
282284
* get_address - get pci address of a slot
283285
* @hotplug_slot: slot to get status
284-
* @busdev: pointer to struct pci_busdev (seg, bus, dev)
285-
*
286+
* @value: pointer to struct pci_busdev (seg, bus, dev)
286287
*/
287288
static int get_address(struct hotplug_slot *hotplug_slot, u32 *value)
288289
{

0 commit comments

Comments
 (0)