summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffy Chen <jeffy.chen@rock-chips.com>2017-10-20 20:01:01 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-01 09:42:59 +0100
commitc8692d9f5ceff240792df5b42ca1639ace77204b (patch)
tree1ff15176dc672e0467d9913036eedb821ce12d61
parenta46ca4c8f1c64723ce0a9f66638a1343a71bbe3f (diff)
downloadlinux-stable-c8692d9f5ceff240792df5b42ca1639ace77204b.tar.gz
linux-stable-c8692d9f5ceff240792df5b42ca1639ace77204b.tar.bz2
linux-stable-c8692d9f5ceff240792df5b42ca1639ace77204b.zip
driver core: Move device_links_purge() after bus_remove_device()
commit 2ec16150179888b81717d1d3ce84e634f4736af2 upstream. The current ordering of code in device_del() triggers a WARN_ON() in device_links_purge(), because of an unexpected link status. The device_links_unbind_consumers() call in device_release_driver() has to take place before device_links_purge() for the status of all links to be correct, so move the device_links_purge() call in device_del() after the invocation of bus_remove_device() which calls device_release_driver(). Fixes: 9ed9895370ae (driver core: Functional dependencies tracking support) Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index eb066cc827ef..3f463a61f8cf 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1973,7 +1973,6 @@ void device_del(struct device *dev)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
BUS_NOTIFY_DEL_DEVICE, dev);
- device_links_purge(dev);
dpm_sysfs_remove(dev);
if (parent)
klist_del(&dev->p->knode_parent);
@@ -2001,6 +2000,7 @@ void device_del(struct device *dev)
device_pm_remove(dev);
driver_deferred_probe_del(dev);
device_remove_properties(dev);
+ device_links_purge(dev);
/* Notify the platform of the removal, in case they
* need to do anything...