lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 31 Mar 2015 12:34:11 -0700
From:	Andrew Bresticker <abrestic@...omium.org>
To:	Guenter Roeck <linux@...ck-us.net>
Cc:	Wim Van Sebroeck <wim@...ana.be>,
	"linux-watchdog@...r.kernel.org" <linux-watchdog@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Naidu Tellapati <naidu.tellapati@...tec.com>,
	Ezequiel Garcia <ezequiel.garcia@...tec.com>
Subject: Re: [PATCH 2/4] watchdog: imgpdc: Intialize timeout to default value

On Tue, Mar 31, 2015 at 12:02 PM, Guenter Roeck <linux@...ck-us.net> wrote:
> On 03/31/2015 11:49 AM, Andrew Bresticker wrote:
>>
>> From: Naidu Tellapati <naidu.tellapati@...tec.com>
>>
>> Currently the watchdog timeout is initialized to 0.  Initialize it to
>> its default value instead.
>>
>> Signed-off-by: Naidu Tellapati <naidu.tellapati@...tec.com>
>> Signed-off-by: Andrew Bresticker <abrestic@...omium.org>
>> Cc: Ezequiel Garcia <ezequiel.garcia@...tec.com>
>> ---
>>   drivers/watchdog/imgpdc_wdt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/watchdog/imgpdc_wdt.c b/drivers/watchdog/imgpdc_wdt.c
>> index c4151cd..f3f65ac 100644
>> --- a/drivers/watchdog/imgpdc_wdt.c
>> +++ b/drivers/watchdog/imgpdc_wdt.c
>> @@ -42,7 +42,7 @@
>>   #define PDC_WDT_MIN_TIMEOUT           1
>>   #define PDC_WDT_DEF_TIMEOUT           64
>>
>> -static int heartbeat;
>> +static int heartbeat = PDC_WDT_DEF_TIMEOUT;
>>   module_param(heartbeat, int, 0);
>>   MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. "
>>         "(default = " __MODULE_STRING(PDC_WDT_DEF_TIMEOUT) ")");
>>
>
> The idea with watchdog_init_timeout() is that it can take the
> timeout from devicetree unless the module parameter is provided.
> By pre-initializing the module parameter, you defeat that and
> make watchdog_init_timeout more or less a no-op. You might as well
> set pdc_wdt->wdt_dev.timeout directly and not call watchdog_init_timeout
> at all if that is what you want.
>
> The "expected" solution would be to pre-initialize pdc_wdt->wdt_dev.timeout
> but leave the module parameter alone.

Ah, right - that would be better.  It looks like a patch that is
almost identical to mine has already been accepted - see linux-next
commit c774d71 ["watchdog: imgpdc: Fix default heartbeat"] - but I can
follow up with a patch that uses the approach you suggested.

Thanks,
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ