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.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,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 5EC3BC10F13 for ; Thu, 11 Apr 2019 16:37:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B51920449 for ; Thu, 11 Apr 2019 16:37:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XmLms1Hv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726615AbfDKQhU (ORCPT ); Thu, 11 Apr 2019 12:37:20 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40365 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfDKQhT (ORCPT ); Thu, 11 Apr 2019 12:37:19 -0400 Received: by mail-pl1-f195.google.com with SMTP id b3so3665745plr.7; Thu, 11 Apr 2019 09:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yl+SJAYse++tdKvZE+ctkB5OJXGi/RdijHoQr6kHeRc=; b=XmLms1HvPXnGhQgBpLt03jGcPI4Ft0A7qYojoi5R9s8jv2AA0zbVRBMA1C9MfHDBTr t/u4subE7CBeMwAw5erYBOrU0dQZuG6MxBDwOVtjBhVFU77bTspv/5FmXVWK8rfUf3EJ zkop/jea++i2S770Li4Du2Th4XAACBhi/hg6f84JDD7WcCKU5kNE6G5YIeiFuj/t7aDx bzHZPCZ0crD2GXxjN+M6/YyotfqbfPnh7zgZYcz+Q7nT5yU/AJgcIBOVEPVlYlGApKM6 ScNlYmHYsxIc4a4pKprkoHRrEw89bVy6HKnI2oN0gbeWC4a+c6CB5qNHTChrWf3x7hzr yP4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Yl+SJAYse++tdKvZE+ctkB5OJXGi/RdijHoQr6kHeRc=; b=PyFDw1WXSEzd1cWD+C2TcBU3lLH9AJh8BXkR+EiGF9lyMo3bxJWrhcW9SjQc/Wb2/R UKY8FNg3rbH0bpxvd6//KEwxy32WSMk/g0Uu/KrkDwIyU+bAq0mMj4jJjT3bwqCpookf cSOOoMCcU8Q2OzXq5JfgeB84K0Emv/S2pu5tKUXTXQ86KQig0CtJqR/eM0miYSKMp4Xa CG/qkwTqYYdI4KDVgGoRfK3NQp3jN3LPFWq3rTx4+ejlsRg6XNx0rNN5VU3TwaBD0Dub 5WSJeZc4rqDfEa5+m3+BKpdvgWDQ1jSaHfGONEvoLGG0ErkhQAmNY5E0A1M342rzuiVD Kx0w== X-Gm-Message-State: APjAAAXIN5TDZCQUldk5sfdsFgwV2lo4UBay5AuWL482Q0+1PiSI9ka4 cocGfPXLdSjj3TWtVL0rnQ8= X-Google-Smtp-Source: APXvYqwTODw4scwKngWNO1kL6up4p4KdxBOrVC/O1ONis9tbQy+iBp2IbdZSftj0SpObYnwDpwBy9Q== X-Received: by 2002:a17:902:6b0b:: with SMTP id o11mr2624799plk.266.1555000639007; Thu, 11 Apr 2019 09:37:19 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b15sm54408759pgg.90.2019.04.11.09.37.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 09:37:18 -0700 (PDT) Date: Thu, 11 Apr 2019 09:37:17 -0700 From: Guenter Roeck To: Alexandre Belloni 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: <20190411163717.GA28797@roeck-us.net> References: <20190411153646.32228-1-alexandre.belloni@bootlin.com> <20190411160305.GA27530@roeck-us.net> <20190411161339.GL3578@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190411161339.GL3578@piout.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org On Thu, Apr 11, 2019 at 06:13:39PM +0200, Alexandre Belloni wrote: > 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. > Your code already does change behavior if nowayout is set. > 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. > Please. Thanks, Guenter > > > 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 6B159C10F13 for ; Thu, 11 Apr 2019 16:37:28 +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 36FC52146F for ; Thu, 11 Apr 2019 16:37:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a3xvBBQb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XmLms1Hv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36FC52146F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net 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=byeZQjeXEOjGA+XJaQA8iJkpM68g9JyI2mnsk0o9cU4=; b=a3xvBBQbeCzU/K 6hxeMXcGTcSGMXDRMJty1KXR3HbcDPW48qYpSP0zsxYpAWBAkzS1H4oG1NbzmrHZHwc6vqE1XU3vD gyCQC0Nd6Mql4/SV9fWsuAuU2Qh2DqigAqCCV20QDBw11vuMKJkJtiai/+Qu8//v8EuXnwzZw4VDw 5G/h4S0UExaaf+ESx28LV4C4xibe9JbEEj+GivR3zYu+Y6BtXFsmwIiOPHJV2RGIfLgmGbvyIXq7Q 2vL3FxzqC3MzELFQBB3hjmq/DaET5oedNITwHInQnh55SeE6PHVOnxypGEBETqy75yTNdlPLPFJNC T8z/zH3in+9DQpgKsq5g==; 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 1hEchY-0005zi-Ju; Thu, 11 Apr 2019 16:37:24 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEchV-0005z1-Dw for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2019 16:37:22 +0000 Received: by mail-pl1-x644.google.com with SMTP id y6so3647875pll.13 for ; Thu, 11 Apr 2019 09:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yl+SJAYse++tdKvZE+ctkB5OJXGi/RdijHoQr6kHeRc=; b=XmLms1HvPXnGhQgBpLt03jGcPI4Ft0A7qYojoi5R9s8jv2AA0zbVRBMA1C9MfHDBTr t/u4subE7CBeMwAw5erYBOrU0dQZuG6MxBDwOVtjBhVFU77bTspv/5FmXVWK8rfUf3EJ zkop/jea++i2S770Li4Du2Th4XAACBhi/hg6f84JDD7WcCKU5kNE6G5YIeiFuj/t7aDx bzHZPCZ0crD2GXxjN+M6/YyotfqbfPnh7zgZYcz+Q7nT5yU/AJgcIBOVEPVlYlGApKM6 ScNlYmHYsxIc4a4pKprkoHRrEw89bVy6HKnI2oN0gbeWC4a+c6CB5qNHTChrWf3x7hzr yP4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Yl+SJAYse++tdKvZE+ctkB5OJXGi/RdijHoQr6kHeRc=; b=mlTzNxRmFfQjhEsl0H199hFBEb3u4F2mcJzcDtfu3xkyshVt9oLjpzQWeN4oY8F3a7 F9+LlXTxR5AhckEfSqSShnJapn2z++5ke1oTR5O2zTX+qLe2wkj+mkOkRHPwHiTA8p9T 2Xuhm0hBzESNGRJaoys0E5bgU/QR4FjDXU0yWuqjJkWXqLQmCGwTuP0seEy9Nt2OP4ge JnswX2wzI/OQgxRFXhq/XmjkWrlpRzIfrd5QOQLm0joS32hjarEwbQc558pfMBiQN6zf PqsJeBUzeRBDLbpHcOLCCR0ZryfqNk5nstMC1MuChTYjRF77HrgWXif5+L+K8Kf6O1DC QpoA== X-Gm-Message-State: APjAAAW3nM63wxq6GVSXJWuCjW3d9GfDQUpMLPswM9mYGF3ILKHy/Wpq 4TQu04m3w61nlRU8NhypodY= X-Google-Smtp-Source: APXvYqwTODw4scwKngWNO1kL6up4p4KdxBOrVC/O1ONis9tbQy+iBp2IbdZSftj0SpObYnwDpwBy9Q== X-Received: by 2002:a17:902:6b0b:: with SMTP id o11mr2624799plk.266.1555000639007; Thu, 11 Apr 2019 09:37:19 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b15sm54408759pgg.90.2019.04.11.09.37.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 09:37:18 -0700 (PDT) Date: Thu, 11 Apr 2019 09:37:17 -0700 From: Guenter Roeck To: Alexandre Belloni Subject: Re: [PATCH] watchdog: pnx4008: readout watchddog state Message-ID: <20190411163717.GA28797@roeck-us.net> References: <20190411153646.32228-1-alexandre.belloni@bootlin.com> <20190411160305.GA27530@roeck-us.net> <20190411161339.GL3578@piout.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190411161339.GL3578@piout.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190411_093721_465409_B0727B58 X-CRM114-Status: GOOD ( 28.69 ) 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 Thu, Apr 11, 2019 at 06:13:39PM +0200, Alexandre Belloni wrote: > 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. > Your code already does change behavior if nowayout is set. > 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. > Please. Thanks, Guenter > > > 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