diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-05-20 23:09:49 +0200 |
|---|---|---|
| committer | Ben Hutchings <ben@decadent.org.uk> | 2016-08-22 22:38:03 +0100 |
| commit | ccac349834cc168be606c63900b5a09840fd7b89 (patch) | |
| tree | f9d604c454575b117ce812f4b70b7cae1ce414e2 /drivers/base | |
| parent | 285d720c9845f52168affde139246b204f07d4b8 (diff) | |
| download | linux-ccac349834cc168be606c63900b5a09840fd7b89.tar.gz linux-ccac349834cc168be606c63900b5a09840fd7b89.tar.bz2 linux-ccac349834cc168be606c63900b5a09840fd7b89.zip | |
PM / sleep: Handle failures in device_suspend_late() consistently
commit 3a17fb329da68cb00558721aff876a80bba2fdb9 upstream.
Grygorii Strashko reports:
The PM runtime will be left disabled for the device if its
.suspend_late() callback fails and async suspend is not allowed
for this device. In this case device will not be added in
dpm_late_early_list and dpm_resume_early() will ignore this
device, as result PM runtime will be disabled for it forever
(side effect: after 8 subsequent failures for the same device
the PM runtime will be reenabled due to disable_depth overflow).
To fix this problem, add devices to dpm_late_early_list regardless
of whether or not device_suspend_late() returns errors for them.
That will ensure failures in there to be handled consistently for
all devices regardless of their async suspend/resume status.
Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Tested-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/power/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 1f6da3ad6db0..0f632958a4dd 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1247,14 +1247,15 @@ static int dpm_suspend_late(pm_message_t state) error = device_suspend_late(dev); mutex_lock(&dpm_list_mtx); + if (!list_empty(&dev->power.entry)) + list_move(&dev->power.entry, &dpm_late_early_list); + if (error) { pm_dev_err(dev, state, " late", error); dpm_save_failed_dev(dev_name(dev)); put_device(dev); break; } - if (!list_empty(&dev->power.entry)) - list_move(&dev->power.entry, &dpm_late_early_list); put_device(dev); if (async_error) |
