Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548827 > unrolled thread

Stopping watchdog in watchdog driver remove functions

Started byGuenter Roeck <linux@roeck-us.net>
First post2016-12-31 20:50 +0100
Last post2017-01-01 18:00 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  Stopping watchdog in watchdog driver remove functions Guenter Roeck <linux@roeck-us.net> - 2016-12-31 20:50 +0100
    Re: Stopping watchdog in watchdog driver remove functions Wim Van Sebroeck <wim@iguana.be> - 2017-01-01 12:20 +0100
      Re: Stopping watchdog in watchdog driver remove functions Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-01-01 16:30 +0100
      Re: Stopping watchdog in watchdog driver remove functions Guenter Roeck <linux@roeck-us.net> - 2017-01-01 18:00 +0100

#1548827 — Stopping watchdog in watchdog driver remove functions

FromGuenter Roeck <linux@roeck-us.net>
Date2016-12-31 20:50 +0100
SubjectStopping watchdog in watchdog driver remove functions
Message-ID<sUxPb-7ab-1@gated-at.bofh.it>
Hi,

I noticed that several watchdog drivers stop the watchdog in trhe driver remove function.
A non-exhaustive list of drivers doing that is

	drivers/watchdog/bcm7038_wdt.c
	drivers/watchdog/cadence_wdt.c
	drivers/watchdog/imgpdc_wdt.c
	drivers/watchdog/jz4740_wdt.c
	drivers/watchdog/kempld_wdt.c
	drivers/watchdog/max77620_wdt.c
	drivers/watchdog/moxart_wdt.c
	drivers/watchdog/sama5d4_wdt.c
	drivers/watchdog/tangox_wdt.c
	drivers/watchdog/tegra_wdt.c

Since a watchdog has to be closed for its driver to be removable, one situation
where a watchdog is still running on unload is where the watchdog was opened but
not closed properly (eg by killing the watchdog application, or if the 'nowayout'
flag is set).

Given that, does it even make sense to stop the watchdog in the remove function ?
Should it even be permitted ?

Thanks,
Guenter

[toc] | [next] | [standalone]


#1548875

FromWim Van Sebroeck <wim@iguana.be>
Date2017-01-01 12:20 +0100
Message-ID<sUMlc-85I-9@gated-at.bofh.it>
In reply to#1548827
Hi Guenter,

> I noticed that several watchdog drivers stop the watchdog in trhe driver 
> remove function.
> A non-exhaustive list of drivers doing that is
> 
> 	drivers/watchdog/bcm7038_wdt.c
> 	drivers/watchdog/cadence_wdt.c
> 	drivers/watchdog/imgpdc_wdt.c
> 	drivers/watchdog/jz4740_wdt.c
> 	drivers/watchdog/kempld_wdt.c
> 	drivers/watchdog/max77620_wdt.c
> 	drivers/watchdog/moxart_wdt.c
> 	drivers/watchdog/sama5d4_wdt.c
> 	drivers/watchdog/tangox_wdt.c
> 	drivers/watchdog/tegra_wdt.c
> 
> Since a watchdog has to be closed for its driver to be removable, one 
> situation
> where a watchdog is still running on unload is where the watchdog was 
> opened but
> not closed properly (eg by killing the watchdog application, or if the 
> 'nowayout'
> flag is set).
> 
> Given that, does it even make sense to stop the watchdog in the remove 
> function ?
> Should it even be permitted ?

From an API point of view: if WDIOF_MAGICCLOSE is being used then the watchdog
_SHOULD_ continue to run when the watchdog was not properly closed (which
normally also results in a reboot of the system).
if WDIOF_MAGICCLOSE is not being used then closing the watchdog device means
that the driver needs to stop the watchdog.

Kind regards and happy new year to you all,
Wim.

[toc] | [prev] | [next] | [standalone]


#1548878

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-01-01 16:30 +0100
Message-ID<sUQf7-22N-3@gated-at.bofh.it>
In reply to#1548875
On Sun, Jan 1, 2017 at 1:14 PM, Wim Van Sebroeck <wim@iguana.be> wrote:

>> Given that, does it even make sense to stop the watchdog in the remove
>> function ?
>> Should it even be permitted ?
>
> From an API point of view: if WDIOF_MAGICCLOSE is being used then the watchdog
> _SHOULD_ continue to run when the watchdog was not properly closed (which
> normally also results in a reboot of the system).

Btw, some systems may require watchdog to be run in order to perform reboot.

-- 
With Best Regards,
Andy Shevchenko

[toc] | [prev] | [next] | [standalone]


#1548895

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-01 18:00 +0100
Message-ID<sUREd-2NG-13@gated-at.bofh.it>
In reply to#1548875
On 01/01/2017 03:14 AM, Wim Van Sebroeck wrote:
> Hi Guenter,
>
>> I noticed that several watchdog drivers stop the watchdog in trhe driver
>> remove function.
>> A non-exhaustive list of drivers doing that is
>>
>> 	drivers/watchdog/bcm7038_wdt.c
>> 	drivers/watchdog/cadence_wdt.c
>> 	drivers/watchdog/imgpdc_wdt.c
>> 	drivers/watchdog/jz4740_wdt.c
>> 	drivers/watchdog/kempld_wdt.c
>> 	drivers/watchdog/max77620_wdt.c
>> 	drivers/watchdog/moxart_wdt.c
>> 	drivers/watchdog/sama5d4_wdt.c
>> 	drivers/watchdog/tangox_wdt.c
>> 	drivers/watchdog/tegra_wdt.c
>>
>> Since a watchdog has to be closed for its driver to be removable, one
>> situation
>> where a watchdog is still running on unload is where the watchdog was
>> opened but
>> not closed properly (eg by killing the watchdog application, or if the
>> 'nowayout'
>> flag is set).
>>
>> Given that, does it even make sense to stop the watchdog in the remove
>> function ?
>> Should it even be permitted ?
>
>>From an API point of view: if WDIOF_MAGICCLOSE is being used then the watchdog
> _SHOULD_ continue to run when the watchdog was not properly closed (which
> normally also results in a reboot of the system).
> if WDIOF_MAGICCLOSE is not being used then closing the watchdog device means
> that the driver needs to stop the watchdog.
>
All the above have WDIOF_MAGICCLOSE set. Does that mean they should not stop
the watchdog on remove ?

Happy new year everyone !

Guenter

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web