From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932282AbdAAQwV (ORCPT ); Sun, 1 Jan 2017 11:52:21 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:56254 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932079AbdAAQwU (ORCPT ); Sun, 1 Jan 2017 11:52:20 -0500 Subject: Re: Stopping watchdog in watchdog driver remove functions To: Wim Van Sebroeck References: <64c83c02-2c64-c536-3302-8079f438f0ab@roeck-us.net> <20170101111421.GA9695@spo001.leaseweb.nl> Cc: "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Laxman Dewangan , Mans Rullgard , Justin Chen , Wenyou Yang , Naidu Tellapati From: Guenter Roeck Message-ID: Date: Sun, 1 Jan 2017 08:52:09 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170101111421.GA9695@spo001.leaseweb.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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