linux/drivers/base
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
..
firmware_loader This is the 4.19.116 stable release 2020-04-18 13:33:51 +02:00
memory_group_manager Add memory_group_manager introduced by Bifrost DDK r20p0-01rel0 2019-10-15 10:10:21 +08:00
power UPSTAREM: PM: runtime: Update device status before letting suppliers suspend 2021-03-09 20:35:02 +08:00
regmap This is the 4.19.168 stable release 2021-01-17 15:40:58 +01:00
test
arch_topology.c ANDROID: implement max frequency capping 2018-10-26 12:25:24 +01:00
attribute_container.c
base.h Merge tag 'ASB-2020-12-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-12-29 16:10:48 +08:00
bus.c UPSTREAM: driver core: Probe devices asynchronously instead of the driver 2020-03-23 10:28:09 +08:00
cacheinfo.c drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT 2019-07-21 09:03:03 +02:00
class.c
component.c component: Silence bind error on -EPROBE_DEFER 2020-05-27 17:37:33 +02:00
container.c
core.c Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
cpu.c This is the 4.19.128 stable release 2020-06-11 09:16:29 +02:00
dd.c Merge tag 'ASB-2020-12-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-12-29 16:10:48 +08:00
devcon.c drivers: base: Unified device connection lookup 2018-03-22 13:10:29 +01:00
devcoredump.c
devres.c devres: Align data[] to ARCH_KMALLOC_MINALIGN 2019-02-12 19:46:56 +01:00
devtmpfs.c kernel: add ksys_unshare() helper; remove in-kernel calls to sys_unshare() 2018-04-02 20:16:06 +02:00
driver.c driver-core: return EINVAL error instead of BUG_ON() 2018-05-25 18:18:45 +02:00
firmware.c
hypervisor.c
init.c base: fix order of OF initialization 2018-07-07 17:54:29 +02:00
isa.c Merge 4.15-rc3 into driver-core-next 2017-12-11 08:50:05 +01:00
Kconfig cma: decrease CMA_ALIGNMENT lower limit to 0 2020-12-08 20:40:46 +08:00
Makefile Add memory_group_manager introduced by Bifrost DDK r20p0-01rel0 2019-10-15 10:10:21 +08:00
map.c
memory.c mm/memory_hotplug: fix try_offline_node() 2020-01-29 16:43:27 +01:00
module.c
node.c This is the 4.19.150 stable release 2020-10-07 08:45:35 +02:00
pinctrl.c
platform-msi.c platform-msi: Free descriptors in platform_msi_domain_free() 2019-01-09 17:38:42 +01:00
platform.c Merge tag 'ASB-2020-09-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-09-24 17:59:50 +08:00
property.c device property: Get rid of union aliasing 2018-05-17 12:47:21 +02:00
soc.c ANDROID: GKI: drivers: base: soc: export symbols for socinfo 2020-04-10 18:15:14 -07:00
syscore.c ANDROID: power: wakeup_reason: add an API to log wakeup reasons 2018-12-05 09:48:13 -08:00
topology.c
transport_class.c