Patch "watchdog: starfive: Check pm_runtime_enabled() before decrementing usage counter" has been added to the 6.6-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

    watchdog: starfive: Check pm_runtime_enabled() before decrementing usage counter

to the 6.6-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:
     watchdog-starfive-check-pm_runtime_enabled-before-de.patch
and it can be found in the queue-6.6 subdirectory.

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



commit bc00b389769543ee62aba1f307d2ccc1f1e308d2
Author: Ji Sheng Teoh <jisheng.teoh@xxxxxxxxxxxxxxxx>
Date:   Fri Jan 19 16:27:21 2024 +0800

    watchdog: starfive: Check pm_runtime_enabled() before decrementing usage counter
    
    [ Upstream commit 8bc22a2f1bf0f402029087fcb53130233a544fed ]
    
    In the probe function, pm_runtime_put_sync() will fail on platform with
    runtime PM disabled.
    Check if runtime PM is enabled before calling pm_runtime_put_sync() to
    fix it.
    
    Fixes: db728ea9c7be ("drivers: watchdog: Add StarFive Watchdog driver")
    Signed-off-by: Xingyu Wu <xingyu.wu@xxxxxxxxxxxxxxxx>
    Signed-off-by: Ley Foon Tan <leyfoon.tan@xxxxxxxxxxxxxxxx>
    Signed-off-by: Ji Sheng Teoh <jisheng.teoh@xxxxxxxxxxxxxxxx>
    Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240119082722.1133024-1-jisheng.teoh@xxxxxxxxxxxxxxxx
    Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Signed-off-by: Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
index 49b38ecc092dd..e4b344db38030 100644
--- a/drivers/watchdog/starfive-wdt.c
+++ b/drivers/watchdog/starfive-wdt.c
@@ -494,8 +494,13 @@ static int starfive_wdt_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_exit;
 
-	if (!early_enable)
-		pm_runtime_put_sync(&pdev->dev);
+	if (!early_enable) {
+		if (pm_runtime_enabled(&pdev->dev)) {
+			ret = pm_runtime_put_sync(&pdev->dev);
+			if (ret)
+				goto err_exit;
+		}
+	}
 
 	return 0;
 




[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