powerpc/pci: Reorder pci bus/bridge unregistration during PHB removal
authorTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Tue, 29 Jul 2014 17:48:13 +0000 (13:48 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Sep 2014 23:34:15 +0000 (16:34 -0700)
commit51d79fc2bc76246b3f098480404837bfdf1c76eb
treedb420c06ddd8d7461e80ed420efea0bc6b7f4935
parentbc9043277554c6cb45d78c7fc4f6ee03787b2b75
powerpc/pci: Reorder pci bus/bridge unregistration during PHB removal

commit 7340056567e32b2c9d3554eb146e1977c93da116 upstream.

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: bcdde7e221a8 ("sysfs: make __sysfs_remove_dir() recursive")
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/pseries/pci_dlpar.c