From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13068C10F13 for ; Thu, 11 Apr 2019 16:13:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE0EE2083E for ; Thu, 11 Apr 2019 16:13:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726599AbfDKQNm (ORCPT ); Thu, 11 Apr 2019 12:13:42 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:54927 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfDKQNm (ORCPT ); Thu, 11 Apr 2019 12:13:42 -0400 X-Originating-IP: 109.213.33.177 Received: from localhost (alyon-652-1-42-177.w109-213.abo.wanadoo.fr [109.213.33.177]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A01A660009; Thu, 11 Apr 2019 16:13:39 +0000 (UTC) Date: Thu, 11 Apr 2019 18:13:39 +0200 From: Alexandre Belloni To: Guenter Roeck Cc: Vladimir Zapolskiy , Wim Van Sebroeck , Sylvain Lemieux , Gregory Clement , linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] watchdog: pnx4008: readout watchddog state Message-ID: <20190411161339.GL3578@piout.net> References: <20190411153646.32228-1-alexandre.belloni@bootlin.com> <20190411160305.GA27530@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190411160305.GA27530@roeck-us.net> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org On 11/04/2019 09:03:05-0700, Guenter Roeck wrote: > Hi Alexandre, > > On Thu, Apr 11, 2019 at 05:36:46PM +0200, Alexandre Belloni wrote: > > Readout the enabled state so it is possible to get the pre-userspace > > handler working. Also, avoid disabling the watchdog when nowayout is set to > > ensure the watchdog continues working and triggers if there is an issue > > later in the boot or if userspace fails to start. > > > > Signed-off-by: Alexandre Belloni > > --- > > drivers/watchdog/pnx4008_wdt.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c > > index 8e261799c84e..9e3714e3814c 100644 > > --- a/drivers/watchdog/pnx4008_wdt.c > > +++ b/drivers/watchdog/pnx4008_wdt.c > > @@ -209,7 +209,11 @@ static int pnx4008_wdt_probe(struct platform_device *pdev) > > watchdog_set_nowayout(&pnx4008_wdd, nowayout); > > watchdog_set_restart_priority(&pnx4008_wdd, 128); > > > > - pnx4008_wdt_stop(&pnx4008_wdd); /* disable for now */ > > + if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB) > > + set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status); > > + > > + if (!nowayout) > > + pnx4008_wdt_stop(&pnx4008_wdd); /* disable for now */ > > I don't see the point of stopping the watchdog here, even though that is the > old behavior. If it is possible to detect that the watchdog is running, we > can let the core handle pings until the watchdog device is opened. The code > above does that, but only if nowayout is set. That seems inconsistent and > unnecessary. Is there a downside to doing that unconditionally ? > I guess the downside is the change of behaviour. I don't think many will be affected but they will have to ensure the core pings the watchdog until the device is open. WATCHDOG_HANDLE_BOOT_ENABLED is y by default so that should be fine for most. Honestly, I would just never disable the watchdog, that is the whole point of this patch. If you are fine with that, I will just remove the line. > Nitpick: s/watchddog/watchdog/ in subject line. > I'll fix it. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4A12C10F13 for ; Thu, 11 Apr 2019 16:13:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 745132083E for ; Thu, 11 Apr 2019 16:13:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IXV8+dvG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 745132083E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gVjbj3jrI0wMBfAWGPMbvTgDPEPOnJn6caCEuJN7mSw=; b=IXV8+dvG++l0dp sM4rzyNztazZC5UOa/aTlxojnTBRhpi/LNSkDLshE5DcvI6h4+pfKwbHfURRWVoL8HssBlwm8oxXT QOhMP3a8u2Wg1YftDz2rRJmTbEaJ1+mda2zkoThUv3euHp14zj0jUl4lGmArm/jXIN8WWAvHMQ/Xw UzxQnXVic9+RafDTTOZ0DbqxxhHvyhLaXZhKOLh/jUivzcu9wL1IsNvTbur7nX9sUIDXy06M5SjI8 zwFLBo6NYGmdV4qhKkJNYX8kaZCfqISg0XSaOSF1hqrMlhOskA39FuiVhJEpf8MyxqobhG+qv4/9C 7aqTfkga2b//G/iK9M2Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEcKm-0000au-K4; Thu, 11 Apr 2019 16:13:52 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEcKi-0000N4-7F for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2019 16:13:50 +0000 X-Originating-IP: 109.213.33.177 Received: from localhost (alyon-652-1-42-177.w109-213.abo.wanadoo.fr [109.213.33.177]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A01A660009; Thu, 11 Apr 2019 16:13:39 +0000 (UTC) Date: Thu, 11 Apr 2019 18:13:39 +0200 From: Alexandre Belloni To: Guenter Roeck Subject: Re: [PATCH] watchdog: pnx4008: readout watchddog state Message-ID: <20190411161339.GL3578@piout.net> References: <20190411153646.32228-1-alexandre.belloni@bootlin.com> <20190411160305.GA27530@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190411160305.GA27530@roeck-us.net> User-Agent: Mutt/1.11.3 (2019-02-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190411_091348_414745_EF3A36F6 X-CRM114-Status: GOOD ( 25.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-watchdog@vger.kernel.org, Gregory Clement , linux-kernel@vger.kernel.org, Vladimir Zapolskiy , Sylvain Lemieux , Wim Van Sebroeck , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/04/2019 09:03:05-0700, Guenter Roeck wrote: > Hi Alexandre, > > On Thu, Apr 11, 2019 at 05:36:46PM +0200, Alexandre Belloni wrote: > > Readout the enabled state so it is possible to get the pre-userspace > > handler working. Also, avoid disabling the watchdog when nowayout is set to > > ensure the watchdog continues working and triggers if there is an issue > > later in the boot or if userspace fails to start. > > > > Signed-off-by: Alexandre Belloni > > --- > > drivers/watchdog/pnx4008_wdt.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c > > index 8e261799c84e..9e3714e3814c 100644 > > --- a/drivers/watchdog/pnx4008_wdt.c > > +++ b/drivers/watchdog/pnx4008_wdt.c > > @@ -209,7 +209,11 @@ static int pnx4008_wdt_probe(struct platform_device *pdev) > > watchdog_set_nowayout(&pnx4008_wdd, nowayout); > > watchdog_set_restart_priority(&pnx4008_wdd, 128); > > > > - pnx4008_wdt_stop(&pnx4008_wdd); /* disable for now */ > > + if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB) > > + set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status); > > + > > + if (!nowayout) > > + pnx4008_wdt_stop(&pnx4008_wdd); /* disable for now */ > > I don't see the point of stopping the watchdog here, even though that is the > old behavior. If it is possible to detect that the watchdog is running, we > can let the core handle pings until the watchdog device is opened. The code > above does that, but only if nowayout is set. That seems inconsistent and > unnecessary. Is there a downside to doing that unconditionally ? > I guess the downside is the change of behaviour. I don't think many will be affected but they will have to ensure the core pings the watchdog until the device is open. WATCHDOG_HANDLE_BOOT_ENABLED is y by default so that should be fine for most. Honestly, I would just never disable the watchdog, that is the whole point of this patch. If you are fine with that, I will just remove the line. > Nitpick: s/watchddog/watchdog/ in subject line. > I'll fix it. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel