]> git.baikalelectronics.ru Git - kernel.git/commit
PM: runtime: document common mistake with pm_runtime_get_sync()
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Wed, 26 May 2021 16:22:51 +0000 (12:22 -0400)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 31 May 2021 12:17:13 +0000 (14:17 +0200)
commit6dd599f41a33ed85b665b1aa50b5ba27494eeb3a
tree1eddbefcfcc586e30435101425feaa96887eb283
parent522fa64953e0d3fbb5fa5fd7565121714af2a489
PM: runtime: document common mistake with pm_runtime_get_sync()

pm_runtime_get_sync(), contradictory to intuition, does not drop the
runtime PM usage counter on errors which lead to several wrong usages in
drivers (missing the put).  pm_runtime_resume_and_get() was added as a
better implementation so document the preference of using it, hoping it
will stop bad patterns.

Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
[ rjw: Documentation change edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/power/runtime_pm.rst
include/linux/pm_runtime.h