Patch "watchdog: stm32_iwdg: initialize default timeout" 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: stm32_iwdg: initialize default timeout

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-stm32_iwdg-initialize-default-timeout.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 6922ca91229be13dbe38c6e47ee9093b77f9243b
Author: Ben Wolsieffer <ben.wolsieffer@xxxxxxxxxxx>
Date:   Wed Feb 28 13:27:23 2024 -0500

    watchdog: stm32_iwdg: initialize default timeout
    
    [ Upstream commit dbd7c0088b7f44aa0b9276ed3449df075a7b5b54 ]
    
    The driver never sets a default timeout value, therefore it is
    initialized to zero. When CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED is
    enabled, the watchdog is started during probe. The kernel is supposed to
    automatically ping the watchdog from this point until userspace takes
    over, but this does not happen if the configured timeout is zero. A zero
    timeout causes watchdog_need_worker() to return false, so the heartbeat
    worker does not run and the system therefore resets soon after the
    driver is probed.
    
    This patch fixes this by setting an arbitrary non-zero default timeout.
    The default could be read from the hardware instead, but I didn't see
    any reason to add this complexity.
    
    This has been tested on an STM32F746.
    
    Fixes: 85fdc63fe256 ("drivers: watchdog: stm32_iwdg: set WDOG_HW_RUNNING at probe")
    Signed-off-by: Ben Wolsieffer <ben.wolsieffer@xxxxxxxxxxx>
    Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240228182723.12855-1-ben.wolsieffer@xxxxxxxxxxx
    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/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
index d9fd50df9802c..5404e03876202 100644
--- a/drivers/watchdog/stm32_iwdg.c
+++ b/drivers/watchdog/stm32_iwdg.c
@@ -20,6 +20,8 @@
 #include <linux/platform_device.h>
 #include <linux/watchdog.h>
 
+#define DEFAULT_TIMEOUT 10
+
 /* IWDG registers */
 #define IWDG_KR		0x00 /* Key register */
 #define IWDG_PR		0x04 /* Prescaler Register */
@@ -248,6 +250,7 @@ static int stm32_iwdg_probe(struct platform_device *pdev)
 	wdd->parent = dev;
 	wdd->info = &stm32_iwdg_info;
 	wdd->ops = &stm32_iwdg_ops;
+	wdd->timeout = DEFAULT_TIMEOUT;
 	wdd->min_timeout = DIV_ROUND_UP((RLR_MIN + 1) * PR_MIN, wdt->rate);
 	wdd->max_hw_heartbeat_ms = ((RLR_MAX + 1) * wdt->data->max_prescaler *
 				    1000) / wdt->rate;




[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