Message ID | 20240131102017.1841495-5-claudiu.beznea.uj@bp.renesas.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-46206-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp290774dyc; Fri, 2 Feb 2024 00:44:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVDbWiLUn4lisqTsJVe5DoS4sQdP+fl0Rn3BYNYjJOJm2iAmowO+qLfPz7jrCw83hXlvDn X-Received: by 2002:a05:6808:3020:b0:3be:9be1:1341 with SMTP id ay32-20020a056808302000b003be9be11341mr7784315oib.29.1706863440534; Fri, 02 Feb 2024 00:44:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706863440; cv=pass; d=google.com; s=arc-20160816; b=R56K3jYt5+heHC/hk5JSz4r0xPOj4CfZWKv+YVy64AcvqUPyMar+gDZSLWubqluMha McMGYEfzK+GKb1XOopkkWmQ3LDHSPT2iOdhiaOu8+8QMYMtb0qZa93Mc5WNVqr7lV/PD qAMXrrCra0Y1tCZGrlddaqfzpsxc/qwUU1paiAs2s2nSohClmCUXGlqI1liIDNObkGHt yXYzCiRz0T2ldbKRjjf2o7gVknGyzuXTf2UUSdpj1Jey1kC8tx1uCSdrtbPWA1X2q8qj AeG0mxVhZELgwPHaxZwJf1YqhTsnacM6BvkRmMsn6hkRGucpds91nwy2IfZmD2Z1mnAQ LyJw== 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=pjn1b7iVWG/Dzeqv8I89FpnvUEwnwwybhoCYxf02VwU=; fh=ay187eJ5GGZqrYDuss58sfDcZgu4tbsX7SyZIsCFk10=; b=O7zOLCXNxII80GqVZBCkyUBQvBRwTEpmS0BNhRzKItnLtpbfcu/YRh/ePf+dc14PXH UnG8eot6CngeULaX9eZvMzmMOqSceKlocomOmDy71BOQyjq7K++xTJmC0a1uzmDSEdkI dhJTPQHzhULgm0V8Us1pQcsDshDKkLe7IvwjtykSn1l2nDJ/7drdyF0tkooptyijLHpq YUHMn+n4KHNfNK3xMvOpp+ETplA6cNFC2xPCSdX0JvNOWmM0OPovFjRpwRRIQCbRikyv 368+YG/DR2KUKb5/ecQZzg55iSUWq+wHdMcIcJ10gcGPO/GC9J9VY2nOfliCoBRpKqyP KtHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=cIRbSaQr; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-46206-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46206-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCU+UH/GTorYDto48ze+0nYxlWSlVUAVgP18GSIHYF8K77TX+S5xwPhswk2gId2Z2usR1CXGE98/GB29yMBi60Oy93edpw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p22-20020a63c156000000b005dbec216167si1177703pgi.614.2024.02.02.00.44.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 00:44:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46206-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=cIRbSaQr; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-46206-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46206-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 69EA8B28EA5 for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 10:22:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D84D3762D7; Wed, 31 Jan 2024 10:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="cIRbSaQr" Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 9AABE6A35F for <linux-kernel@vger.kernel.org>; Wed, 31 Jan 2024 10:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706696437; cv=none; b=l4WPFtL/UL0X5Z3xTZN9aMK08hnvS9u43+jD8we2b65dxfdP3fX8KdI97puukmnr1pOTO385/U4rSuwDXWF73FYx2Mcjrmf+r/n0rnU/jc1fD49rSMG5OaGZaJ64jh8758VP9XqoVgUPcO4LY96/H1tu4bKxpQncjDlfeeGChA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706696437; c=relaxed/simple; bh=MgFJpUbvEVQLvjB4o3otMQmxO0bDiV3ePLWOTxj5V98=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qm+kGLJEIdlSLIBaFdjvOXPEQgx48zdGZmZKhABREgqF2wGUTD0loDxsD/IcZOf0I1m+keSb8DFvjVAKJD694/iKh8CGF19UH2JTk54+9GioNf+RMBOhwjGhZljxTgHI2xQ4KnkmymL4yDGO1aWhAqLKyhgksREl/pn0qIRgL3M= 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=cIRbSaQr; arc=none smtp.client-ip=209.85.208.50 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-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-55f7b91ce4fso1061800a12.0 for <linux-kernel@vger.kernel.org>; Wed, 31 Jan 2024 02:20:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1706696434; x=1707301234; 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=pjn1b7iVWG/Dzeqv8I89FpnvUEwnwwybhoCYxf02VwU=; b=cIRbSaQrPMsqjN2PW72K7GHlHTT1dBisTXfg6YPtGREJNKVNr442ql3N1XDg0LJ4Pn CjxcpvfgrCateO9+Si7WUFN0qzOvTdoo5Kbzz5uydRTMsW+emmzci3ul68PU3Vwy5+rp ZVHGfGJyFLKOM/tVYcMkuzg8CB29hF0S/1KtLkXvA28SBPaDE3EOyOD7tKOgkLy+tXiG X2F1yOLCnrz3UZth+Yn8uOjYWj6TamJJL+TmnyczRvRF8RwHA+weck8fpBNg1qIDxRKx cWX6h9V3kcOU7alXIQiNWATT1oqjCDeSBDWbWAoHbD4bMd8y0e08iNmEW3CjR71QszVD vIkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706696434; x=1707301234; 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=pjn1b7iVWG/Dzeqv8I89FpnvUEwnwwybhoCYxf02VwU=; b=Jmiv0yKDxONXvBsMUzk0+nxWnylZuKSIv6c8QxU/o/KtHnLhfa5dt8f+vGX3pQtIEF Ah9jfYCuCCsR9qa59IZ/1pO2tjmKUO1cZtJO1s7lK44H/QFn4K+/o5BzSQna6ieubuo7 qlWQHVs1+ReUOn974cug/TLadt0ArnjQyKPpi/UidCfwrweLRrvNGrc294r2GFNOstJR 7+eal+cfkrqTrHyo0eREF61qwBp+0XkCS8pKb4HZUMSz3DoIAAsL+vDJ3SyK0KCKiLLC 9be+3zP7D5ZIHH+SSYDR/PphZgVWkXjj8xa40nwlYyuL6ikVhSlP5h4I74I3QlX2riJX RtJg== X-Gm-Message-State: AOJu0Yx5szq97fZ60+4w7quokh2t0MUWsWW+W5abt3mpjdI6QBtRUIZj bjuTGaX3buytGyBhVFP0EpICM/Giq4VFctaL5TA+SzfFhdLrB0w7OqHwJ8xKbwM= X-Received: by 2002:a17:906:7192:b0:a35:3faf:c8d1 with SMTP id h18-20020a170906719200b00a353fafc8d1mr1208954ejk.22.1706696433795; Wed, 31 Jan 2024 02:20:33 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVdsfWILXBviMW9OR93BKPBurDeJwQf6Oui9NzsTpZNfcE3wC8/qMTH4nNhWGnLKAz0s3W5ZoCN+QoAvaniaKgj5e4ewMU0trSGK+HQzaeqoyHC3vT78T3r3SGyUEpVPvuW9MemSpjjbqjHGaUUop3csxowBP44acauzGdUDesn5dubiD+z3LV5kGziv954qiZgrqlNUW5Gy1q4cC3TCDbUfOK/d0tzrYPoKJS7o/tCIz8dhimL5UpsZfYxLe6EB6h2K5bsHuE97qzwE5IF+zkJY7X+K+wDePZe+MpMK866N7f1IzgZ6osQSKXv/11bn/hw5NcwkmrWCb7qkCpJ2eRcPKT5oF50J3RcULP5TMZoiTS1pdJxPLwd4xdIHBUjyyOdIXVMa7mCXlBDVNwE8W5Yexl8zfraiG4fM+cxqi5RITojecESa1qmy4kYYlz6hDD222JBDd6OKqG06L92hBdVv86RyWCtoDoV7dEaDVVUf/J/WoMXAtxkhvY1WoHKobq6eW7leO9ExBkb/pLwrenIeLzNq0LQ+4R45ra/nCiJBvIOWJxOMYcT5o/AFmuB7WRl8Rh5hnQlNIZv21WnfmeW2feF/tZSu/sL5jm+KgkR0eM= Received: from claudiu-X670E-Pro-RS.. ([82.78.167.87]) by smtp.gmail.com with ESMTPSA id vk6-20020a170907cbc600b00a3524be5a86sm5212966ejc.103.2024.01.31.02.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 02:20:33 -0800 (PST) From: Claudiu <claudiu.beznea@tuxon.dev> X-Google-Original-From: Claudiu <claudiu.beznea.uj@bp.renesas.com> To: wim@linux-watchdog.org, linux@roeck-us.net, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, 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, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Subject: [PATCH v2 04/11] watchdog: rzg2l_wdt: Check return status of pm_runtime_put() Date: Wed, 31 Jan 2024 12:20:10 +0200 Message-Id: <20240131102017.1841495-5-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240131102017.1841495-1-claudiu.beznea.uj@bp.renesas.com> References: <20240131102017.1841495-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789601825291857082 X-GMAIL-MSGID: 1789776039187779073 |
Series |
watchdog: rzg2l_wdt: Add support for RZ/G3S
|
|
Commit Message
claudiu beznea
Jan. 31, 2024, 10:20 a.m. UTC
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> pm_runtime_put() may return an error code. Check its return status. Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of rzg2l_wdt_stop() to its caller. Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> --- Changes in v2: - propagate the return code of rzg2l_wdt_stop() to it's callers drivers/watchdog/rzg2l_wdt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
Comments
On 31.01.2024 15:16, Guenter Roeck wrote: > On 1/31/24 03:00, claudiu beznea wrote: >> >> >> On 31.01.2024 12:41, Biju Das wrote: >>> Hi Claudiu, >>> >>>> -----Original Message----- >>>> From: claudiu beznea <claudiu.beznea@tuxon.dev> >>>> Sent: Wednesday, January 31, 2024 10:36 AM >>>> Subject: Re: [PATCH v2 04/11] watchdog: rzg2l_wdt: Check return status of >>>> pm_runtime_put() >>>> >>>> Hi, Biju, >>>> >>>> On 31.01.2024 12:32, Biju Das wrote: >>>>> Hi Claudiu, >>>>> >>>>> Thanks for the feedback. >>>>> >>>>>> -----Original Message----- >>>>>> From: Claudiu <claudiu.beznea@tuxon.dev> >>>>>> Sent: Wednesday, January 31, 2024 10:20 AM >>>>>> Subject: [PATCH v2 04/11] watchdog: rzg2l_wdt: Check return status of >>>>>> pm_runtime_put() >>>>>> >>>>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> >>>>>> >>>>>> pm_runtime_put() may return an error code. Check its return status. >>>>>> >>>>>> Along with it the rzg2l_wdt_set_timeout() function was updated to >>>>>> propagate the result of rzg2l_wdt_stop() to its caller. >>>>>> >>>>>> Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for >>>>>> RZ/G2L") >>>>>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> >>>>>> --- >>>>>> >>>>>> Changes in v2: >>>>>> - propagate the return code of rzg2l_wdt_stop() to it's callers >>>>>> >>>>>> drivers/watchdog/rzg2l_wdt.c | 11 +++++++++-- >>>>>> 1 file changed, 9 insertions(+), 2 deletions(-) >>>>>> >>>>>> diff --git a/drivers/watchdog/rzg2l_wdt.c >>>>>> b/drivers/watchdog/rzg2l_wdt.c index d87d4f50180c..7bce093316c4 >>>>>> 100644 >>>>>> --- a/drivers/watchdog/rzg2l_wdt.c >>>>>> +++ b/drivers/watchdog/rzg2l_wdt.c >>>>>> @@ -144,9 +144,13 @@ static int rzg2l_wdt_start(struct >>>>>> watchdog_device >>>>>> *wdev) static int rzg2l_wdt_stop(struct watchdog_device *wdev) { >>>>>> struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); >>>>>> + int ret; >>>>>> >>>>>> rzg2l_wdt_reset(priv); >>>>>> - pm_runtime_put(wdev->parent); >>>>>> + >>>>>> + ret = pm_runtime_put(wdev->parent); >>>>>> + if (ret < 0) >>>>>> + return ret; >>>>> >>>>> Do we need to check the return code? So far we didn't hit this >>>> condition. >>>>> If you are planning to do it, then just >>>>> >>>>> return pm_runtime_put(wdev->parent); >>>> >>>> pm_runtime_put() may return 1 if the device is suspended (which is not >>>> considered error) as explained here: >>> >>> Oops, I missed that discussion. Out of curiosity, >>> What watchdog framework/consumer is going to do with a >>> Non-error return value of 1? >> >> Looking at this: >> https://elixir.bootlin.com/linux/latest/source/drivers/watchdog/watchdog_dev.c#L809 >> >> it seems that the positive values are not considered errors thus, indeed, >> we may return directly: >> >> return pm_runtime_put(); >> >> Guenter, >> >> With this (and previous discussion from [1]), are you OK to change it like: >> >> return pm_runtime_put(); >> > > Instead of looking at the source, I would kindly ask you to look at the API. OK, I'll keep the patch as is. Thank you for your input. Claudiu Beznea > > Guenter >
diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index d87d4f50180c..7bce093316c4 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -144,9 +144,13 @@ static int rzg2l_wdt_start(struct watchdog_device *wdev) static int rzg2l_wdt_stop(struct watchdog_device *wdev) { struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); + int ret; rzg2l_wdt_reset(priv); - pm_runtime_put(wdev->parent); + + ret = pm_runtime_put(wdev->parent); + if (ret < 0) + return ret; return 0; } @@ -163,7 +167,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int time * to reset the module) so that it is updated with new timeout values. */ if (watchdog_active(wdev)) { - rzg2l_wdt_stop(wdev); + ret = rzg2l_wdt_stop(wdev); + if (ret) + return ret; + ret = rzg2l_wdt_start(wdev); }