mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] watchdog: rti_wdt: Allow timeout config with timeout-sec
@ 2024-08-21 20:19 Judith Mendez
  2024-08-21 23:28 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Judith Mendez @ 2024-08-21 20:19 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck; +Cc: linux-watchdog, linux-kernel

Currently rti_wdt does not allow timeout to be configured
via DT property timeout-sec, so fix watchdog_init_timeout
to be able to use timeout-sec.

Signed-off-by: Judith Mendez <jm@ti.com>
---
 drivers/watchdog/rti_wdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
index 8e1be7ba01039..7260c67e60a25 100644
--- a/drivers/watchdog/rti_wdt.c
+++ b/drivers/watchdog/rti_wdt.c
@@ -332,7 +332,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
 		memunmap(vaddr);
 	}
 
-	watchdog_init_timeout(wdd, heartbeat, dev);
+	wdd->timeout = heartbeat;
+	watchdog_init_timeout(wdd, 0, dev);
 
 	ret = watchdog_register_device(wdd);
 	if (ret) {

base-commit: 860bbe8e618fd62446309e286ab4a83d38201c0a
-- 
2.46.0


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

* Re: [PATCH] watchdog: rti_wdt: Allow timeout config with timeout-sec
  2024-08-21 20:19 [PATCH] watchdog: rti_wdt: Allow timeout config with timeout-sec Judith Mendez
@ 2024-08-21 23:28 ` Guenter Roeck
  2024-08-22 14:01   ` Judith Mendez
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2024-08-21 23:28 UTC (permalink / raw)
  To: Judith Mendez; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel

On Wed, Aug 21, 2024 at 03:19:35PM -0500, Judith Mendez wrote:
> Currently rti_wdt does not allow timeout to be configured
> via DT property timeout-sec, so fix watchdog_init_timeout
> to be able to use timeout-sec.
> 
> Signed-off-by: Judith Mendez <jm@ti.com>
> ---
>  drivers/watchdog/rti_wdt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
> index 8e1be7ba01039..7260c67e60a25 100644
> --- a/drivers/watchdog/rti_wdt.c
> +++ b/drivers/watchdog/rti_wdt.c
> @@ -332,7 +332,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
>  		memunmap(vaddr);
>  	}
>  
> -	watchdog_init_timeout(wdd, heartbeat, dev);
> +	wdd->timeout = heartbeat;

The proper fix would be to initialize the 'heartbeat' variable with 0,
set wdt->timeout to DEFAULT_HEARTBEAT, and to keep passing 'heartbeat'
to watchdog_init_timeout(). That used to be done but was explicitly
changed in an earlier commit, presumably on purpose. I am not inclined
to accept a (partial) revert unless the author of commit 5527483f confirms
that this is acceptable and desirable. Otherwise we'll just end up in an
edit war, which I really don't want to get into.

Guenter
`

> +	watchdog_init_timeout(wdd, 0, dev);
>  
>  	ret = watchdog_register_device(wdd);
>  	if (ret) {
> 
> base-commit: 860bbe8e618fd62446309e286ab4a83d38201c0a
> -- 
> 2.46.0
> 

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

* Re: [PATCH] watchdog: rti_wdt: Allow timeout config with timeout-sec
  2024-08-21 23:28 ` Guenter Roeck
@ 2024-08-22 14:01   ` Judith Mendez
  0 siblings, 0 replies; 3+ messages in thread
From: Judith Mendez @ 2024-08-22 14:01 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel

Hi Guenter,

On 8/21/24 6:28 PM, Guenter Roeck wrote:
> On Wed, Aug 21, 2024 at 03:19:35PM -0500, Judith Mendez wrote:
>> Currently rti_wdt does not allow timeout to be configured
>> via DT property timeout-sec, so fix watchdog_init_timeout
>> to be able to use timeout-sec.
>>
>> Signed-off-by: Judith Mendez <jm@ti.com>
>> ---
>>   drivers/watchdog/rti_wdt.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
>> index 8e1be7ba01039..7260c67e60a25 100644
>> --- a/drivers/watchdog/rti_wdt.c
>> +++ b/drivers/watchdog/rti_wdt.c
>> @@ -332,7 +332,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
>>   		memunmap(vaddr);
>>   	}
>>   
>> -	watchdog_init_timeout(wdd, heartbeat, dev);
>> +	wdd->timeout = heartbeat;
> 
> The proper fix would be to initialize the 'heartbeat' variable with 0,
> set wdt->timeout to DEFAULT_HEARTBEAT, and to keep passing 'heartbeat'
> to watchdog_init_timeout(). That used to be done but was explicitly
> changed in an earlier commit, presumably on purpose. I am not inclined
> to accept a (partial) revert unless the author of commit 5527483f confirms
> that this is acceptable and desirable. Otherwise we'll just end up in an
> edit war, which I really don't want to get into.

You are right, I completely missed this change in this commit due
to the subject line not being related. I will try to align with Tero
Kristo to see if this is something we can add back. Thanks.

~ Judith

> 
> Guenter
> `
> 
>> +	watchdog_init_timeout(wdd, 0, dev);
>>   
>>   	ret = watchdog_register_device(wdd);
>>   	if (ret) {
>>
>> base-commit: 860bbe8e618fd62446309e286ab4a83d38201c0a
>> -- 
>> 2.46.0
>>


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

end of thread, other threads:[~2024-08-22 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-21 20:19 [PATCH] watchdog: rti_wdt: Allow timeout config with timeout-sec Judith Mendez
2024-08-21 23:28 ` Guenter Roeck
2024-08-22 14:01   ` Judith Mendez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®