Skip to content

Commit 7340056

Browse files
Tyrel Datwylerozbenh
authored andcommitted
powerpc/pci: Reorder pci bus/bridge unregistration during PHB removal
Commit bcdde7e made __sysfs_remove_dir() recursive and introduced a BUG_ON during PHB removal while attempting to delete the power managment attribute group of the bus. This is a result of tearing the bridge and bus devices down out of order in remove_phb_dynamic. Since, the the bus resides below the bridge in the sysfs device tree it should be torn down first. This patch simply moves the device_unregister call for the PHB bridge device after the device_unregister call for the PHB bus. Fixes: bcdde7e ("sysfs: make __sysfs_remove_dir() recursive") Cc: [email protected] Signed-off-by: Tyrel Datwyler <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
1 parent a32305b commit 7340056

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/platforms/pseries/pci_dlpar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ int remove_phb_dynamic(struct pci_controller *phb)
118118
}
119119
}
120120

121-
/* Unregister the bridge device from sysfs and remove the PCI bus */
122-
device_unregister(b->bridge);
121+
/* Remove the PCI bus and unregister the bridge device from sysfs */
123122
phb->bus = NULL;
124123
pci_remove_bus(b);
124+
device_unregister(b->bridge);
125125

126126
/* Now release the IO resource */
127127
if (res->flags & IORESOURCE_IO)

0 commit comments

Comments
 (0)