[PATCH] Call platform_notify_remove later

From: Benjamin Herrenschmidt
Date: Mon Oct 23 2006 - 00:47:51 EST


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 <benh@xxxxxxxxxxxxxxxxxxx>
---

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/