Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2083104ybg; Thu, 30 Jul 2020 09:54:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoxUJSU3xIDEp5lz6zFRERcZ8IDQngHnDDIImoqNrvn/G5doaUIAsGAfjQimxVmPuiksVZ X-Received: by 2002:a17:906:1596:: with SMTP id k22mr3632277ejd.509.1596128082712; Thu, 30 Jul 2020 09:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596128082; cv=none; d=google.com; s=arc-20160816; b=UbjF9qhw/NEpvOv7mwX4skg39PIqCU3EZnHtv0R/jfatO6lo5UtVOaMlhgMFDOOc8e mRn2AX8EmeS50df7wMwatzL7BSZHkknHdw4Mg3Ovi3pwKaNaG8OS79eCx61kCLSTqwpO Yvo6acmQRkviCfFOFghXfpOd77+xGY+pi4vVg7xDHsr4w32FEJTj3k17xMNS6700JLi8 8rRumnm6I7sEM0keP029QpDncimTZN3m5SW44bM+/+RpdRaQkMkl5uwNxvc/TaVLwHJf HFqW351lVEdvMfKs4prSzPAXwmqFsyNcW0+ZLXA5IFIIef3bpBkCM89MCAwyP1KR5XHb 8F1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FsoEV1cyBnFRsNl5V+1d07ITk7Hh7UvpRiA1Dhd44vo=; b=vgqP96l7Ae12Al/AE/xZrqBFsTVUgMv3RwVFeEHvS6yWk/GT9xPhxzqMVr6KnufrQ7 3ye+zTyLjbkAf8UnykbuAgYu5ipyhBYy3boWS1AMBsjkmLd/SxAsqzbpIEUxU2bz22sN 6zvplyw0dVcBLNnFR2PkcAWkM464KJzRHgN4P5KbjrEW+b1cWB/PO/vGwNc7ilVNy6lZ MKN9EPqN/fCkls65/ZFRIVeh3gSpaoCKvBK3+yxLG5yY1hc6UAM5TzvzIX7VEDHkm6pj VvDYVKkNkP2QSS8Vw/igMt4q59uucVm7uq1aIwUi2OKYKFwIzYOAFERVeNHsb2jOCgnu I3LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Gmfjbc9f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si3971480ejn.40.2020.07.30.09.54.20; Thu, 30 Jul 2020 09:54:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Gmfjbc9f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730024AbgG3QxU (ORCPT + 99 others); Thu, 30 Jul 2020 12:53:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbgG3QxT (ORCPT ); Thu, 30 Jul 2020 12:53:19 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87BCFC061574; Thu, 30 Jul 2020 09:53:19 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id w17so14676977ply.11; Thu, 30 Jul 2020 09:53: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=FsoEV1cyBnFRsNl5V+1d07ITk7Hh7UvpRiA1Dhd44vo=; b=Gmfjbc9fahkE1mEOHQFRjjBVr5fJXmmkmHl+gW96pxG+MdFJTRtfFUpP2XkGJoTV4F 88LOWNKrCKR0ENts3EsXT01cKqZL1MELs8VNzxriSbPMiSwcN/WpSur2MXbdJB5ebHx9 3HUbnaikyq0+whPTW6xZ1zL7CF2LgYYDp8gN5izNMW4FobBaN1GS7pb31LPilYh8fvTK mPSDZq6pbmuFdAGftqa5CMycfn/ijwd0PoPFxHuPiUkbPhNKZvdGurw8HBb07tjwrNlE yFZQ5v5yaYvkPdgRqcGg9CjRfa9ECUnrt27+An9AHD2H5s5Rx2hDlDB2rrDk6Vm0CKD5 qm9A== 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=FsoEV1cyBnFRsNl5V+1d07ITk7Hh7UvpRiA1Dhd44vo=; b=FBTBGnNVxgi922VuW9VnVFX2FVwd3J0dGrw2qXIwMbIwjdCIQRAkmHyGXQuu2zb8Q5 F95fJgF0Y/AzMs26OSPqmfUTsrFTzR2lTQBxGlofwixlr7kICn9HrmSuHGDtngrYaTY6 H9JzVf/CUbWJv1wRnSXtnpHj3XOvfAvzYoK4OV8kXYd6tdlYnbObtOy2leaMwtySqqIr dTgERUDol5fzVjvNn9OK8ouDvQNGZuYZ7FbOo8bT+Xlddx4HjfQhvy0dn/BnZEUM/wKA 7se4uyNrBBhHzxYZW076ByURHPzsJh2dLCKmhfSuwMx/1YT3WopCrXK4ti1IH9GXl3qK MR6w== X-Gm-Message-State: AOAM533gIz6iGc7/ZFKI4ERYURcj2H7rdwCx7nQuK6UKF3eVWV2mgQEI cQlucp1POksH7zyQd1rLYXAaIR2E X-Received: by 2002:aa7:83c9:: with SMTP id j9mr4029996pfn.151.1596127999129; Thu, 30 Jul 2020 09:53:19 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id z3sm6117403pjn.32.2020.07.30.09.53.18 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Jul 2020 09:53:18 -0700 (PDT) Date: Thu, 30 Jul 2020 09:53:17 -0700 From: Guenter Roeck To: Anson Huang Cc: wim@linux-watchdog.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linux-imx@nxp.com Subject: Re: [PATCH V3 2/2] watchdog: imx7ulp: Watchdog should continue running for wait/stop mode Message-ID: <20200730165317.GB178323@roeck-us.net> References: <1596074591-4207-1-git-send-email-Anson.Huang@nxp.com> <1596074591-4207-2-git-send-email-Anson.Huang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1596074591-4207-2-git-send-email-Anson.Huang@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2020 at 10:03:11AM +0800, Anson Huang wrote: > When kernel idle, system will enter wait/stop mode, wdog should continue > running in this scenario, and the refresh thread can wake up system from > wait/stop mode. > > Signed-off-by: Anson Huang Reviewed-by: Guenter Roeck > --- > no change. > --- > drivers/watchdog/imx7ulp_wdt.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c > index 010ddd1..77773b0 100644 > --- a/drivers/watchdog/imx7ulp_wdt.c > +++ b/drivers/watchdog/imx7ulp_wdt.c > @@ -22,6 +22,8 @@ > #define WDOG_CS_CLK (LPO_CLK << LPO_CLK_SHIFT) > #define WDOG_CS_EN BIT(7) > #define WDOG_CS_UPDATE BIT(5) > +#define WDOG_CS_WAIT BIT(1) > +#define WDOG_CS_STOP BIT(0) > > #define WDOG_CNT 0x4 > #define WDOG_TOVAL 0x8 > @@ -187,7 +189,8 @@ static int imx7ulp_wdt_init(void __iomem *base, unsigned int timeout) > /* set an initial timeout value in TOVAL */ > writel(timeout, base + WDOG_TOVAL); > /* enable 32bit command sequence and reconfigure */ > - val = WDOG_CS_CMD32EN | WDOG_CS_CLK | WDOG_CS_UPDATE; > + val = WDOG_CS_CMD32EN | WDOG_CS_CLK | WDOG_CS_UPDATE | > + WDOG_CS_WAIT | WDOG_CS_STOP; > writel(val, base + WDOG_CS); > imx7ulp_wdt_wait(base, WDOG_CS_RCS); > > -- > 2.7.4 >