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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9F951C54EE9 for ; Sun, 25 Sep 2022 17:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=1Mlza9ycJn3pWxlvweegR9VJyTiJOuuqZrmdN+xm9mM=; b=KgTHR+dsE7yGSS RH3HHGV137FUsb9kBbzeNfgK7cGwVb6IVivCkDtUUVg9/keOCuuzYayBQ8tqHpagXWkHz1SJp1E/l EYncJpvkIs/EnrVGp6bxbqfQ5AJWQjqhxqE/BfgBhokf5WPesqt3JLEYLQh6W612k76aSa6kSwLNC ErOjkat/PaW/sw3lXyqQKfygxox2BNVWo88b+d2YU2tkAkBRbI2U2+GJWuVce4UcvAhBuJLkyuWeJ K5Anb4HAGZG+zJhYryBgsrvYhtdP9VCPwQL5wGWX7kB19bF36EuI0cs+oXawt0wty+Qd7rG0PnD33 YXf4SmFDu8Il0W+xQ2XA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocVa4-00FKn7-Ne; Sun, 25 Sep 2022 17:38:16 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocVa1-00FKk9-Hm for linux-arm-kernel@lists.infradead.org; Sun, 25 Sep 2022 17:38:14 +0000 Received: by mail-pf1-x429.google.com with SMTP id y136so4648350pfb.3 for ; Sun, 25 Sep 2022 10:38:12 -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:subject:date; bh=2vEbHYuJGgQum3kzmbdVe9uD89qeBZ07c5sX6JB1tcI=; b=YuDjhzNIBBIcGapSxPLiAW/CSLoE1d2A7Pp/zdSQ6b6qam9inwQMvRMQFi+gv7yR// WCH29foGVBUc1/S5/CkZmIhfdPluLXU0nFttnCae6xJFU/oM8L+vlkyFThdqnW0eTjoY adm1spunUtcx9bMhnbe6WLNtYc2ua8YaiMKVC9N62PwaVWTsj102WpmU8667AIYHue/B 7pwYgxBUwn1/x8k1EvcUaWSdiJluVTtKWAfunMDXYxpyD4TOUJJTn2li+5zrYHJi7gLW e/TZioLVipN9BBsaylJaYARIQWCBJftrJPLEQUQHhHbqWno2s7uaLPzoIYEV4lvjHOR9 Cwlw== 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; bh=2vEbHYuJGgQum3kzmbdVe9uD89qeBZ07c5sX6JB1tcI=; b=F7MwMuZcM7G5JqGDG8N9Y4ZCzlEDxyOOOfeY7drPaQUv9xmljUoC1L/34HlZlWgAdY QVghjuZhN545zKRZWagNs6q+bbLViOp+7wb15VfBkzTUXW7Wnqnese9k/xvc7qOvdPnr L1isobO8eszPSjRf1A9KptWahCxhWpPgMcse32tIEmAyDrMWb1FD6tLEewGGK1AcN2xl nyTJYVODBpgWJ2roFL3JWbQcZiu0nKKlbZ859zcO7UnN5CEg0jwK6I08hmdSViOgGI2k iDxxuSrDf/dRcKMWncSmKIC3eRFS8zAJWXlamobH2cpkuckFojEw0vb5p3NHhyJE9Apb uY4A== X-Gm-Message-State: ACrzQf1c+kSIYGCKyire0L4OZBQgcEMqatWM8xIuhPhRkNtWA03U5KMS snjyUZmxyU8Ry3qOzHG4MIM= X-Google-Smtp-Source: AMsMyM5JsDvTGWSHqgW/daBtU0EMC7bEQ9c2t7DnNOQKLIKMdlYvi9XHr6GpXXlyC5IAz0pGHMJI/Q== X-Received: by 2002:a05:6a00:9a7:b0:54c:27c4:3ad6 with SMTP id u39-20020a056a0009a700b0054c27c43ad6mr19939850pfg.9.1664127492442; Sun, 25 Sep 2022 10:38:12 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id u4-20020a170902e5c400b0016cf3f124e1sm9699668plf.234.2022.09.25.10.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 10:38:11 -0700 (PDT) Date: Sun, 25 Sep 2022 10:38:10 -0700 From: Guenter Roeck To: "Alice Guo (OSS)" Cc: m.felsch@pengutronix.de, wim@linux-watchdog.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, kernel@pengutronix.de, linux-imx@nxp.com, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/7] watchdog: imx7ulp_wdt: Fix RCS timeout issue Message-ID: <20220925173810.GD1763764@roeck-us.net> References: <20220825083256.14565-1-alice.guo@oss.nxp.com> <20220825083256.14565-5-alice.guo@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220825083256.14565-5-alice.guo@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220925_103813_627543_8CB284E8 X-CRM114-Status: GOOD ( 20.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 25, 2022 at 04:32:53PM +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 > > Signed-off-by: Ye Li > Signed-off-by: Alice Guo > Reviewed-by: Jacky Bai > Acked-by: Jason Liu Reviewed-by: Guenter Roeck > --- > > Changes for v2: > - none > > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel