mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
bus: sunxi-rsb: Fix shutdown
[ Upstream commit017a716e7b] Function sunxi_rsb_hw_exit() is sometimes called with pm runtime disabled, so in such cases pm_runtime_resume() will fail with -EACCES. Instead of doing whole dance of enabling pm runtime and thus clock just to disable it again immediately, just check if disabling clock is needed. That way calling pm_runtime_resume() is not needed at all. Fixes:4a0dbc12e6("bus: sunxi-rsb: Implement runtime power management") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20211121083537.612473-1-jernej.skrabec@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
115a291395
commit
512dbc1a09
@@ -687,11 +687,11 @@ err_clk_disable:
|
||||
|
||||
static void sunxi_rsb_hw_exit(struct sunxi_rsb *rsb)
|
||||
{
|
||||
/* Keep the clock and PM reference counts consistent. */
|
||||
if (pm_runtime_status_suspended(rsb->dev))
|
||||
pm_runtime_resume(rsb->dev);
|
||||
reset_control_assert(rsb->rstc);
|
||||
clk_disable_unprepare(rsb->clk);
|
||||
|
||||
/* Keep the clock and PM reference counts consistent. */
|
||||
if (!pm_runtime_status_suspended(rsb->dev))
|
||||
clk_disable_unprepare(rsb->clk);
|
||||
}
|
||||
|
||||
static int __maybe_unused sunxi_rsb_runtime_suspend(struct device *dev)
|
||||
|
||||
Reference in New Issue
Block a user