linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: 王擎 <wangqing@vivo.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re:Re: [PATCH] softdog: make pretimeout available when SOFT_WATCHDOG_PRETIMEOUT enabled
Date: Sat, 10 Apr 2021 10:53:28 +0800 (GMT+08:00)	[thread overview]
Message-ID: <ANAArgBwDvabSkQicHqy3arm.3.1618023208388.Hmail.wangqing@vivo.com> (raw)
In-Reply-To: <30170c12-663a-bd5e-05a1-058a1726dc9f@roeck-us.net>


>On 4/6/21 2:44 AM, Wang Qing wrote:
>> Although softdog supports pretimeout, there is no way to set pretimeout, 
>> so pretimeout will never be processed in softdog_ping(). 
>> 
>This is wrong. The pretimeout can be set using WDIOC_SETPRETIMEOUT, as with
>every other driver supporting it. There is no need for a module parameter.
>
>Guenter
>
I saw it, but if I use softdog and enable pretimeout, I hope to get pre processing
by default instead of fire. Can we give pretimeout a minimum default value?

Thanks.
Qing wang.

>> Here add the configuration mechanism for pretimeout and the default value
>> is 1 second, so when CONFIG_SOFT_WATCHDOG_PRETIMEOUT is enabled, the 
>> pretimeout function defaults available.
>> 
>> Signed-off-by: Wang Qing <wangqing@vivo.com>
>> ---
>>  drivers/watchdog/softdog.c | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>> 
>> diff --git a/drivers/watchdog/softdog.c b/drivers/watchdog/softdog.c
>> index 7a10962..79e52791
>> --- a/drivers/watchdog/softdog.c
>> +++ b/drivers/watchdog/softdog.c
>> @@ -35,6 +35,14 @@ MODULE_PARM_DESC(soft_margin,
>>  	"Watchdog soft_margin in seconds. (0 < soft_margin < 65536, default="
>>  					__MODULE_STRING(TIMER_MARGIN) ")");
>>  
>> +#ifdef CONFIG_SOFT_WATCHDOG_PRETIMEOUT
>> +#define PRE_TIMER_MARGIN	1		/* Default is 1 seconds */
>> +static unsigned int soft_pretimeout = PRE_TIMER_MARGIN;	/* in seconds */
>> +module_param(soft_pretimeout, uint, 0);
>> +MODULE_PARM_DESC(soft_pretimeout,
>> +	"Watchdog soft_pretimeout in seconds. (0 < soft_pretimeout < soft_margin, default=1)");
>> +#endif
>> +
>>  static bool nowayout = WATCHDOG_NOWAYOUT;
>>  module_param(nowayout, bool, 0);
>>  MODULE_PARM_DESC(nowayout,
>> @@ -177,6 +185,9 @@ static struct watchdog_device softdog_dev = {
>>  	.min_timeout = 1,
>>  	.max_timeout = 65535,
>>  	.timeout = TIMER_MARGIN,
>> +#ifdef CONFIG_SOFT_WATCHDOG_PRETIMEOUT
>> +	.pretimeout = PRE_TIMER_MARGIN,
>> +#endif
>>  };
>>  
>>  static int __init softdog_init(void)
>> 
>



      reply	other threads:[~2021-04-10  2:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06  9:44 [PATCH] softdog: make pretimeout available when SOFT_WATCHDOG_PRETIMEOUT enabled Wang Qing
2021-04-06 13:32 ` Guenter Roeck
2021-04-10  2:53   ` 王擎 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ANAArgBwDvabSkQicHqy3arm.3.1618023208388.Hmail.wangqing@vivo.com \
    --to=wangqing@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).