drivers: base: move devices pm to tail when driver bound
Only moving device pm to tail for defer probe is not enough because the device driver may be probed out of order without defer probe due to different driver init levels. Let's move the device pm to tail in the driver bound to ensure the device pm sequence is exactly the same as its probe sequence. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
219d54332a
commit
fad6183864
|
@ -102,14 +102,6 @@ static void deferred_probe_work_func(struct work_struct *work)
|
|||
*/
|
||||
mutex_unlock(&deferred_probe_mutex);
|
||||
|
||||
/*
|
||||
* Force the device to the end of the dpm_list since
|
||||
* the PM code assumes that the order we add things to
|
||||
* the list is a good order for suspend but deferred
|
||||
* probe makes that very unsafe.
|
||||
*/
|
||||
device_pm_move_to_tail(dev);
|
||||
|
||||
dev_dbg(dev, "Retrying from deferred list\n");
|
||||
bus_probe_device(dev);
|
||||
mutex_lock(&deferred_probe_mutex);
|
||||
|
@ -380,6 +372,14 @@ static void driver_bound(struct device *dev)
|
|||
|
||||
device_pm_check_callbacks(dev);
|
||||
|
||||
/*
|
||||
* Force the device to the end of the dpm_list since
|
||||
* the PM code assumes that the order we add things to
|
||||
* the list is a good order for suspend but deferred
|
||||
* probe makes that very unsafe.
|
||||
*/
|
||||
device_pm_move_to_tail(dev);
|
||||
|
||||
/*
|
||||
* Make sure the device is no longer in one of the deferred lists and
|
||||
* kick off retrying all pending devices
|
||||
|
|
Loading…
Reference in New Issue