linux/drivers/base/power
Rafael J. Wysocki 3487972d7f PM / sleep: Avoid excess pm_runtime_enable() calls in device_resume()
Middle-layer code doing suspend-time optimizations for devices with
the DPM_FLAG_SMART_SUSPEND flag set (currently, the PCI bus type and
the ACPI PM domain) needs to make the core skip ->thaw_early and
->thaw callbacks for those devices in some cases and it sets the
power.direct_complete flag for them for this purpose.

However, it turns out that setting power.direct_complete outside of
the PM core is a bad idea as it triggers an excess invocation of
pm_runtime_enable() in device_resume().

For this reason, provide a helper to clear power.is_late_suspended
and power.is_suspended to be invoked by the middle-layer code in
question instead of setting power.direct_complete and make that code
call the new helper.

Fixes: c4b65157ae (PCI / PM: Take SMART_SUSPEND driver flag into account)
Fixes: 05087360fd (ACPI / PM: Take SMART_SUSPEND driver flag into account)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
2017-12-11 14:32:56 +01:00
..
clock_ops.c PM / clk: Add support for adding a specific clock from device-tree 2016-06-28 00:42:10 +02:00
common.c PM: Avoid false-positive warnings in dev_pm_domain_set() 2016-02-03 19:10:37 +01:00
domain_governor.c PM / QoS: Fix device resume latency framework 2017-11-08 12:14:51 +01:00
domain.c Merge branch 'pm-qos' 2017-11-13 01:33:48 +01:00
generic_ops.c PM / sleep: Remove pm_complete_with_resume_check() 2017-10-11 15:40:29 +02:00
main.c PM / sleep: Avoid excess pm_runtime_enable() calls in device_resume() 2017-12-11 14:32:56 +01:00
Makefile Merge branches 'pm-cpufreq-sched' and 'pm-opp' 2017-11-13 01:40:52 +01:00
power.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qos.c PM / QoS: Fix device resume latency framework 2017-11-08 12:14:51 +01:00
runtime.c PM / runtime: Fix handling of suppliers with disabled runtime PM 2017-12-04 15:12:07 +01:00
sysfs.c PM / QoS: Fix device resume latency framework 2017-11-08 12:14:51 +01:00
trace.c timekeeping: Ignore the bogus sleep time if pm_trace is enabled 2016-11-29 18:02:58 +01:00
wakeirq.c PM / wakeirq: report a wakeup_event on dedicated wekup irq 2017-02-13 22:29:30 +01:00
wakeup.c treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts 2017-11-21 16:35:54 -08:00