linux/drivers/base
Rafael J. Wysocki 44cc89f764 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.

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>
2021-03-01 17:40:38 +01:00
..
firmware_loader drivers: base: fix some kernel-doc markups 2020-11-09 18:56:49 +01:00
power PM: runtime: Update device status before letting suppliers suspend 2021-03-01 17:40:38 +01:00
regmap Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
test drivers/base: build kunit tests without structleak plugin 2021-01-27 14:35:18 +01:00
arch_numa.c arch_numa: fix common code printing of phys_addr_t 2021-02-18 23:18:04 -08:00
arch_topology.c Driver Core patches for 5.10-rc1 2020-10-14 16:09:32 -07:00
attribute_container.c scsi: drivers: base: Support atomic version of attribute_container_device_trigger 2020-01-15 22:55:36 -05:00
auxiliary.c driver core: auxiliary bus: Fix calling stage for auxiliary bus init 2021-02-11 08:43:03 +01:00
base.h driver core: auxiliary bus: Fix calling stage for auxiliary bus init 2021-02-11 08:43:03 +01:00
bus.c drivers: base: change 'driver_create_groups' to 'driver_add_groups' in printk 2021-01-27 14:35:09 +01:00
cacheinfo.c drivers core: Use sysfs_emit for shared_cpu_map_show and shared_cpu_list_show 2020-10-02 13:24:40 +02:00
class.c drivers: base: fix some kernel-doc markups 2020-11-09 18:56:49 +01:00
component.c component: Silence bind error on -EPROBE_DEFER 2020-04-28 17:54:15 +02:00
container.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
core.c Driver core / debugfs update for 5.12-rc1 2021-02-24 10:13:55 -08:00
cpu.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
dd.c Revert "driver core: Reorder devices on successful probe" 2021-01-12 19:02:29 +01:00
devcoredump.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
devres.c drivers: base: fix some kernel-doc markups 2020-11-09 18:56:49 +01:00
devtmpfs.c namei: prepare for idmapped mounts 2021-01-24 14:27:18 +01:00
driver.c drivers: base: Convert to printk alias functions 2020-07-10 14:16:44 +02:00
firmware.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
hypervisor.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
init.c driver core: auxiliary bus: Fix calling stage for auxiliary bus init 2021-02-11 08:43:03 +01:00
isa.c isa: Make the remove callback for isa drivers return void 2021-01-26 07:42:27 +01:00
Kconfig RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
Makefile numa: Move numa implementation to common code 2021-01-14 15:08:55 -08:00
map.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
memory.c drivers/base/memory: don't store phys_device in memory blocks 2021-02-26 09:41:00 -08:00
module.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
node.c mm: memcg: add swapcache stat for memcg v2 2021-02-24 13:38:29 -08:00
pinctrl.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
platform-msi.c platform-msi: Track shared domain allocation 2020-12-11 14:47:50 +00:00
platform.c Driver core / debugfs update for 5.12-rc1 2021-02-24 10:13:55 -08:00
property.c media: device property: Call fwnode_graph_get_endpoint_by_id() for fwnode->secondary 2021-01-26 19:24:18 +01:00
soc.c soc: fix comment for freeing soc_dev_attr 2020-12-09 19:46:31 +01:00
swnode.c media updates for v5.12-rc1 2021-02-21 14:10:36 -08:00
syscore.c syscore: Use pm_pr_dbg() for syscore_{suspend,resume}() 2020-09-08 13:32:06 +02:00
topology.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
transport_class.c scsi: drivers: base: Propagate errors through the transport component 2020-01-15 22:55:37 -05:00