linux/drivers/base/power
Rafael J. Wysocki 1516d9fa63 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>
Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-13 09:11:32 +02:00
..
opp PM / OPP: Add missing of_node_put(np) 2017-11-30 08:37:25 +00:00
clock_ops.c
common.c
domain_governor.c
domain.c PM / Domains: defer dev_pm_domain_set() until genpd->attach_dev succeeds if present 2017-08-06 19:19:42 -07:00
generic_ops.c
main.c PM / core: Clear the direct_complete flag on errors 2018-10-13 09:11:32 +02:00
Makefile
power.h
qos.c
runtime.c PM / runtime: Avoid false-positive warnings from might_sleep_if() 2017-06-17 06:39:36 +02:00
sysfs.c PM / QoS: return -EINVAL for bogus strings 2017-07-21 07:44:59 +02:00
trace.c PM / sleep: declare __tracedata symbols as char[] rather than char 2018-01-31 12:06:08 +01:00
wakeirq.c PM / wakeirq: report a wakeup_event on dedicated wekup irq 2017-11-08 10:06:28 +01:00
wakeup.c PM / wakeirq: Convert to SRCU 2017-07-21 07:44:59 +02:00