linux/drivers/base/power
Prasad Sodagudi bcbaadf442 UPSTREAM: PM: sleep: core: Avoid setting power.must_resume to false
There are variables(power.may_skip_resume and dev->power.must_resume)
and DPM_FLAG_MAY_SKIP_RESUME flags to control the resume of devices after
a system wide suspend transition.

Setting the DPM_FLAG_MAY_SKIP_RESUME flag means that the driver allows
its "noirq" and "early" resume callbacks to be skipped if the device
can be left in suspend after a system-wide transition into the working
state. PM core determines that the driver's "noirq" and "early" resume
callbacks should be skipped or not with dev_pm_skip_resume() function by
checking power.may_skip_resume variable.

power.must_resume variable is getting set to false in __device_suspend()
function without checking device's DPM_FLAG_MAY_SKIP_RESUME settings.
In problematic scenario, where all the devices in the suspend_late
stage are successful and some device can fail to suspend in
suspend_noirq phase. So some devices successfully suspended in suspend_late
stage are not getting chance to execute __device_suspend_noirq()
to set dev->power.must_resume variable to true and not getting
resumed in early_resume phase.

Add a check for device's DPM_FLAG_MAY_SKIP_RESUME flag before
setting power.must_resume variable in __device_suspend function.

Fixes: 6e176bf8d4 ("PM: sleep: core: Do not skip callbacks in the resume phase")
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Bug: 195393473
Change-Id: I641a7ba20cc14f6519e1869b4651cda894400274
(cherry picked from commit 4a9344cd0a)
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2021-09-15 15:25:30 +00:00
..
clock_ops.c
common.c PM / Domains: Introduce dev_pm_domain_start() 2019-11-13 11:41:50 +01:00
domain_governor.c UPSTREAM: PM: domains: use device's next wakeup to determine domain idle state 2021-04-23 18:42:36 -07:00
domain.c UPSTREAM: PM: domains: inform PM domain of a device's next wakeup 2021-04-23 18:42:36 -07:00
generic_ops.c
main.c UPSTREAM: PM: sleep: core: Avoid setting power.must_resume to false 2021-09-15 15:25:30 +00:00
Makefile PM / QoS: Initial kunit test 2019-11-29 12:04:49 +01:00
power.h drivers/base/power: add dpm_sysfs_change_owner() 2020-02-26 20:07:25 -08:00
qos-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
qos.c ANDROID: GKI: export dev_pm_qos_read_value 2020-11-28 05:52:16 +00:00
runtime.c Revert "Revert "PM: runtime: Fix unpaired parent child_count for force_resume"" 2021-06-04 11:15:17 -07:00
sysfs.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
trace.c PM: sleep: core: mark 2 functions as __init to save some memory 2020-06-23 17:35:33 +02:00
wakeirq.c PM / wakeirq: remove unnecessary parentheses 2019-11-13 11:31:08 +01:00
wakeup_stats.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
wakeup.c ANDROID: power: wakeup_reason: wake reason enhancements 2020-04-09 15:25:04 +00:00