[PATCH] Call platform_notify_remove later

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch moves the call to platform_notify_remove() to after the call
to bus_remove_device(), where it belongs. It's bogus to notify the
platform of removal while drivers are still attached to the device and
possibly still operating since the platform might use this callback to
tear down some resources used by the driver (ACPI bits, iommu
table, ...)

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
---

Note that Len Browned wrote "AFAICS, your change is logical and should
be fine." which I consider an ACK, though I didn't add an Acked-by
line :)

This patch should go in imho after 2.6.19 (it might even be considered a
bug fix for 2.6.19 but it's probably not bad enough, so let's have it
simmer in your tree and -mm for a little while).

This is orthogonal to my other patch adding a notifier which we can
continue discussing separately.

Index: linux-cell/drivers/base/core.c
===================================================================
--- linux-cell.orig/drivers/base/core.c	2006-10-06 13:48:02.000000000 +1000
+++ linux-cell/drivers/base/core.c	2006-10-18 11:53:50.000000000 +1000
@@ -608,12 +608,13 @@ void device_del(struct device * dev)
 	device_remove_groups(dev);
 	device_remove_attrs(dev);
 
+	bus_remove_device(dev);
+
 	/* Notify the platform of the removal, in case they
 	 * need to do anything...
 	 */
 	if (platform_notify_remove)
 		platform_notify_remove(dev);
-	bus_remove_device(dev);
 	device_pm_remove(dev);
 	kobject_uevent(&dev->kobj, KOBJ_REMOVE);
 	kobject_del(&dev->kobj);
 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux