Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C75D3ECAAD3 for ; Wed, 14 Sep 2022 06:26:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6532484A5B; Wed, 14 Sep 2022 08:26:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1663136808; bh=msWUQV1EH6TDODHiR3E5FVS/Nxx10pN+zvAQUYQD1ec=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GMRkUb8Q0CvMTi/hdLW5GW7zUNR0MIkWoRg6OH83uX/6xu0kwV+FhXXWWsOFRUBmH LmJsrtTzvynA1AAAZLJ6Ui4rgXxFxb4N3KKf3ByK0CWUK2hmHpqxtRedZqXJbj03XZ LaHZiRtK6u0xEwQnDSx0CXk3LYHwcl66muU5DzurEtT5LI6X5t2tYtGGlGUdoHh3pU 7oMqXmef888hwYNIbCDq0w+8fiXXti2MYR5ZJCvKXbMUCy2Cup0EZY0Kjm2ymOSo5K DMsfhy1Iiac/MkDxE28jQrZBka4GkmSR/16tQsylNouuuMpHs+airscbMevaDXiuQU +NH1Q3x0T1trw== Received: by phobos.denx.de (Postfix, from userid 109) id 455F984A90; Wed, 14 Sep 2022 08:26:46 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1C5B1849F7 for ; Wed, 14 Sep 2022 08:26:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4MS9N21Dzlz9sM2; Wed, 14 Sep 2022 08:26:42 +0200 (CEST) Message-ID: Date: Wed, 14 Sep 2022 08:26:40 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v1] wdt: nuvoton: add expire function for generic reset Content-Language: en-US To: Jim Liu , JJLIU0@nuvoton.com, YSCHU@nuvoton.com, KWLIU@nuvoton.com Cc: u-boot@lists.denx.de References: <20220913061924.5502-1-JJLIU0@nuvoton.com> From: Stefan Roese In-Reply-To: <20220913061924.5502-1-JJLIU0@nuvoton.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4MS9N21Dzlz9sM2 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 13.09.22 08:19, Jim Liu wrote: > Add expire_now function for generic sysreset request > > Signed-off-by: Jim Liu > --- > drivers/watchdog/npcm_wdt.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c > index 256020f5d3..e56aa0ebe1 100644 > --- a/drivers/watchdog/npcm_wdt.c > +++ b/drivers/watchdog/npcm_wdt.c > @@ -75,6 +75,11 @@ static int npcm_wdt_reset(struct udevice *dev) > return 0; > } > > +static int npcm_wdt_expire_now(struct udevice *dev, ulong flags) > +{ > + return npcm_wdt_reset(dev); > +} > + Does this really work? You are calling the watchdog reset function here in the expire function, which will just reset / trigger the WDT. I would not expect that this will expire the WDT and result in a CPU / SoC reset. Thanks, Stefan > static int npcm_wdt_of_to_plat(struct udevice *dev) > { > struct npcm_wdt_priv *priv = dev_get_priv(dev); > @@ -87,6 +92,7 @@ static int npcm_wdt_of_to_plat(struct udevice *dev) > } > > static const struct wdt_ops npcm_wdt_ops = { > + .expire_now = npcm_wdt_expire_now, > .start = npcm_wdt_start, > .reset = npcm_wdt_reset, > .stop = npcm_wdt_stop, Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de