aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/cppc_acpi.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <[email protected]>2022-04-13 15:30:32 +0000
committerRafael J. Wysocki <[email protected]>2022-04-13 15:30:32 +0000
commit82586a721595fde2c1bc0dac7deed2fe9d42c106 (patch)
treed097c447ca632d516bd63b8708584eaec269eb15 /drivers/acpi/cppc_acpi.c
parentiio: chemical: scd30: Move symbol exports into IIO_SCD30 namespace (diff)
downloadkernel-82586a721595fde2c1bc0dac7deed2fe9d42c106.tar.gz
kernel-82586a721595fde2c1bc0dac7deed2fe9d42c106.zip
PM: runtime: Avoid device usage count underflows
A PM-runtime device usage count underflow is potentially critical, because it may cause a device to be suspended when it is expected to be operational. It is also a programming problem that would be good to catch and warn about. For this reason, (1) make rpm_check_suspend_allowed() return an error when the device usage count is negative to prevent devices from being suspended in that case, (2) introduce rpm_drop_usage_count() that will detect device usage count underflows, warn about them and fix them up, and (3) use it to drop the usage count in a few places instead of atomic_dec_and_test(). Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Ulf Hansson <[email protected]>
Diffstat (limited to 'drivers/acpi/cppc_acpi.c')
0 files changed, 0 insertions, 0 deletions