]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: Get runtime PM before walking tree for clk_summary
authorStephen Boyd <sboyd@kernel.org>
Mon, 25 Mar 2024 18:41:59 +0000 (11:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2024 15:07:12 +0000 (17:07 +0200)
commit83ada89e4a86e2b28ea2b5113c76d6dc7560a4d0
treea4844e865e411ca4fca6caebb664d552b80cde8d
parent5a704c267a210e1ea097e1d80bfc6620a706051d
clk: Get runtime PM before walking tree for clk_summary

[ Upstream commit 9d1e795f754db1ac3344528b7af0b17b8146f321 ]

Similar to the previous commit, we should make sure that all devices are
runtime resumed before printing the clk_summary through debugfs. Failure
to do so would result in a deadlock if the thread is resuming a device
to print clk state and that device is also runtime resuming in another
thread, e.g the screen is turning on and the display driver is starting
up. We remove the calls to clk_pm_runtime_{get,put}() in this path
because they're superfluous now that we know the devices are runtime
resumed. This also squashes a bug where the return value of
clk_pm_runtime_get() wasn't checked, leading to an RPM count underflow
on error paths.

Fixes: 1bb294a7981c ("clk: Enable/Disable runtime PM for clk_summary")
Cc: Taniya Das <quic_tdas@quicinc.com>
Cc: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20240325184204.745706-6-sboyd@kernel.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk.c