Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4980d5eb750288ffc0bb9daff3feb947e1bac61e
Commit:     4980d5eb750288ffc0bb9daff3feb947e1bac61e
Parent:     fa1be476a2baa0961f63161caee6733cdc353adb
Author:     Linas Vepstas <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 19 15:01:31 2007 -0500
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Mar 22 22:52:57 2007 +1100

    [POWERPC] EEH: restructure multi-function support
    
    Rework how multi-function PCI devices are identified and traversed.
    This fixes a bug with multi-function recovery on Power4 that was
    introduced by a recent Power4 EEH patch.
    
    Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pseries/eeh.c        |    4 +-
 arch/powerpc/platforms/pseries/eeh_driver.c |   30 ++++++++++++--------------
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/eeh.c 
b/arch/powerpc/platforms/pseries/eeh.c
index eac2a63..a56be71 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -282,7 +282,7 @@ void eeh_mark_slot (struct device_node *dn, int mode_flag)
        dn = find_device_pe (dn);
 
        /* Back up one, since config addrs might be shared */
-       if (PCI_DN(dn) && PCI_DN(dn)->eeh_pe_config_addr)
+       if (!pcibios_find_pci_bus(dn) && PCI_DN(dn->parent))
                dn = dn->parent;
 
        PCI_DN(dn)->eeh_mode |= mode_flag;
@@ -316,7 +316,7 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag)
        dn = find_device_pe (dn);
        
        /* Back up one, since config addrs might be shared */
-       if (PCI_DN(dn) && PCI_DN(dn)->eeh_pe_config_addr)
+       if (!pcibios_find_pci_bus(dn) && PCI_DN(dn->parent))
                dn = dn->parent;
 
        PCI_DN(dn)->eeh_mode &= ~mode_flag;
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c 
b/arch/powerpc/platforms/pseries/eeh_driver.c
index f5b4f7c..8cc331e 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -249,6 +249,7 @@ static void eeh_report_failure(struct pci_dev *dev, void 
*userdata)
 
 static int eeh_reset_device (struct pci_dn *pe_dn, struct pci_bus *bus)
 {
+       struct device_node *dn;
        int cnt, rc;
 
        /* pcibios will clear the counter; save the value */
@@ -264,23 +265,20 @@ static int eeh_reset_device (struct pci_dn *pe_dn, struct 
pci_bus *bus)
        if (rc)
                return rc;
 
-       /* New-style config addrs might be shared across multiple devices,
-        * Walk over all functions on this device */
-       if (pe_dn->eeh_pe_config_addr) {
-               struct device_node *pe = pe_dn->node;
-               pe = pe->parent->child;
-               while (pe) {
-                       struct pci_dn *ppe = PCI_DN(pe);
-                       if (pe_dn->eeh_pe_config_addr == 
ppe->eeh_pe_config_addr) {
-                               rtas_configure_bridge(ppe);
-                               eeh_restore_bars(ppe);
-                       }
-                       pe = pe->sibling;
+       /* Walk over all functions on this device.  */
+       dn = pe_dn->node;
+       if (!pcibios_find_pci_bus(dn) && PCI_DN(dn->parent))
+               dn = dn->parent->child;
+
+       while (dn) {
+               struct pci_dn *ppe = PCI_DN(dn);
+               /* On Power4, always true because eeh_pe_config_addr=0 */
+               if (pe_dn->eeh_pe_config_addr == ppe->eeh_pe_config_addr) {
+                       rtas_configure_bridge(ppe);
+                       eeh_restore_bars(ppe);
                }
-       } else {
-               rtas_configure_bridge(pe_dn);
-               eeh_restore_bars(pe_dn);
-       }
+               dn = dn->sibling;
+       }
 
        /* Give the system 5 seconds to finish running the user-space
         * hotplug shutdown scripts, e.g. ifdown for ethernet.  Yes, 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to