Convert acpiphp to use generic resource code
PATCH 1/1 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.
If you're testing on ia64, you'll probably need two other patches as well:
http://marc.theaimsgroup.com/?l=linux-ia64&m0614534704894&w=2
and this one (already sent to Greg):
----
ia64 calls pci_claim_resource() from pcibios_fixup_bus(), which is __devinit, so pci_claim_resource() needs to be __devinit too.
Index: hotplug-2.6/drivers/pci/setup-res.c =================================RCS file: /var/cvs/linux-2.6/drivers/pci/setup-res.c,v retrieving revision 1.9
drivers/pci/setup-res.c +1 -1
@@ -90,7 +90,7 @@ pci_update_resource(struct pci_dev *dev, new & ~PCI_REGION_FLAG_MASK)); } -int __init +int __devinit pci_claim_resource (struct pci_dev *dev,int resource) {struct resource *res = &dev->resource[resource];
----
Makefile | 4 acpiphp.h | 47 --- acpiphp_core.c | 9 acpiphp_glue.c | 455 ++++++++++--------------------------- acpiphp_pci.c | 449 ------------------------------------ acpiphp_res.c | 700 --------------------------------------------------------- 6 files changed, 134 insertions(+), 1530 deletions(-)
Index: drivers/pci/hotplug/Makefile
=================================RCS file: /var/cvs/linux-2.6/drivers/pci/hotplug/Makefile,v retrieving revision 1.6
pci/hotplug/Makefile +1 -3
@@ -36,9 +36,7 @@ ibmphp-objs := ibmphp_core.o \ ibmphp_hpc.o acpiphp-objs := acpiphp_core.o \ - acpiphp_glue.o \ - acpiphp_pci.o \ - acpiphp_res.o + acpiphp_glue.o rpaphp-objs := rpaphp_core.o \ rpaphp_pci.o \
Index: drivers/pci/hotplug/acpiphp.h
=================================RCS file: /var/cvs/linux-2.6/drivers/pci/hotplug/acpiphp.h,v retrieving revision 1.6
pci/hotplug/acpiphp.h +2 -45
89 lines not on this page · raw message
Index: drivers/pci/hotplug/acpiphp_core.c
=================================RCS file: /var/cvs/linux-2.6/drivers/pci/hotplug/acpiphp_core.c,v retrieving revision 1.6
pci/hotplug/acpiphp_core.c +5 -4
@@ -7,6 +7,8 @@* Copyright (C) 2002 Hiroshi Aono ([email protected]) * Copyright (C) 2002,2003 Takayoshi Kochi ([email protected]) * Copyright (C) 2002,2003 NEC Corporation +* Copyright (C) 2003-2005 Matthew Wilcox ([email protected]) +* Copyright (C) 2003-2005 Hewlett Packard * * All rights reserved. *
@@ -53,8 +55,8 @@ int acpiphp_debug;static int num_slots;static struct acpiphp_attention_info *attention_info; -#define DRIVER_VERSION "0.4" -#define DRIVER_AUTHOR "Greg Kroah-Hartman <[email protected]>, Takayoshi Kochi <[email protected]>" +#define DRIVER_VERSION "0.5" +#define DRIVER_AUTHOR "Greg Kroah-Hartman <[email protected]>, Takayoshi Kochi <[email protected]>, Matthew Wilcox <[email protected]>"#define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver"MODULE_AUTHOR (DRIVER_AUTHOR );
@@ -281,8 +283,7 @@ static int get_adapter_status(struct hot/** * get_address - get pci address of a slot * @hotplug_slot: slot to get status -* @busdev: pointer to struct pci_busdev (seg, bus, dev) -* +* @value: pointer to struct pci_busdev (seg, bus, dev) */ static int get_address (struct hotplug_slot *hotplug_slot,u32 *value) {
Index: drivers/pci/hotplug/acpiphp_glue.c
=================================RCS file: /var/cvs/linux-2.6/drivers/pci/hotplug/acpiphp_glue.c,v retrieving revision 1.12
pci/hotplug/acpiphp_glue.c +126 -329
657 lines not on this page · raw message
Index: drivers/pci/hotplug/acpiphp_pci.c =================================RCS file: drivers/pci/hotplug/acpiphp_pci.c
pci/hotplug/acpiphp_pci.c deleted +0 -449
449 lines not on this page · raw message
Index: drivers/pci/hotplug/acpiphp_res.c =================================RCS file: drivers/pci/hotplug/acpiphp_res.c
pci/hotplug/acpiphp_res.c deleted +0 -700
700 lines not on this page · raw message
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain
Quoted 5 lines · Matthew Wilcox
This patch converts acpiphp to use the generic PCI resource assignment code. It's quite large, but most of it is deleting the
acpiphp_pciandacpiphp_resfiles. It's tested on an hp Integrity rx8620 (which won't work without this patch). Testers with other hardware welcomed.
Nice!
Unfortunatly I don't have access to any systems that support acpi pci hotplug. Anyone else out there able to test this patch to make sure it works properly on their i386 boxes?
thanks,
greg k-h
Quoted 11 lines · Greg KH
Quoted 5 lines · Matthew Wilcox
This patch converts acpiphp to use the generic PCI resource assignment code. It's quite large, but most of it is deleting the
acpiphp_pciandacpiphp_resfiles. It's tested on an hp Integrity rx8620 (which won't work without this patch). Testers with other hardware welcomed.Unfortunatly I don't have access to any systems that support acpi pci hotplug. Anyone else out there able to test this patch to make sure it works properly on their i386 boxes?
For this to work properly on i386 (and x86_64), we will need to port Matthew's other patch at
http://marc.theaimsgroup.com/?l=linux-ia64&m0614534704894&w=2
to i386 too. This sets up the bus resources correctly for root bridges, and is needed for pci_bus_assign_resources() to work properly.
I can take a crack at doing that, but I'm going to have to hunt around for an acpiphp capable i386 box too. I will also test this on a Tiger ia64 box.
Rajesh
Quoted 6 lines · Rajesh Shah
For this to work properly on i386 (and
x86_64), we will need to port Matthew's other patch at
http://marc.theaimsgroup.com/?l=linux-ia64&m0614534704894&w=2
to i386 too. This sets up the bus resources correctly for root bridges, and is needed forpci_bus_assign_resources()to work properly.
I found a problem when hotplugging a card with a PCI-PCI bridge on it. I hope to have a solution tomorrow.
Quoted 5 lines
I can take a crack at doing that, but I'm going to have to hunt around for an acpiphp capable i386 box too. I will also test this on a Tiger ia64 box.
Rajesh
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain