Patch "watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling" has been added to the 4.19-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: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling

to the 4.19-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-bcm2835_wdt-fix-wdioc_settimeout-handling.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 60bdacfb3747b8d4d6fe516e0bf1a38ac5f28aa3
Author: Stefan Wahren <wahrenst@xxxxxxx>
Date:   Sun Nov 12 18:32:51 2023 +0100

    watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling
    
    [ Upstream commit f33f5b1fd1be5f5106d16f831309648cb0f1c31d ]
    
    Users report about the unexpected behavior for setting timeouts above
    15 sec on Raspberry Pi. According to watchdog-api.rst the ioctl
    WDIOC_SETTIMEOUT shouldn't fail because of hardware limitations.
    But looking at the code shows that max_timeout based on the
    register value PM_WDOG_TIME_SET, which is the maximum.
    
    Since 664a39236e71 ("watchdog: Introduce hardware maximum heartbeat
    in watchdog core") the watchdog core is able to handle this problem.
    
    This fix has been tested with watchdog-test from selftests.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=217374
    Fixes: 664a39236e71 ("watchdog: Introduce hardware maximum heartbeat in watchdog core")
    Signed-off-by: Stefan Wahren <wahrenst@xxxxxxx>
    Reviewed-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
    Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231112173251.4827-1-wahrenst@xxxxxxx
    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/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
index e6c27b71b136..35389562177b 100644
--- a/drivers/watchdog/bcm2835_wdt.c
+++ b/drivers/watchdog/bcm2835_wdt.c
@@ -41,6 +41,7 @@
 
 #define SECS_TO_WDOG_TICKS(x) ((x) << 16)
 #define WDOG_TICKS_TO_SECS(x) ((x) >> 16)
+#define WDOG_TICKS_TO_MSECS(x) ((x) * 1000 >> 16)
 
 struct bcm2835_wdt {
 	void __iomem		*base;
@@ -137,7 +138,7 @@ static struct watchdog_device bcm2835_wdt_wdd = {
 	.info =		&bcm2835_wdt_info,
 	.ops =		&bcm2835_wdt_ops,
 	.min_timeout =	1,
-	.max_timeout =	WDOG_TICKS_TO_SECS(PM_WDOG_TIME_SET),
+	.max_hw_heartbeat_ms =	WDOG_TICKS_TO_MSECS(PM_WDOG_TIME_SET),
 	.timeout =	WDOG_TICKS_TO_SECS(PM_WDOG_TIME_SET),
 };
 




[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