Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp881168rdb; Fri, 9 Feb 2024 04:16:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpsrWAQEB2zi1OdiWsSrtvgIfyvAt0jHzVzK2tJ57jlMykCm1ssHTiYpcuEoKAutZ+HTC5pHTHkUSEctKcho7+nItCD1NSb1LqQuZW8A== X-Google-Smtp-Source: AGHT+IHAGeTAELH1l2HTZ66qBu4yO8BoqYGPZdcjWOuh1Kx+W+JswIPBgB/91ySQDhW7520z0HgT X-Received: by 2002:a17:906:694b:b0:a38:4822:9991 with SMTP id c11-20020a170906694b00b00a3848229991mr629721ejs.35.1707481016933; Fri, 09 Feb 2024 04:16:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707481016; cv=pass; d=google.com; s=arc-20160816; b=AVS6K3CSwueLEy4XwwNNBnJAGP1mIxvJaAEG5zgKyRvX0x1ajKNv9IcuZI5bYkLX+P 5IOa/ssWiu+jnnn3PoWCzD+SMnO0cWp/SEpdJc6FOFQ4Uk1seiZx+Pucrs2X+lnJ2RNO TCwbtm5WkOtoMPu2Y8Vs+zRznLiOTDyZnzdKMQWnkAjQCxq2JM7qNveC550tLnFurEb9 8h37L0QC+UbjDvQgbW7sCwJuynG8KF/WAUFrSgkvenjrMaJr3/6BEBo+eLRe9k4bX+AP gjHj0q6z39PSBE6q4l4y0OxUy2MYmEQWLrvjJzj7fjFbnTzHvPJkjg/DRldAiuEenZa+ 3Njw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=8ImoQ02P0Si8qV/A28I2lyqywOWzgxBkR3jS/ih8KYo=; fh=fkDawAPpwHZsfUs9z+b7gsEpSb0BNlA1z+Je9f6LpZM=; b=X+ylbrqpf20CaX5c1nZrQGBkd9uxbNcx3NhlTUseXOVAsxC4qtDKLq0nct/nM/51Qu G3Sz2FNrmYuRT78g2JcT+Ld2Hofav0lj4CC/Ji+w+o+3DkXP9FE/XBxCea2ghIt+0vF2 COscBSnX5BKoW7en1vm3nSLOTjxo04VGd635cM/mJh6Kory9dGz25vFlvtrBhhIul7bs TV1xWB2XrMw67jt2ifGrcnA3XWbtajaInoIWLf5ex3OPBhz4UJwYxRgaNNIKJ1JQO0Pj Aefgt4sj81x8tf/Y6U7sb+A9OgB8uNbmMU1UVyV5HoUmZcyiEzWzGEcZ7TOX7M+Ll6O5 g7nQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b="RaRK7Y5/"; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-57937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57937-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXZ2FHdVYoLioHN+eNxzWKTcnVsVXx1rJvZ4y2sRfRdpQyld4PAQpqsVwYJGgrLsC5Kx52Ln+/EG+C9J+kGhIv9duR8Y25bBrhVKn/4aA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gu12-20020a170906f28c00b00a386e1a3f64si738443ejb.864.2024.02.09.04.16.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 04:16:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b="RaRK7Y5/"; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-57937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57937-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 271111F2604A for ; Thu, 8 Feb 2024 11:06:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26CB37AE42; Thu, 8 Feb 2024 10:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="RaRK7Y5/" Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 894627869D for ; Thu, 8 Feb 2024 10:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707389919; cv=none; b=VXKEaYkT9X8tC/bWaEZyEZ4yyHOvpfeAapIsM6C9QbNESKgQrwIlSi4w2caiw9/HnjAvlAa+IjtrC10limGyqbpYvqLtxrQmk7XY1+xfTms1LMS5WO0zGflF8AXs5TJv6tDIbhXSlQLqqdfn62l4jWVDFfi4+PSTqIMGF/MhPFA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707389919; c=relaxed/simple; bh=MXG1y8PfM5IXzSZkb/NwZc6HuMvBHL04QNzISCsR8ak=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LY9V0lXerIiYcbP4LijNaIv42OuEnFt1XOtvfNVCS5/710phvb1zJ10eEG/P6bnEg4pPLOAbi42EFHIXo3/DXdlORQXNo3jgk7SUI5IZJU/xraRB8CQ/Ij1UysItTiY0KwQh809qPKWynYEWPunseWetZ4+o/7Y68O9LSdRy8Vk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=RaRK7Y5/; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-33b2960ff60so410265f8f.1 for ; Thu, 08 Feb 2024 02:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1707389915; x=1707994715; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8ImoQ02P0Si8qV/A28I2lyqywOWzgxBkR3jS/ih8KYo=; b=RaRK7Y5/YmSGbP+97NunLzKgkiHPSR+ar3obtcSqtPvJhT5eR+V40uyb99kYYkkHm4 b1LaNAsgXVKgpBg1JKVO7L2f4sAAFJ275PYH3HTbEnUig+JV5FisRUjT+9wWyhwt7KF9 QYujZlHlrmn2B4G1/VrdcvvF3BSlSdH/55D3e9jyMtO46DjpYNLgWrB3A9rZD2dSDesK ETCT+KqBW3MogqV6GfvwlxF72AmXiv0ZrBGBhNgWQeid4GJXcTm5dDRbTd+vEPQGDHw+ PFI/3MOY3Y1cvwC4eY1X9UWOIPanRd7UP0Q6HVIZ5XKzMFXvrf74x/xXq0CRTnxRMsUc +FiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707389915; x=1707994715; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8ImoQ02P0Si8qV/A28I2lyqywOWzgxBkR3jS/ih8KYo=; b=sO2QbHh41FWelU8X1CcPI0+pJE/3iaE7g7emXVjUQDGX4xvQdQm63pkr9/Nt2j19xn QkQUsq4J0FbtyKEcHb6EqZIiCZtpDqA91e42levxrBcJzt4bF3SsSPe1glipaQXlTgw4 tqDdIMBgm+vL+G2KsZ0WS3vPDse5nfxZEvrPQ5DdfoW6O1JT1HEKjD9vzF5GqFOIRWDG BN/D15GAVksUvxYj/8jyVXkW8aJmpAFLxu76nIROFfgcTtlUZnYypSYRYXyb6Oq4gICc xsyuloxP2sC6MRHMt200k69d8N4SphC8qC63kqAISi5nav4d1ols9kEi+gLoNsKkF2AD URpA== X-Forwarded-Encrypted: i=1; AJvYcCUXsJTVeIVd9adGwN2qHS218AW1oYj2ZeDV7VIQ2zCtQVWcE/pPbrQk6fLWRZY/DizCb3SptZGycmAzZycXuECtTVg39c53nPgAYE8q X-Gm-Message-State: AOJu0YxezlVLtsp0iCzMYauBiNB9YSAdZ8IfpkEC6XaFB2Y+pveTdVJw IJWErcDw0xSmT4UcWOjMUg9NNoTeX9W1kahxETB3pF80RNqrEhOydtQ63er3CWI= X-Received: by 2002:adf:ce88:0:b0:33b:58e1:d281 with SMTP id r8-20020adfce88000000b0033b58e1d281mr1081502wrn.32.1707389914893; Thu, 08 Feb 2024 02:58:34 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUVwm68MRi6LNIQPvqHGwzlyGaD1JahBgHFCGWgmNkqsoImd+jOjc2WzQRwgu+ItcZ+Yy31ESVGz3jf2dY+2wsG+DQTCRJDgI1O5QBwdHfysC3m0b5389D2gUexfgzsI90x5MO6CfubnIf0yOjr2r+cSRTv0KTL7LS4FYpA5lVLTLae+DiwI8QyqLr3G/7vo3xoI4S+m6XWNw+H6T8GEAMYRJ+42rHG+9dcotI1koo8m6VAqiaQFVVv/fP+jVkR/XQ8N9J6N3LOrgWjlaRk+2NOiul7w/TorTy/uwvmkNO/zVeLZqHy71A6/G25YNuktvqb7iRy9L45+p+ZGUEP6GCnKO2mtaAHS0rqC9E3b+b2loCxPs8lK1VxvlEtanmXgDykDxH7NsJyRel91Ty4fLfWG72JsxnUT7R63qTdKyoGBUAwJoEEz0qBLwJV/RghwIkKPue5RRflRXRyM6HVXxxdXyPYwlKgXt4NA4LfwlbSTmukENzpLkZKedgYRuKFHFjMOJgHyYMwNQ== Received: from claudiu-X670E-Pro-RS.. ([82.78.167.45]) by smtp.gmail.com with ESMTPSA id a6-20020adffac6000000b0033b4a52bfbfsm3344153wrs.57.2024.02.08.02.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 02:58:34 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 7/9] watchdog: rzg2l_wdt: Rely on the reset driver for doing proper reset Date: Thu, 8 Feb 2024 12:58:15 +0200 Message-Id: <20240208105817.2619703-8-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208105817.2619703-1-claudiu.beznea.uj@bp.renesas.com> References: <20240208105817.2619703-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Claudiu Beznea The reset driver has been adapted in commit da235d2fac21 ("clk: renesas: rzg2l: Check reset monitor registers") to check the reset monitor bits before declaring reset asserts/de-asserts as successful/failure operations. With that, there is no need to keep the reset workaround for RZ/V2M in place in the watchdog driver. Signed-off-by: Claudiu Beznea Reviewed-by: Philipp Zabel --- Changes in v6: - none Changes in v5: - none Changes in v4: - collected tag Changes in v3: - none Changes in v2: - none drivers/watchdog/rzg2l_wdt.c | 39 ++++-------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 29eb47bcf984..42f1d5d6f07e 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -54,35 +53,11 @@ struct rzg2l_wdt_priv { struct reset_control *rstc; unsigned long osc_clk_rate; unsigned long delay; - unsigned long minimum_assertion_period; struct clk *pclk; struct clk *osc_clk; enum rz_wdt_type devtype; }; -static int rzg2l_wdt_reset(struct rzg2l_wdt_priv *priv) -{ - int err, status; - - if (priv->devtype == WDT_RZV2M) { - /* WDT needs TYPE-B reset control */ - err = reset_control_assert(priv->rstc); - if (err) - return err; - ndelay(priv->minimum_assertion_period); - err = reset_control_deassert(priv->rstc); - if (err) - return err; - err = read_poll_timeout(reset_control_status, status, - status != 1, 0, 1000, false, - priv->rstc); - } else { - err = reset_control_reset(priv->rstc); - } - - return err; -} - static void rzg2l_wdt_wait_delay(struct rzg2l_wdt_priv *priv) { /* delay timer when change the setting register */ @@ -187,13 +162,12 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev, unsigned long action, void *data) { struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); + int ret; clk_prepare_enable(priv->pclk); clk_prepare_enable(priv->osc_clk); if (priv->devtype == WDT_RZG2L) { - int ret; - ret = reset_control_deassert(priv->rstc); if (ret) return ret; @@ -205,7 +179,9 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev, rzg2l_wdt_write(priv, PEEN_FORCE, PEEN); } else { /* RZ/V2M doesn't have parity error registers */ - rzg2l_wdt_reset(priv); + ret = reset_control_reset(priv->rstc); + if (ret) + return ret; wdev->timeout = 0; @@ -297,13 +273,6 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) priv->devtype = (uintptr_t)of_device_get_match_data(dev); - if (priv->devtype == WDT_RZV2M) { - priv->minimum_assertion_period = RZV2M_A_NSEC + - 3 * F2CYCLE_NSEC(pclk_rate) + 5 * - max(F2CYCLE_NSEC(priv->osc_clk_rate), - F2CYCLE_NSEC(pclk_rate)); - } - pm_runtime_enable(&pdev->dev); priv->wdev.info = &rzg2l_wdt_ident; -- 2.39.2