Files
android_kernel_xiaomi_sm8450/include/linux
Rafael J. Wysocki 37b25de3af 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 10:54:17 +01:00
..
2020-07-21 08:24:52 -05:00
2020-09-21 15:00:40 -07:00
2020-10-02 15:00:49 -07:00
2020-10-16 17:21:51 +02:00
2020-08-12 20:42:08 +02:00
2021-11-26 10:39:22 +01:00
2020-07-24 17:12:41 -07:00
2020-08-04 21:02:38 -04:00
2020-09-16 08:54:53 -05:00
2020-08-26 12:41:56 +02:00
2020-11-19 22:38:29 -05:00
2020-10-13 18:38:32 -07:00
2021-03-04 11:37:59 +01:00
2020-09-04 09:25:20 -07:00
2021-02-07 15:37:17 +01:00
2021-11-18 14:03:37 +01:00
2021-09-15 09:50:41 +02:00
2020-09-04 12:46:07 +01:00
2021-06-30 08:47:26 -04:00
2020-08-27 16:06:47 -04:00
2020-10-07 14:28:39 -04:00
2021-11-18 14:04:23 +01:00
2021-09-03 10:09:21 +02:00
2020-07-23 17:34:18 +10:00
2020-08-31 12:52:33 -07:00
2021-03-30 14:32:05 +02:00
2020-10-18 09:27:10 -07:00
2020-08-18 17:06:15 +02:00
2020-08-07 11:33:24 -07:00
2021-08-04 12:46:44 +02:00
2020-09-26 22:55:05 -04:00
2021-05-07 11:04:32 +02:00
2021-05-14 09:50:18 +02:00
2021-05-14 09:50:18 +02:00
2021-05-14 09:50:31 +02:00
2020-09-10 14:03:31 -07:00
2020-08-01 11:28:17 +02:00
2021-08-26 08:35:41 -04:00
2020-10-05 13:21:49 +02:00
2021-12-14 11:32:39 +01:00