Skip to content

Commit 017a716

Browse files
jernejskmripard
authored andcommitted
bus: sunxi-rsb: Fix shutdown
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: 4a0dbc1 ("bus: sunxi-rsb: Implement runtime power management") Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fa55b7d commit 017a716

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/bus/sunxi-rsb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,11 @@ static int sunxi_rsb_hw_init(struct sunxi_rsb *rsb)
687687

688688
static void sunxi_rsb_hw_exit(struct sunxi_rsb *rsb)
689689
{
690-
/* Keep the clock and PM reference counts consistent. */
691-
if (pm_runtime_status_suspended(rsb->dev))
692-
pm_runtime_resume(rsb->dev);
693690
reset_control_assert(rsb->rstc);
694-
clk_disable_unprepare(rsb->clk);
691+
692+
/* Keep the clock and PM reference counts consistent. */
693+
if (!pm_runtime_status_suspended(rsb->dev))
694+
clk_disable_unprepare(rsb->clk);
695695
}
696696

697697
static int __maybe_unused sunxi_rsb_runtime_suspend(struct device *dev)

0 commit comments

Comments
 (0)