From: Fu Wei fu.wei@linaro.org
This patchset: (1)Try to fix an issue about min and max timeout validity check: when max_hw_heartbeat_ms is defined, this check should be skipped.
(2)Use max_hw_heartbeat_ms instead of max_timeout in SBSA watchdog.
(3)Set WDOG_HW_RUNNING, when SBSA watchdog is already running before it's initialized.
Changelog: v1: The first formal upstreaming version
RFC: https://lkml.org/lkml/2016/5/3/145
Pratyush Anand (3): watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running.
drivers/watchdog/sbsa_gwdt.c | 6 ++++-- drivers/watchdog/watchdog_core.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
From: Pratyush Anand panand@redhat.com
When max_hw_heartbeat_ms has a none zero value, max_timeout is not used. So it's value can be 0. In such case if a driver uses min_timeout functionality, then check will always fail.
This patch fixes above issue.
Signed-off-by: Pratyush Anand panand@redhat.com Signed-off-by: Fu Wei fu.wei@linaro.org --- drivers/watchdog/watchdog_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index 7c3ba58..65e62d1 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c @@ -88,7 +88,7 @@ static void watchdog_check_min_max_timeout(struct watchdog_device *wdd) * Check that we have valid min and max timeout values, if * not reset them both to 0 (=not used or unknown) */ - if (wdd->min_timeout > wdd->max_timeout) { + if (!wdd->max_hw_heartbeat_ms && wdd->min_timeout > wdd->max_timeout) { pr_info("Invalid min and max timeout values, resetting to 0!\n"); wdd->min_timeout = 0; wdd->max_timeout = 0;
On Tue, May 31, 2016 at 02:08:08PM +0800, fu.wei@linaro.org wrote:
From: Pratyush Anand panand@redhat.com
When max_hw_heartbeat_ms has a none zero value, max_timeout is not used. So it's value can be 0. In such case if a driver uses min_timeout functionality, then check will always fail.
This patch fixes above issue.
Signed-off-by: Pratyush Anand panand@redhat.com Signed-off-by: Fu Wei fu.wei@linaro.org
Reviewed-by: Guenter Roeck linux@roeck-us.net
drivers/watchdog/watchdog_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index 7c3ba58..65e62d1 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c @@ -88,7 +88,7 @@ static void watchdog_check_min_max_timeout(struct watchdog_device *wdd) * Check that we have valid min and max timeout values, if * not reset them both to 0 (=not used or unknown) */
- if (wdd->min_timeout > wdd->max_timeout) {
- if (!wdd->max_hw_heartbeat_ms && wdd->min_timeout > wdd->max_timeout) { pr_info("Invalid min and max timeout values, resetting to 0!\n"); wdd->min_timeout = 0; wdd->max_timeout = 0;
-- 2.5.5
-- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Pratyush Anand panand@redhat.com
Using max_hw_heartbeat_ms instead of max_timeout gives the flexibility to achieve higher user "timeout". Therefore, use this new infrastructure.
Signed-off-by: Pratyush Anand panand@redhat.com Signed-off-by: Fu Wei fu.wei@linaro.org --- drivers/watchdog/sbsa_gwdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index ad383f6..6af71e0 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -273,7 +273,7 @@ static int sbsa_gwdt_probe(struct platform_device *pdev) wdd->info = &sbsa_gwdt_info; wdd->ops = &sbsa_gwdt_ops; wdd->min_timeout = 1; - wdd->max_timeout = U32_MAX / gwdt->clk; + wdd->max_hw_heartbeat_ms = U32_MAX / gwdt->clk * 1000; wdd->timeout = DEFAULT_TIMEOUT; watchdog_set_drvdata(wdd, gwdt); watchdog_set_nowayout(wdd, nowayout); @@ -310,7 +310,7 @@ static int sbsa_gwdt_probe(struct platform_device *pdev) * the timeout is (WOR * 2), so the maximum timeout should be doubled. */ if (!action) - wdd->max_timeout *= 2; + wdd->max_hw_heartbeat_ms *= 2;
watchdog_init_timeout(wdd, timeout, dev); /*
On Tue, May 31, 2016 at 02:08:09PM +0800, fu.wei@linaro.org wrote:
From: Pratyush Anand panand@redhat.com
Using max_hw_heartbeat_ms instead of max_timeout gives the flexibility to achieve higher user "timeout". Therefore, use this new infrastructure.
Signed-off-by: Pratyush Anand panand@redhat.com Signed-off-by: Fu Wei fu.wei@linaro.org
Reviewed-by: Guenter Roeck linux@roeck-us.net
drivers/watchdog/sbsa_gwdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index ad383f6..6af71e0 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -273,7 +273,7 @@ static int sbsa_gwdt_probe(struct platform_device *pdev) wdd->info = &sbsa_gwdt_info; wdd->ops = &sbsa_gwdt_ops; wdd->min_timeout = 1;
- wdd->max_timeout = U32_MAX / gwdt->clk;
- wdd->max_hw_heartbeat_ms = U32_MAX / gwdt->clk * 1000; wdd->timeout = DEFAULT_TIMEOUT; watchdog_set_drvdata(wdd, gwdt); watchdog_set_nowayout(wdd, nowayout);
@@ -310,7 +310,7 @@ static int sbsa_gwdt_probe(struct platform_device *pdev) * the timeout is (WOR * 2), so the maximum timeout should be doubled. */ if (!action)
wdd->max_timeout *= 2;
wdd->max_hw_heartbeat_ms *= 2;
watchdog_init_timeout(wdd, timeout, dev); /* -- 2.5.5
-- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Pratyush Anand panand@redhat.com
This patch uses the new flag WDOG_HW_RUNNING in driver. According to the definition of this flag, it should be set, if watchdog is running after booting, before it's opened.
Signed-off-by: Pratyush Anand panand@redhat.com Signed-off-by: Fu Wei fu.wei@linaro.org --- drivers/watchdog/sbsa_gwdt.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index 6af71e0..cc885f1 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -283,6 +283,8 @@ static int sbsa_gwdt_probe(struct platform_device *pdev) dev_warn(dev, "System reset by WDT.\n"); wdd->bootstatus |= WDIOF_CARDRESET; } + if (status & SBSA_GWDT_WCS_EN) + set_bit(WDOG_HW_RUNNING, &wdd->status);
if (action) { irq = platform_get_irq(pdev, 0);
On Tue, May 31, 2016 at 02:08:10PM +0800, fu.wei@linaro.org wrote:
From: Pratyush Anand panand@redhat.com
This patch uses the new flag WDOG_HW_RUNNING in driver. According to the definition of this flag, it should be set, if watchdog is running after booting, before it's opened.
Signed-off-by: Pratyush Anand panand@redhat.com Signed-off-by: Fu Wei fu.wei@linaro.org
Reviewed-by: Guenter Roeck linux@roeck-us.net
drivers/watchdog/sbsa_gwdt.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index 6af71e0..cc885f1 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -283,6 +283,8 @@ static int sbsa_gwdt_probe(struct platform_device *pdev) dev_warn(dev, "System reset by WDT.\n"); wdd->bootstatus |= WDIOF_CARDRESET; }
- if (status & SBSA_GWDT_WCS_EN)
set_bit(WDOG_HW_RUNNING, &wdd->status);
if (action) { irq = platform_get_irq(pdev, 0); -- 2.5.5
-- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Fu,
From: Fu Wei fu.wei@linaro.org
This patchset: (1)Try to fix an issue about min and max timeout validity check: when max_hw_heartbeat_ms is defined, this check should be skipped.
(2)Use max_hw_heartbeat_ms instead of max_timeout in SBSA watchdog. (3)Set WDOG_HW_RUNNING, when SBSA watchdog is already running before it's initialized.
Changelog: v1: The first formal upstreaming version
RFC: https://lkml.org/lkml/2016/5/3/145
Pratyush Anand (3): watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running.
drivers/watchdog/sbsa_gwdt.c | 6 ++++-- drivers/watchdog/watchdog_core.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
-- 2.5.5
These patches have been added to linux-watchdog-next.
Kind regards, Wim.
Hi Wim, Guenter,
Great thanks for your help :-)
On 18 July 2016 at 03:51, Wim Van Sebroeck wim@iguana.be wrote:
Hi Fu,
From: Fu Wei fu.wei@linaro.org
This patchset: (1)Try to fix an issue about min and max timeout validity check: when max_hw_heartbeat_ms is defined, this check should be skipped.
(2)Use max_hw_heartbeat_ms instead of max_timeout in SBSA watchdog. (3)Set WDOG_HW_RUNNING, when SBSA watchdog is already running before it's initialized.
Changelog: v1: The first formal upstreaming version
RFC: https://lkml.org/lkml/2016/5/3/145
Pratyush Anand (3): watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running.
drivers/watchdog/sbsa_gwdt.c | 6 ++++-- drivers/watchdog/watchdog_core.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
-- 2.5.5
These patches have been added to linux-watchdog-next.
Kind regards, Wim.