linux/drivers/base/power
Rafael J. Wysocki 34da25dd21 UPSTAREM: PM: runtime: Update device status before letting suppliers suspend
Because the PM-runtime status of the device is not updated in
__rpm_callback(), attempts to suspend the suppliers of the given
device triggered by rpm_put_suppliers() called by it may fail.

Fix this by making __rpm_callback() update the device's status to
RPM_SUSPENDED before calling rpm_put_suppliers() if the current
status of the device is RPM_SUSPENDING and the callback just invoked
by it has returned 0 (success).

While at it, modify the code in __rpm_callback() to always check
the device's PM-runtime status under its PM lock.

Change-Id: I801d91afcace8fb70fa92b447d8641cd0cd2b0cc
Link: https://lore.kernel.org/linux-pm/CAPDyKFqm06KDw_p8WXsM4dijDbho4bb6T4k50UqqvR1_COsp8g@mail.gmail.com/
Fixes: 21d5c57b37 ("PM / runtime: Use device links")
Reported-by: Elaine Zhang <zhangqing@rock-chips.com>
Diagnosed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Elaine Zhang <zhangiqng@rock-chips.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: 4.10+ <stable@vger.kernel.org> # 4.10+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 44cc89f764)
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-03-09 20:35:02 +08:00
..
clock_ops.c PM / clk: signedness bug in of_pm_clk_add_clks() 2018-08-24 11:52:34 +02:00
common.c PM / Domains: Introduce dev_pm_domain_attach_by_name() 2018-07-09 12:11:02 +02:00
domain_governor.c PM / QoS: Fix device resume latency framework 2017-11-08 12:14:51 +01:00
domain.c Merge tag 'ASB-2020-02-05_4.19' of https://android.googlesource.com/kernel/common 2020-02-17 16:00:29 +08:00
generic_ops.c PM / sleep: Remove pm_complete_with_resume_check() 2017-10-11 15:40:29 +02:00
main.c This is the 4.19.143 stable release 2020-09-03 13:19:20 +02:00
Makefile UPSTREAM: PM / wakeup: Show wakeup sources stats in sysfs 2019-10-11 14:04:42 -07:00
power.h UPSTREAM: PM / wakeup: Register wakeup class kobj after device is added 2019-10-11 14:04:42 -07:00
qos.c PM / QoS: Fix device resume latency framework 2017-11-08 12:14:51 +01:00
runtime.c UPSTAREM: PM: runtime: Update device status before letting suppliers suspend 2021-03-09 20:35:02 +08:00
sysfs.c UPSTREAM: PM / wakeup: Register wakeup class kobj after device is added 2019-10-11 14:04:42 -07: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: Add wakeup name to dedicated wake irqs 2018-02-26 23:23:37 +01:00
wakeup_stats.c UPSTREAM: PM / wakeup: Unexport wakeup_source_sysfs_{add,remove}() 2019-10-11 14:04:42 -07:00
wakeup.c UPSTREAM: PM: sleep: wakeup: Skip wakeup_source_sysfs_remove() if device is not there 2020-11-16 07:43:08 +01:00