Files
kernel/include/linux
Rafael J. Wysocki 49dd63a6dd PM: runtime: Add safety net to supplier device release
[ Upstream commit d1579e61192e0e686faa4208500ef4c3b529b16c ]

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 12:02:25 +01:00
..
2021-11-23 19:13:00 +01:00
2021-11-17 10:36:15 -05:00
2021-12-10 17:10:55 -08:00
2021-11-17 10:36:35 -05:00
2021-11-06 14:08:17 -07:00
2021-12-17 10:24:07 +00:00
2021-11-10 21:16:56 +00:00
2021-11-17 10:36:35 -05:00
2021-11-06 13:30:43 -07:00
2021-11-03 11:41:25 -07:00
2021-12-09 10:49:56 -08:00