From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755035AbdAALO1 (ORCPT ); Sun, 1 Jan 2017 06:14:27 -0500 Received: from ns1.pc-advies.be ([85.17.2.162]:37512 "EHLO spo001.leaseweb.nl" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753338AbdAALO0 (ORCPT ); Sun, 1 Jan 2017 06:14:26 -0500 Date: Sun, 1 Jan 2017 12:14:22 +0100 From: Wim Van Sebroeck To: Guenter Roeck Cc: "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Laxman Dewangan , Mans Rullgard , Justin Chen , Wenyou Yang , Naidu Tellapati Subject: Re: Stopping watchdog in watchdog driver remove functions Message-ID: <20170101111421.GA9695@spo001.leaseweb.nl> References: <64c83c02-2c64-c536-3302-8079f438f0ab@roeck-us.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64c83c02-2c64-c536-3302-8079f438f0ab@roeck-us.net> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.