]> git.baikalelectronics.ru Git - kernel.git/commit
PM: runtime: Improve path in rpm_idle() when no callback
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 8 Jun 2021 09:02:48 +0000 (11:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:57 +0000 (11:40 +0100)
commit0bb04bc4ce06c3827031e7d850066e03df22a73c
tree6c989b3d1b5d1da663664ecf626259b07fdd9392
parent631f3776ec0bc58e798a918e3c5bc71059750ef3
PM: runtime: Improve path in rpm_idle() when no callback

[ Upstream commit 32b1133a4bde4a73f6af41841a28ddaa914d6875 ]

When pm_runtime_no_callbacks() has been called for a struct device to set
the dev->power.no_callbacks flag for it, it enables rpm_idle() to take a
slightly quicker path by assuming that a ->runtime_idle() callback would
have returned 0 to indicate success.

A device that does not have the dev->power.no_callbacks flag set for it,
may still be missing a corresponding ->runtime_idle() callback, in which
case the slower path in rpm_idle() is taken. Let's improve the behaviour
for this case, by aligning code to the quicker path.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: bc80c2e438dc ("PM: runtime: Do not call __rpm_callback() from rpm_idle()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/base/power/runtime.c