Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6937122rwb; Tue, 15 Nov 2022 05:45:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf40Q5ZGlbf3eAtqNAEHXCGxWVX0qsJSdajBaDd4QAue0v9HYL6Q1+xBN4OCmE9/QNoX8bVI X-Received: by 2002:a50:ff14:0:b0:461:84de:7ac4 with SMTP id a20-20020a50ff14000000b0046184de7ac4mr15219817edu.206.1668519927513; Tue, 15 Nov 2022 05:45:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668519927; cv=none; d=google.com; s=arc-20160816; b=O4eH8DpmwfIb1IW2D/5mv7+F7qxfMGRySayV4bBXqAGqcFslGSZyywARWx7rYee/Ok OBHtVhIU6nOMb0bjlODFF1m74J4wwM0clasOyNcB/Po0+OtgGaBSCNzKsxevvmKevvXx l4fFEZoKaxRnAvnW28ti9gmVKTps5JbkIk88gN5Vu4zrzPlzNolHkwjgXfJMqkXGOHUv cGpQ0KPbf3yf1cS4g0eZVcfwfZeAnPk01dw3xQMxNzgOip8vyqdF69cCFBFD1gGy+FX6 od4+deSAO5jIddPFzMKwOTP60IUJqQQUnkSAKbEOasqS1jtEDhIQ/rGu+86NlX0xzaYv 4c/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=ZDnTGPXbiNm6zj2g2lfuoOgHIS/mKdTIcYS5ODDQhN0=; b=T0qGwiV7yaqfhWwLUx7bSi2kmI2uGIcRyQnuN9z9iPxUkYIU7VeheWpHrm7NLBqJE3 JVLoaxQbOL/ft8E6ScJWrB4e0WQlK1MdCqBz4HiJVr9TcUW9138LG2K5avoykOPcuB91 77QAfQeCNhTVlkazgOghXcO7U2e7QTXZNQwTox1eojvjUMWbHZuzNTuW+ARD9U0K7ZMQ FrvEYVl9MU9DQRmIngMsuseVtNXdZRhZ61ENALpiM/I3VDMaghmYqErcM8w76w+C0bZW pcx0lSBWJBMLbjFHf/l/Kc3AXLP19jL1riZqr6MBH2Cm4i365sQIMkD+MeZO8406/Y39 NqCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IZM31JUN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11-20020a170906974b00b0078d20d71475si12166001ejy.413.2022.11.15.05.45.04; Tue, 15 Nov 2022 05:45:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IZM31JUN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238326AbiKON2b (ORCPT + 90 others); Tue, 15 Nov 2022 08:28:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238159AbiKON2P (ORCPT ); Tue, 15 Nov 2022 08:28:15 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E38801742B; Tue, 15 Nov 2022 05:28:14 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id v3so13259533pgh.4; Tue, 15 Nov 2022 05:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=ZDnTGPXbiNm6zj2g2lfuoOgHIS/mKdTIcYS5ODDQhN0=; b=IZM31JUNAUnPN8ywsJvYDfWRzgM3rYMxXwe9VbxpzoczUs9CejS3PeqLZdnIYzq1wB TwZmVVEFmBvQdX7JvtA+6JqT7XBBD5ueFFjEc1QwifInVbyXjB3AMp53Esc+WxpVftL9 m5X26FBwJY4FkQ6EI0Bexj/rUTwU3zK0NhPo7IRJ20zOLscmBir+icovtVdbzrU71ezm Zi3kHeS4Kqe6au4cxCQ/kWg1Q08Ty3Ohyv4EMXWBaIe8TZnt9pEmZUuPUGnUSt/zCT7q bUASzBpWohvT5jRLmcJMgE/skcPdcveO2OVL7s836sZUKdOJfxj5ez5JGhSKqNtd2vTN +Gag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZDnTGPXbiNm6zj2g2lfuoOgHIS/mKdTIcYS5ODDQhN0=; b=aUUhXUKfjhqJ9IqROIad3O3oGC4TRRj9Mjr54gP6fPopSj+dAVnUW4E1hYWRC9N2oS rxeMFFlPYcpmcOOGtIr2ge4v3hH65LYe2Bq+LhpJpwqnGYFhETiZPD6v2c0S5yG4fa7t F+IJ13zoy1y3AJOuZw4ACihoijq99qAysqLOtxbfbt4LPVg0ve1yjXM48nC9nFf2Kf0P swsurc89bDKWttlKWJWB77SbaBZq3TJJntW3wIG3WGIdJYXY3l61J6k+ACKmIzJNgB6C +y6EhOAJQqAgR6dFfPq+Q3gIms7GakoPJ0UVZIQMe1c6XWUKlqz7W4nXJehm8t+cGUAT Yf3w== X-Gm-Message-State: ANoB5pkFABTXRR1jdE2i5i4Icane8K0cfjM3WrYMOOcC2+3E9tWyfOEr VEizurwi23Cls32nvShtrvE= X-Received: by 2002:a62:506:0:b0:56d:4b31:c4d9 with SMTP id 6-20020a620506000000b0056d4b31c4d9mr18626216pff.44.1668518894253; Tue, 15 Nov 2022 05:28:14 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d17-20020a170902ced100b001868ed86a95sm9909550plg.174.2022.11.15.05.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 05:28:13 -0800 (PST) Sender: Guenter Roeck Date: Tue, 15 Nov 2022 05:28:11 -0800 From: Guenter Roeck To: Fabrizio Castro Cc: Rob Herring , Krzysztof Kozlowski , Wim Van Sebroeck , Geert Uytterhoeven , Magnus Damm , Biju Das , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Chris Paterson , Biju Das , Fabrizio Castro , Laurent Pinchart , Jacopo Mondi Subject: Re: [PATCH 1/3] watchdog: rzg2l_wdt: Fix reboot for RZ/V2M Message-ID: <20221115132811.GA4189373@roeck-us.net> References: <20221103223956.50575-1-fabrizio.castro.jz@renesas.com> <20221103223956.50575-2-fabrizio.castro.jz@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221103223956.50575-2-fabrizio.castro.jz@renesas.com> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 03, 2022 at 10:39:54PM +0000, Fabrizio Castro wrote: > The setting for the RZ/V2M watchdog cannot be changed once > the watchdog has been enabled, unless the IP gets reset. > The current implementation of the restart callback assumes > that the watchdog is not enabled, but that's not always the > case, and it leads to longer than necessary reboot times if > the watchdog is already running. > > Always reset the RZ/V2M watchdog first, so that we can always > restart quickly. > > Fixes: ec122fd94eeb ("watchdog: rzg2l_wdt: Add rzv2m support") > Signed-off-by: Fabrizio Castro Reviewed-by: Guenter Roeck > --- > drivers/watchdog/rzg2l_wdt.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c > index 974a4194a8fd..00438ceed17a 100644 > --- a/drivers/watchdog/rzg2l_wdt.c > +++ b/drivers/watchdog/rzg2l_wdt.c > @@ -145,10 +145,10 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev, > { > struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); > > - clk_prepare_enable(priv->pclk); > - clk_prepare_enable(priv->osc_clk); > - > if (priv->devtype == WDT_RZG2L) { > + clk_prepare_enable(priv->pclk); > + clk_prepare_enable(priv->osc_clk); > + > /* Generate Reset (WDTRSTB) Signal on parity error */ > rzg2l_wdt_write(priv, 0, PECR); > > @@ -157,6 +157,11 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev, > } else { > /* RZ/V2M doesn't have parity error registers */ > > + reset_control_reset(priv->rstc); > + > + clk_prepare_enable(priv->pclk); > + clk_prepare_enable(priv->osc_clk); > + > wdev->timeout = 0; > > /* Initialize time out */ > -- > 2.34.1 >