mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Stopping watchdog in watchdog driver remove functions
@ 2016-12-31 19:44 Guenter Roeck
  2017-01-01 11:14 ` Wim Van Sebroeck
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2016-12-31 19:44 UTC (permalink / raw)
  To: wim
  Cc: linux-watchdog, linux-kernel, Laxman Dewangan, Mans Rullgard,
	Justin Chen, Wenyou Yang, Naidu Tellapati

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

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

* Re: Stopping watchdog in watchdog driver remove functions
  2016-12-31 19:44 Stopping watchdog in watchdog driver remove functions Guenter Roeck
@ 2017-01-01 11:14 ` Wim Van Sebroeck
  2017-01-01 15:24   ` Andy Shevchenko
  2017-01-01 16:52   ` Guenter Roeck
  0 siblings, 2 replies; 4+ messages in thread
From: Wim Van Sebroeck @ 2017-01-01 11:14 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-watchdog, linux-kernel, Laxman Dewangan, Mans Rullgard,
	Justin Chen, Wenyou Yang, Naidu Tellapati

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.

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

* Re: Stopping watchdog in watchdog driver remove functions
  2017-01-01 11:14 ` Wim Van Sebroeck
@ 2017-01-01 15:24   ` Andy Shevchenko
  2017-01-01 16:52   ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-01-01 15:24 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: Guenter Roeck, linux-watchdog, linux-kernel, Laxman Dewangan,
	Mans Rullgard, Justin Chen, Wenyou Yang, Naidu Tellapati

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

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

* Re: Stopping watchdog in watchdog driver remove functions
  2017-01-01 11:14 ` Wim Van Sebroeck
  2017-01-01 15:24   ` Andy Shevchenko
@ 2017-01-01 16:52   ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2017-01-01 16:52 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: linux-watchdog, linux-kernel, Laxman Dewangan, Mans Rullgard,
	Justin Chen, Wenyou Yang, Naidu Tellapati

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

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

end of thread, other threads:[~2017-01-01 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-31 19:44 Stopping watchdog in watchdog driver remove functions Guenter Roeck
2017-01-01 11:14 ` Wim Van Sebroeck
2017-01-01 15:24   ` Andy Shevchenko
2017-01-01 16:52   ` Guenter Roeck

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®