Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value
@ 2019-11-21 10:35 Wang, Peng 1. (NSB - CN/Hangzhou)
  2019-11-21 14:15 ` Guenter Roeck
  2019-11-22  5:38 ` Guenter Roeck
  0 siblings, 2 replies; 7+ messages in thread
From: Wang, Peng 1. (NSB - CN/Hangzhou) @ 2019-11-21 10:35 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: wim, linux-watchdog, linux-kernel

From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 2001
From: Peng Wang <peng.1.wang@nokia-sbell.com>
Date: Wed, 20 Nov 2019 15:12:59 +0800
Subject: [PATCH] watchdog: make DesignWare watchdog allow users to set bigger
 timeout value

watchdog_dev.c provides means to allow users to set bigger timeout value
than HW can support, make DesignWare watchdog align with this.

---

v2 -> v1:
       - use top_s to compare with wdd->max_hw_heartbeat_ms
       - update wdd->timeout in case it's greater than HW supports
       - fix comments error

v1: initial version

Signed-off-by: Peng Wang <peng.1.wang@nokia-sbell.com>
---
 drivers/watchdog/dw_wdt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index fef7c61..12c116e 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s)
 	writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT,
 	       dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
 
-	wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
+	/*
+	 * In case users set bigger timeout value than HW can support,
+	 * kernel(watchdog_dev.c) helps to feed watchdog before 
+	 * wdd->max_hw_heartbeat_ms
+	 */
+	if ( top_s * 1000 <= wdd->max_hw_heartbeat_ms )
+		wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
+	else
+		wdd->timeout = top_s;
 
 	return 0;
 }
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value
  2019-11-21 10:35 [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value Wang, Peng 1. (NSB - CN/Hangzhou)
@ 2019-11-21 14:15 ` Guenter Roeck
  2019-11-22  1:16   ` Wang, Peng 1. (NSB - CN/Hangzhou)
  2019-11-22  5:38 ` Guenter Roeck
  1 sibling, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2019-11-21 14:15 UTC (permalink / raw)
  To: Wang, Peng 1. (NSB - CN/Hangzhou)
  Cc: Guenter Roeck, wim, linux-watchdog, linux-kernel

On Thu, Nov 21, 2019 at 10:35:12AM +0000, Wang, Peng 1. (NSB - CN/Hangzhou) wrote:
> From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 2001
> From: Peng Wang <peng.1.wang@nokia-sbell.com>
> Date: Wed, 20 Nov 2019 15:12:59 +0800
> Subject: [PATCH] watchdog: make DesignWare watchdog allow users to set bigger
>  timeout value
> 
> watchdog_dev.c provides means to allow users to set bigger timeout value
> than HW can support, make DesignWare watchdog align with this.
> 
> ---
> 
> v2 -> v1:
>        - use top_s to compare with wdd->max_hw_heartbeat_ms
>        - update wdd->timeout in case it's greater than HW supports
>        - fix comments error
> 
> v1: initial version
> 
> Signed-off-by: Peng Wang <peng.1.wang@nokia-sbell.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/dw_wdt.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index fef7c61..12c116e 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s)
>  	writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT,
>  	       dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
>  
> -	wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
> +	/*
> +	 * In case users set bigger timeout value than HW can support,
> +	 * kernel(watchdog_dev.c) helps to feed watchdog before 
> +	 * wdd->max_hw_heartbeat_ms
> +	 */
> +	if ( top_s * 1000 <= wdd->max_hw_heartbeat_ms )
> +		wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
> +	else
> +		wdd->timeout = top_s;
>  
>  	return 0;
>  }
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value
  2019-11-21 14:15 ` Guenter Roeck
@ 2019-11-22  1:16   ` Wang, Peng 1. (NSB - CN/Hangzhou)
  2019-11-22  2:41     ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Wang, Peng 1. (NSB - CN/Hangzhou) @ 2019-11-22  1:16 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Guenter Roeck, wim, linux-watchdog, linux-kernel

> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Roeck, thanks for your time to guide me to finish the review. Do I need to re-send a mail with your sign?

Peng Wang

-----Original Message-----
From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter Roeck
Sent: Thursday, November 21, 2019 10:15 PM
To: Wang, Peng 1. (NSB - CN/Hangzhou) <peng.1.wang@nokia-sbell.com>
Cc: Guenter Roeck <groeck7@gmail.com>; wim@linux-watchdog.org; linux-watchdog@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value

On Thu, Nov 21, 2019 at 10:35:12AM +0000, Wang, Peng 1. (NSB - CN/Hangzhou) wrote:
> From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 2001
> From: Peng Wang <peng.1.wang@nokia-sbell.com>
> Date: Wed, 20 Nov 2019 15:12:59 +0800
> Subject: [PATCH] watchdog: make DesignWare watchdog allow users to set 
> bigger  timeout value
> 
> watchdog_dev.c provides means to allow users to set bigger timeout 
> value than HW can support, make DesignWare watchdog align with this.
> 
> ---
> 
> v2 -> v1:
>        - use top_s to compare with wdd->max_hw_heartbeat_ms
>        - update wdd->timeout in case it's greater than HW supports
>        - fix comments error
> 
> v1: initial version
> 
> Signed-off-by: Peng Wang <peng.1.wang@nokia-sbell.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/dw_wdt.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c 
> index fef7c61..12c116e 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s)
>  	writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT,
>  	       dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
>  
> -	wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
> +	/*
> +	 * In case users set bigger timeout value than HW can support,
> +	 * kernel(watchdog_dev.c) helps to feed watchdog before 
> +	 * wdd->max_hw_heartbeat_ms
> +	 */
> +	if ( top_s * 1000 <= wdd->max_hw_heartbeat_ms )
> +		wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
> +	else
> +		wdd->timeout = top_s;
>  
>  	return 0;
>  }
> --
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value
  2019-11-22  1:16   ` Wang, Peng 1. (NSB - CN/Hangzhou)
@ 2019-11-22  2:41     ` Guenter Roeck
  2019-11-22  3:20       ` Wang, Peng 1. (NSB - CN/Hangzhou)
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2019-11-22  2:41 UTC (permalink / raw)
  To: Wang, Peng 1. (NSB - CN/Hangzhou)
  Cc: Guenter Roeck, wim, linux-watchdog, linux-kernel

On 11/21/19 5:16 PM, Wang, Peng 1. (NSB - CN/Hangzhou) wrote:
>> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> Roeck, thanks for your time to guide me to finish the review. Do I need to re-send a mail with your sign?
> 

No, that won't be necessary.

Guenter

> Peng Wang
> 
> -----Original Message-----
> From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter Roeck
> Sent: Thursday, November 21, 2019 10:15 PM
> To: Wang, Peng 1. (NSB - CN/Hangzhou) <peng.1.wang@nokia-sbell.com>
> Cc: Guenter Roeck <groeck7@gmail.com>; wim@linux-watchdog.org; linux-watchdog@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value
> 
> On Thu, Nov 21, 2019 at 10:35:12AM +0000, Wang, Peng 1. (NSB - CN/Hangzhou) wrote:
>>  From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 2001
>> From: Peng Wang <peng.1.wang@nokia-sbell.com>
>> Date: Wed, 20 Nov 2019 15:12:59 +0800
>> Subject: [PATCH] watchdog: make DesignWare watchdog allow users to set
>> bigger  timeout value
>>
>> watchdog_dev.c provides means to allow users to set bigger timeout
>> value than HW can support, make DesignWare watchdog align with this.
>>
>> ---
>>
>> v2 -> v1:
>>         - use top_s to compare with wdd->max_hw_heartbeat_ms
>>         - update wdd->timeout in case it's greater than HW supports
>>         - fix comments error
>>
>> v1: initial version
>>
>> Signed-off-by: Peng Wang <peng.1.wang@nokia-sbell.com>
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
>> ---
>>   drivers/watchdog/dw_wdt.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
>> index fef7c61..12c116e 100644
>> --- a/drivers/watchdog/dw_wdt.c
>> +++ b/drivers/watchdog/dw_wdt.c
>> @@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s)
>>   	writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT,
>>   	       dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
>>   
>> -	wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
>> +	/*
>> +	 * In case users set bigger timeout value than HW can support,
>> +	 * kernel(watchdog_dev.c) helps to feed watchdog before
>> +	 * wdd->max_hw_heartbeat_ms
>> +	 */
>> +	if ( top_s * 1000 <= wdd->max_hw_heartbeat_ms )
>> +		wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
>> +	else
>> +		wdd->timeout = top_s;
>>   
>>   	return 0;
>>   }
>> --
>> 1.8.3.1
>>
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value
  2019-11-22  2:41     ` Guenter Roeck
@ 2019-11-22  3:20       ` Wang, Peng 1. (NSB - CN/Hangzhou)
  0 siblings, 0 replies; 7+ messages in thread
From: Wang, Peng 1. (NSB - CN/Hangzhou) @ 2019-11-22  3:20 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Guenter Roeck, wim, linux-watchdog, linux-kernel

> No, that won't be necessary.

ok, thank you very much again :)

Peng Wang
-----Original Message-----
From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter Roeck
Sent: Friday, November 22, 2019 10:41 AM
To: Wang, Peng 1. (NSB - CN/Hangzhou) <peng.1.wang@nokia-sbell.com>
Cc: Guenter Roeck <groeck7@gmail.com>; wim@linux-watchdog.org; linux-watchdog@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value

On 11/21/19 5:16 PM, Wang, Peng 1. (NSB - CN/Hangzhou) wrote:
>> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> Roeck, thanks for your time to guide me to finish the review. Do I need to re-send a mail with your sign?
> 

No, that won't be necessary.

Guenter

> Peng Wang
> 
> -----Original Message-----
> From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter 
> Roeck
> Sent: Thursday, November 21, 2019 10:15 PM
> To: Wang, Peng 1. (NSB - CN/Hangzhou) <peng.1.wang@nokia-sbell.com>
> Cc: Guenter Roeck <groeck7@gmail.com>; wim@linux-watchdog.org; 
> linux-watchdog@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v2] watchdog: make DesignWare watchdog allow users 
> to set bigger timeout value
> 
> On Thu, Nov 21, 2019 at 10:35:12AM +0000, Wang, Peng 1. (NSB - CN/Hangzhou) wrote:
>>  From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 
>> 2001
>> From: Peng Wang <peng.1.wang@nokia-sbell.com>
>> Date: Wed, 20 Nov 2019 15:12:59 +0800
>> Subject: [PATCH] watchdog: make DesignWare watchdog allow users to 
>> set bigger  timeout value
>>
>> watchdog_dev.c provides means to allow users to set bigger timeout 
>> value than HW can support, make DesignWare watchdog align with this.
>>
>> ---
>>
>> v2 -> v1:
>>         - use top_s to compare with wdd->max_hw_heartbeat_ms
>>         - update wdd->timeout in case it's greater than HW supports
>>         - fix comments error
>>
>> v1: initial version
>>
>> Signed-off-by: Peng Wang <peng.1.wang@nokia-sbell.com>
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
>> ---
>>   drivers/watchdog/dw_wdt.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c 
>> index fef7c61..12c116e 100644
>> --- a/drivers/watchdog/dw_wdt.c
>> +++ b/drivers/watchdog/dw_wdt.c
>> @@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s)
>>   	writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT,
>>   	       dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
>>   
>> -	wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
>> +	/*
>> +	 * In case users set bigger timeout value than HW can support,
>> +	 * kernel(watchdog_dev.c) helps to feed watchdog before
>> +	 * wdd->max_hw_heartbeat_ms
>> +	 */
>> +	if ( top_s * 1000 <= wdd->max_hw_heartbeat_ms )
>> +		wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
>> +	else
>> +		wdd->timeout = top_s;
>>   
>>   	return 0;
>>   }
>> --
>> 1.8.3.1
>>
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value
  2019-11-21 10:35 [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value Wang, Peng 1. (NSB - CN/Hangzhou)
  2019-11-21 14:15 ` Guenter Roeck
@ 2019-11-22  5:38 ` Guenter Roeck
  2019-11-25  1:37   ` Wang, Peng 1. (NSB - CN/Hangzhou)
  1 sibling, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2019-11-22  5:38 UTC (permalink / raw)
  To: Wang, Peng 1. (NSB - CN/Hangzhou), Guenter Roeck
  Cc: wim, linux-watchdog, linux-kernel

On 11/21/19 2:35 AM, Wang, Peng 1. (NSB - CN/Hangzhou) wrote:
>  From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 2001
> From: Peng Wang <peng.1.wang@nokia-sbell.com>
> Date: Wed, 20 Nov 2019 15:12:59 +0800
> Subject: [PATCH] watchdog: make DesignWare watchdog allow users to set bigger
>   timeout value
>
> watchdog_dev.c provides means to allow users to set bigger timeout value
> than HW can support, make DesignWare watchdog align with this.
>
> ---
>
> v2 -> v1:
>         - use top_s to compare with wdd->max_hw_heartbeat_ms
>         - update wdd->timeout in case it's greater than HW supports
>         - fix comments error
>
> v1: initial version
>
> Signed-off-by: Peng Wang <peng.1.wang@nokia-sbell.com>

Sigh. I should have paid closer attention. Signed-off-by: has to be ahead of ---,

and the change log after it. The above format messes up everything.

Also, please run checkpatch and fix the problems it reports.

Sorry for not noticing it earlier. Please fix the problems and resubmit.

Thanks,

Guenter

> ---
>   drivers/watchdog/dw_wdt.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index fef7c61..12c116e 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s)
>   	writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT,
>   	       dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
>   
> -	wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
> +	/*
> +	 * In case users set bigger timeout value than HW can support,
> +	 * kernel(watchdog_dev.c) helps to feed watchdog before
> +	 * wdd->max_hw_heartbeat_ms
> +	 */
> +	if ( top_s * 1000 <= wdd->max_hw_heartbeat_ms )
> +		wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
> +	else
> +		wdd->timeout = top_s;
>   
>   	return 0;
>   }



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value
  2019-11-22  5:38 ` Guenter Roeck
@ 2019-11-25  1:37   ` Wang, Peng 1. (NSB - CN/Hangzhou)
  0 siblings, 0 replies; 7+ messages in thread
From: Wang, Peng 1. (NSB - CN/Hangzhou) @ 2019-11-25  1:37 UTC (permalink / raw)
  To: Guenter Roeck, Guenter Roeck; +Cc: wim, linux-watchdog, linux-kernel

>Sigh. I should have paid closer attention. Signed-off-by: has to be ahead of ---,
>and the change log after it. The above format messes up everything.
>Also, please run checkpatch and fix the problems it reports.
>Sorry for not noticing it earlier. Please fix the problems and resubmit.

Ok, I'll re-submit the patch.

Thanks,

Peng Wang

-----Original Message-----
From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter Roeck
Sent: Friday, November 22, 2019 1:39 PM
To: Wang, Peng 1. (NSB - CN/Hangzhou) <peng.1.wang@nokia-sbell.com>; Guenter Roeck <groeck7@gmail.com>
Cc: wim@linux-watchdog.org; linux-watchdog@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value

On 11/21/19 2:35 AM, Wang, Peng 1. (NSB - CN/Hangzhou) wrote:
>  From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 
> 2001
> From: Peng Wang <peng.1.wang@nokia-sbell.com>
> Date: Wed, 20 Nov 2019 15:12:59 +0800
> Subject: [PATCH] watchdog: make DesignWare watchdog allow users to set bigger
>   timeout value
>
> watchdog_dev.c provides means to allow users to set bigger timeout 
> value than HW can support, make DesignWare watchdog align with this.
>
> ---
>
> v2 -> v1:
>         - use top_s to compare with wdd->max_hw_heartbeat_ms
>         - update wdd->timeout in case it's greater than HW supports
>         - fix comments error
>
> v1: initial version
>
> Signed-off-by: Peng Wang <peng.1.wang@nokia-sbell.com>

Sigh. I should have paid closer attention. Signed-off-by: has to be ahead of ---,

and the change log after it. The above format messes up everything.

Also, please run checkpatch and fix the problems it reports.

Sorry for not noticing it earlier. Please fix the problems and resubmit.

Thanks,

Guenter

> ---
>   drivers/watchdog/dw_wdt.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c 
> index fef7c61..12c116e 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s)
>   	writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT,
>   	       dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
>   
> -	wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
> +	/*
> +	 * In case users set bigger timeout value than HW can support,
> +	 * kernel(watchdog_dev.c) helps to feed watchdog before
> +	 * wdd->max_hw_heartbeat_ms
> +	 */
> +	if ( top_s * 1000 <= wdd->max_hw_heartbeat_ms )
> +		wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val);
> +	else
> +		wdd->timeout = top_s;
>   
>   	return 0;
>   }



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 10:35 [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value Wang, Peng 1. (NSB - CN/Hangzhou)
2019-11-21 14:15 ` Guenter Roeck
2019-11-22  1:16   ` Wang, Peng 1. (NSB - CN/Hangzhou)
2019-11-22  2:41     ` Guenter Roeck
2019-11-22  3:20       ` Wang, Peng 1. (NSB - CN/Hangzhou)
2019-11-22  5:38 ` Guenter Roeck
2019-11-25  1:37   ` Wang, Peng 1. (NSB - CN/Hangzhou)

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git