linux/drivers/base/power
Rafael J. Wysocki a5a6cebdd0 PM / core: Clear the direct_complete flag on errors
commit 69e445ab8b upstream.

If __device_suspend() runs asynchronously (in which case the device
passed to it is in dpm_suspended_list at that point) and it returns
early on an error or pending wakeup, and the power.direct_complete
flag has been set for the device already, the subsequent
device_resume() will be confused by that and it will call
pm_runtime_enable() incorrectly, as runtime PM has not been
disabled for the device by __device_suspend().

To avoid that, clear power.direct_complete if __device_suspend()
is not going to disable runtime PM for the device before returning.

Fixes: aae4518b31 (PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily)
Reported-by: Al Cooper <alcooperx@gmail.com>
Tested-by: Al Cooper <alcooperx@gmail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-12-16 22:09:35 +00:00
..
clock_ops.c PM / clk: Fix crash in clocks management code if !CONFIG_PM_RUNTIME 2014-11-03 10:52:06 +00:00
common.c drivers/base: delete non-required instances of include <linux/init.h> 2014-02-14 14:31:37 -08:00
domain.c PM / Domains: Fix unsafe iteration over modified list of device links 2017-10-12 15:27:56 +01:00
domain_governor.c drivers/base: delete non-required instances of include <linux/init.h> 2014-02-14 14:31:37 -08:00
generic_ops.c PM / Runtime: Spelling s/competing/completing/ 2014-03-26 16:33:53 +01:00
main.c PM / core: Clear the direct_complete flag on errors 2018-12-16 22:09:35 +00:00
Makefile PM: Add pm_runtime_suspend|resume_force functions 2014-03-02 00:18:15 +01:00
opp.c Merge branch 'pm-cpufreq' 2014-06-03 23:13:20 +02:00
power.h PM / QoS: Rename device resume latency QoS items 2014-02-11 00:35:23 +01:00
qos.c PM / QoS: Fix memory leak on resume_latency.notifiers 2017-06-05 21:17:11 +01:00
runtime.c PM / Runtime: Fix error path in pm_runtime_force_resume() 2016-08-22 22:37:51 +01:00
sysfs.c PM / QoS: return -EINVAL for bogus strings 2017-10-12 15:28:05 +01:00
trace.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
wakeup.c PM / wakeup: Only update last time for active wakeup sources 2018-11-20 18:04:52 +00:00