Patch "bus: sunxi-rsb: Fix shutdown" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    bus: sunxi-rsb: Fix shutdown

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bus-sunxi-rsb-fix-shutdown.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 414938c06a53fb28dc0d91c2996431ceca8f730c
Author: Jernej Skrabec <jernej.skrabec@xxxxxxxxx>
Date:   Sun Nov 21 09:35:37 2021 +0100

    bus: sunxi-rsb: Fix shutdown
    
    [ Upstream commit 017a716e7b0e9d4ac06a4d7779bd04fca009bbc9 ]
    
    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: 4a0dbc12e618 ("bus: sunxi-rsb: Implement runtime power management")
    Signed-off-by: Jernej Skrabec <jernej.skrabec@xxxxxxxxx>
    Signed-off-by: Maxime Ripard <maxime@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20211121083537.612473-1-jernej.skrabec@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
index 6f225dddc74f4..4566e730ef2b8 100644
--- a/drivers/bus/sunxi-rsb.c
+++ b/drivers/bus/sunxi-rsb.c
@@ -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)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux