* [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog.
@ 2016-05-31 6:08 fu.wei
2016-05-31 6:08 ` [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined fu.wei
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: fu.wei @ 2016-05-31 6:08 UTC (permalink / raw)
To: wim, linux, panand
Cc: linux-kernel, linux-watchdog, linux-arm-kernel, linaro-acpi,
timur, dyoung, graeme.gregory, al.stone, jcm,
Suravee.Suthikulpanit, Fu Wei
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined
2016-05-31 6:08 [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog fu.wei
@ 2016-05-31 6:08 ` fu.wei
2016-06-01 21:40 ` Guenter Roeck
2016-05-31 6:08 ` [PATCH 2/3] sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout fu.wei
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: fu.wei @ 2016-05-31 6:08 UTC (permalink / raw)
To: wim, linux, panand
Cc: linux-kernel, linux-watchdog, linux-arm-kernel, linaro-acpi,
timur, dyoung, graeme.gregory, al.stone, jcm,
Suravee.Suthikulpanit, Fu Wei
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;
--
2.5.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout
2016-05-31 6:08 [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog fu.wei
2016-05-31 6:08 ` [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined fu.wei
@ 2016-05-31 6:08 ` fu.wei
2016-06-01 21:43 ` Guenter Roeck
2016-05-31 6:08 ` [PATCH 3/3] sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running fu.wei
2016-07-17 19:51 ` [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog Wim Van Sebroeck
3 siblings, 1 reply; 9+ messages in thread
From: fu.wei @ 2016-05-31 6:08 UTC (permalink / raw)
To: wim, linux, panand
Cc: linux-kernel, linux-watchdog, linux-arm-kernel, linaro-acpi,
timur, dyoung, graeme.gregory, al.stone, jcm,
Suravee.Suthikulpanit, Fu Wei
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);
/*
--
2.5.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running.
2016-05-31 6:08 [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog fu.wei
2016-05-31 6:08 ` [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined fu.wei
2016-05-31 6:08 ` [PATCH 2/3] sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout fu.wei
@ 2016-05-31 6:08 ` fu.wei
2016-06-01 21:43 ` Guenter Roeck
2016-07-17 19:51 ` [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog Wim Van Sebroeck
3 siblings, 1 reply; 9+ messages in thread
From: fu.wei @ 2016-05-31 6:08 UTC (permalink / raw)
To: wim, linux, panand
Cc: linux-kernel, linux-watchdog, linux-arm-kernel, linaro-acpi,
timur, dyoung, graeme.gregory, al.stone, jcm,
Suravee.Suthikulpanit, Fu Wei
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);
--
2.5.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined
2016-05-31 6:08 ` [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined fu.wei
@ 2016-06-01 21:40 ` Guenter Roeck
0 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2016-06-01 21:40 UTC (permalink / raw)
To: fu.wei
Cc: wim, panand, linux-kernel, linux-watchdog, linux-arm-kernel,
linaro-acpi, timur, dyoung, graeme.gregory, al.stone, jcm,
Suravee.Suthikulpanit
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout
2016-05-31 6:08 ` [PATCH 2/3] sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout fu.wei
@ 2016-06-01 21:43 ` Guenter Roeck
0 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2016-06-01 21:43 UTC (permalink / raw)
To: fu.wei
Cc: wim, panand, linux-kernel, linux-watchdog, linux-arm-kernel,
linaro-acpi, timur, dyoung, graeme.gregory, al.stone, jcm,
Suravee.Suthikulpanit
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running.
2016-05-31 6:08 ` [PATCH 3/3] sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running fu.wei
@ 2016-06-01 21:43 ` Guenter Roeck
0 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2016-06-01 21:43 UTC (permalink / raw)
To: fu.wei
Cc: wim, panand, linux-kernel, linux-watchdog, linux-arm-kernel,
linaro-acpi, timur, dyoung, graeme.gregory, al.stone, jcm,
Suravee.Suthikulpanit
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog.
2016-05-31 6:08 [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog fu.wei
` (2 preceding siblings ...)
2016-05-31 6:08 ` [PATCH 3/3] sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running fu.wei
@ 2016-07-17 19:51 ` Wim Van Sebroeck
2016-07-18 15:21 ` Fu Wei
3 siblings, 1 reply; 9+ messages in thread
From: Wim Van Sebroeck @ 2016-07-17 19:51 UTC (permalink / raw)
To: fu.wei
Cc: linux, panand, linux-kernel, linux-watchdog, linux-arm-kernel,
linaro-acpi, timur, dyoung, graeme.gregory, al.stone, jcm,
Suravee.Suthikulpanit
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog.
2016-07-17 19:51 ` [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog Wim Van Sebroeck
@ 2016-07-18 15:21 ` Fu Wei
0 siblings, 0 replies; 9+ messages in thread
From: Fu Wei @ 2016-07-18 15:21 UTC (permalink / raw)
To: Wim Van Sebroeck
Cc: Guenter Roeck, panand, Linux Kernel Mailing List, linux-watchdog,
linux-arm-kernel, Linaro ACPI Mailman List, Timur Tabi, dyoung,
G Gregory, Al Stone, Jon Masters, Suravee Suthikulpanit
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.
>
--
Best regards,
Fu Wei
Software Engineer
Red Hat
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-07-18 15:22 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-31 6:08 [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog fu.wei
2016-05-31 6:08 ` [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined fu.wei
2016-06-01 21:40 ` Guenter Roeck
2016-05-31 6:08 ` [PATCH 2/3] sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout fu.wei
2016-06-01 21:43 ` Guenter Roeck
2016-05-31 6:08 ` [PATCH 3/3] sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running fu.wei
2016-06-01 21:43 ` Guenter Roeck
2016-07-17 19:51 ` [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog Wim Van Sebroeck
2016-07-18 15:21 ` Fu Wei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).