ChangeSet 1.1587.12.4, 2004/04/29 14:01:19-07:00, lxiep@us.ibm.com

[PATCH] PCI Hotplug: rpaphp: set eeh option (enabled ) prior to any i/o to newly added IOA

Attached patch fix the problem I have found during DLPAR I/O slots
testing on our new hardware.  rpaphp needs to set eeh-option(eanbled)
for newly added IOA prior to performing PCI config(pci_setup_device),
otherwise the pci_dev of the IOA will have invalid base address
information.

Linas Vepstas impleted eeh changes.


 drivers/pci/hotplug/rpaphp_pci.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


diff -Nru a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
--- a/drivers/pci/hotplug/rpaphp_pci.c	Mon May 17 17:08:47 2004
+++ b/drivers/pci/hotplug/rpaphp_pci.c	Mon May 17 17:08:47 2004
@@ -175,6 +175,7 @@
 			pci_read_irq_line(dev);
 			for (i = 0; i < PCI_NUM_RESOURCES; i++) {
 				struct resource *r = &dev->resource[i];
+
 				if (r->parent || !r->start || !r->flags)
 					continue;
 				rpaphp_claim_resource(dev, i);
@@ -256,8 +257,9 @@
 			goto exit;
 		}
 
+		eeh_add_device_early(slot->dn->child);
 		dev = rpaphp_pci_config_dn(slot->dn, pci_bus);
-		eeh_add_device(dev);
+		eeh_add_device_late(dev);
 	} else {
 		/* slot is not enabled */
 		err("slot doesn't have pci_dev structure\n");
