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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F78AC32774 for ; Tue, 23 Aug 2022 14:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240270AbiHWOrZ (ORCPT ); Tue, 23 Aug 2022 10:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243351AbiHWOpv (ORCPT ); Tue, 23 Aug 2022 10:45:51 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D9732E0D87; Tue, 23 Aug 2022 05:07:17 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id g8so8724022plq.11; Tue, 23 Aug 2022 05:07:17 -0700 (PDT) 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; bh=M5pm4/VJrTNRCgV/1Wc0seJfX5yLDcrWOklZuTfCCtY=; b=mZogj9xQ/+Vr8S1jpK658n2Aj6QC8la6Mu9cjfOmB9kNWjGGC9cQXzFTKC79hcf2Al iApFcNWbN+fGk4x4EwXIpvjKYnfyJLaupJhr+DvGL293rVOKGiVa5ArAwZr0bA91Zamm LK7Zts76zmrF40Y8XdbaYrMXuYdd//mM8L8B9Ih+NKblceMjwDBIEVE+/2pbNKtXeoki LtluyOn1PhbNCwCYifRzOxDnUZ7sNQA2RCTeEWwiCTElBqe0AmQzMAY8nN7rU3VNdIvU 2XeNxogrjLCx8HZ/4nSFiBXu3N5xQUHu2oji2nz/AqkGGjAVZ0RYrp0LQyO5SsmIFUka H1DA== 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; bh=M5pm4/VJrTNRCgV/1Wc0seJfX5yLDcrWOklZuTfCCtY=; b=HoUOJP4AVBH4QCJEhc+ifClEjNGq4gds57huSMV84ZzcmO7B9JUEheaHBO9h2eOr54 NZsMR73ZUtCYf/G+L+F6VjSouR4T2cRxfOFKrZJWMECw1SNHbYPP2cs7uYwwynxd3/Tz 5FtCZsZR5L7yYmxWLzg4sfUdGX2iQRU+QlBOCOQu9F1g40V7hf2s+Q19kdaFfAB6XbOo GS/R3MPdIysRW4AA4zL7xkCzWVQOT66kGS7omWjc32el8DXI5Ow0HG8UHdHX3Fg8hT3x bSK78oSP5N3ncoW9NVdluHd/GycUMmTsmma7sfJDUTaNkqXwe+AZtRp8U/7xoqVjN12e 4daA== X-Gm-Message-State: ACgBeo0slDv3Q/g4EtUExHV5EN5T7r8rbhUIW7Vc9MZ/MxuuI2y5r0we R3Zx6P02JRbu96MZCRdUhW4= X-Google-Smtp-Source: AA6agR6AKJbbncEdljYSR29LkZvk9rh/Ilz5/vWWK3pRLPjSRG84vapc9XlKp48gYeP57U0Da/y1Gw== X-Received: by 2002:a17:90b:1c8e:b0:1f7:524f:bfcc with SMTP id oo14-20020a17090b1c8e00b001f7524fbfccmr3025566pjb.132.1661256418503; Tue, 23 Aug 2022 05:06:58 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id g1-20020a170902e38100b0016bdf0032b9sm10206494ple.110.2022.08.23.05.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 05:06:57 -0700 (PDT) Sender: Guenter Roeck Date: Tue, 23 Aug 2022 05:06:56 -0700 From: Guenter Roeck To: "Alice Guo (OSS)" Cc: "wim@linux-watchdog.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , "kernel@pengutronix.de" , dl-linux-imx , "linux-watchdog@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 4/7] watchdog: imx7ulp_wdt: Fix RCS timeout issue Message-ID: <20220823120656.GC203169@roeck-us.net> References: <20220816043643.26569-1-alice.guo@oss.nxp.com> <20220816043643.26569-5-alice.guo@oss.nxp.com> <20220822140946.GC4087281@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org On Tue, Aug 23, 2022 at 05:59:11AM +0000, Alice Guo (OSS) wrote: > > > > -----Original Message----- > > From: Guenter Roeck On Behalf Of Guenter Roeck > > Sent: Monday, August 22, 2022 10:10 PM > > To: Alice Guo (OSS) > > Cc: wim@linux-watchdog.org; shawnguo@kernel.org; > > s.hauer@pengutronix.de; festevam@gmail.com; kernel@pengutronix.de; > > dl-linux-imx ; linux-watchdog@vger.kernel.org; > > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org > > Subject: Re: [PATCH 4/7] watchdog: imx7ulp_wdt: Fix RCS timeout issue > > > > On Tue, Aug 16, 2022 at 12:36:40PM +0800, Alice Guo (OSS) wrote: > > > From: Ye Li > > > > > > According to measure on i.MX7ULP and i.MX8ULP, the RCS done needs > > > about 3400us and 6700us respectively. So current 20us timeout is not > > > enough. When reconfiguring is on-going, unlock and configure CS will > > > lead to unknown result. > > > > > > Increase the wait timeout value to 10ms and check the return value of > > > RCS wait to fix the issue > > > > > > > You'll have to find a better solution. An active (non-sleep) wait of > > 10 ms is unacceptable. > > > > Guenter > > Hi Guenter, > > Sorry. I think this patch should be merged with " watchdog: imx7ulp_wdt: Handle wdog reconfigure failure", but I didn't merge them. I will send v2. > That doesn't change the fact that a 10 ms hot wait is unacceptable. Thanks, Guenter > Best Regards, > Alice Guo > > > > Signed-off-by: Ye Li > > > Signed-off-by: Alice Guo > > > Reviewed-by: Jacky Bai > > > Acked-by: Jason Liu > > > --- > > > drivers/watchdog/imx7ulp_wdt.c | 8 +++++--- > > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/watchdog/imx7ulp_wdt.c > > > b/drivers/watchdog/imx7ulp_wdt.c index a0f6b8cea78f..12715c248688 > > > 100644 > > > --- a/drivers/watchdog/imx7ulp_wdt.c > > > +++ b/drivers/watchdog/imx7ulp_wdt.c > > > @@ -39,7 +39,7 @@ > > > #define DEFAULT_TIMEOUT 60 > > > #define MAX_TIMEOUT 128 > > > #define WDOG_CLOCK_RATE 1000 > > > -#define WDOG_WAIT_TIMEOUT 20 > > > +#define WDOG_WAIT_TIMEOUT 10000 > > > > > > static bool nowayout = WATCHDOG_NOWAYOUT; > > module_param(nowayout, > > > bool, 0000); @@ -80,7 +80,7 @@ static int imx7ulp_wdt_enable(struct > > > watchdog_device *wdog, bool enable) > > > writel(val | WDOG_CS_EN, wdt->base + WDOG_CS); > > > else > > > writel(val & ~WDOG_CS_EN, wdt->base + WDOG_CS); > > > - imx7ulp_wdt_wait(wdt->base, WDOG_CS_RCS); > > > + ret = imx7ulp_wdt_wait(wdt->base, WDOG_CS_RCS); > > > > > > enable_out: > > > local_irq_enable(); > > > @@ -127,7 +127,9 @@ static int imx7ulp_wdt_set_timeout(struct > > watchdog_device *wdog, > > > if (ret) > > > goto timeout_out; > > > writel(val, wdt->base + WDOG_TOVAL); > > > - imx7ulp_wdt_wait(wdt->base, WDOG_CS_RCS); > > > + ret = imx7ulp_wdt_wait(wdt->base, WDOG_CS_RCS); > > > + if (ret) > > > + goto timeout_out; > > > > > > wdog->timeout = timeout; > > > > > > -- > > > 2.17.1 > > >