linux-stable/include
Rafael J. Wysocki 37b25de3af PM: runtime: Add safety net to supplier device release
[ Upstream commit d1579e6119 ]

Because refcount_dec_not_one() returns true if the target refcount
becomes saturated, it is generally unsafe to use its return value as
a loop termination condition, but that is what happens when a device
link's supplier device is released during runtime PM suspend
operations and on device link removal.

To address this, introduce pm_runtime_release_supplier() to be used
in the above cases which will check the supplier device's runtime
PM usage counter in addition to the refcount_dec_not_one() return
value, so the loop can be terminated in case the rpm_active refcount
value becomes invalid, and update the code in question to use it as
appropriate.

This change is not expected to have any visible functional impact.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 10:54:17 +01:00
..
acpi ACPI: Change acpi_device_always_present() into acpi_device_override_status() 2022-01-27 10:54:13 +01:00
asm-generic vmlinux.lds.h: Handle clang's module.{c,d}tor sections 2021-08-18 08:59:18 +02:00
clocksource clocksource/drivers/timer-ti-dm: Save and restore timer TIOCP_CFG 2021-07-14 16:56:12 +02:00
crypto crypto: public_key: fix overflow during implicit conversion 2021-09-18 13:40:08 +02:00
drm drm: protect drm_master pointers in drm_lease.c 2021-09-18 13:40:19 +02:00
dt-bindings clk: imx8mq: remove SYS PLL 1/2 clock gates 2021-07-14 16:56:20 +02:00
keys certs: Add EFI_CERT_X509_GUID support for dbx entries 2021-06-30 08:47:30 -04:00
kunit
kvm
linux PM: runtime: Add safety net to supplier device release 2022-01-27 10:54:17 +01:00
math-emu
media media: subdev: disallow ioctl for saa6588/davinci 2021-07-19 09:45:02 +02:00
memory memory: renesas-rpc-if: Correct QSPI data transfer in Manual mode 2021-11-18 14:03:47 +01:00
misc
net sctp: use call_rcu to free endpoint 2022-01-05 12:40:30 +01:00
pcmcia
ras
rdma RDMA/netlink: Add __maybe_unused to static inline in C file 2021-11-26 10:39:21 +01:00
scsi scsi: iscsi: Fix conn use after free during resets 2021-07-20 16:05:41 +02:00
soc firmware: raspberrypi: Keep count of all consumers 2021-09-15 09:50:41 +02:00
sound ALSA: hda: hdac_ext_stream: fix potential locking issues 2021-11-26 10:39:22 +01:00
target scsi: target: Fix ordered tag handling 2021-11-26 10:39:11 +01:00
trace cgroup: Trace event cgroup id fields should be u64 2022-01-27 10:53:52 +01:00
uapi uapi: fix linux/nfc.h userspace compilation errors 2022-01-05 12:40:32 +01:00
vdso
video
xen xen: sync include/xen/interface/io/ring.h with Xen's newest version 2021-12-01 09:19:09 +01:00