[PATCH] powerpc/pci: reorder pci bus/bridge unregistration during PHB removal

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE4423d

3 messages, 2 authors, 2014-07-29 · open the first message on its own page

[PATCH] powerpc/pci: reorder pci bus/bridge unregistration during PHB removal

From: Tyrel Datwyler <hidden>
Date: 2014-07-29 00:57:35

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.

Signed-off-by: Tyrel Datwyler <redacted>
---
 arch/powerpc/platforms/pseries/pci_dlpar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index 203cbf0..89e2381 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -118,10 +118,10 @@ int remove_phb_dynamic(struct pci_controller *phb)
 		}
 	}
 
-	/* Unregister the bridge device from sysfs and remove the PCI bus */
-	device_unregister(b->bridge);
+	/* Remove the PCI bus and unregister the bridge device from sysfs */
 	phb->bus = NULL;
 	pci_remove_bus(b);
+	device_unregister(b->bridge);
 
 	/* Now release the IO resource */
 	if (res->flags & IORESOURCE_IO)
-- 
1.7.12.4

Re: [PATCH] powerpc/pci: reorder pci bus/bridge unregistration during PHB removal

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2014-07-29 01:44:18

On Mon, 2014-07-28 at 20:48 -0400, Tyrel Datwyler wrote:
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.

Signed-off-by: Tyrel Datwyler <redacted>
That commit went into 3.13, so shouldn't this be CC to stable?

And also:

  Fixes: bcdde7e221a8 ("sysfs: make __sysfs_remove_dir() recursive")

cheers

Re: [PATCH] powerpc/pci: reorder pci bus/bridge unregistration during PHB removal

From: Tyrel Datwyler <hidden>
Date: 2014-07-29 17:55:57

On 07/28/2014 06:44 PM, Michael Ellerman wrote:
On Mon, 2014-07-28 at 20:48 -0400, Tyrel Datwyler wrote:
quoted
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.

Signed-off-by: Tyrel Datwyler <redacted>
That commit went into 3.13, so shouldn't this be CC to stable?
Darn it. Yes, it should.
And also:

  Fixes: bcdde7e221a8 ("sysfs: make __sysfs_remove_dir() recursive")

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help