Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp431976lqp; Sat, 13 Apr 2024 03:36:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUz2WglS8DMaMZ6UFn8hJfJLH3U8rnPL3QDbr5RKy5+Pcxrw801x3YRC/VPpo/jF3dSIWttIM6lCkKQa0yiZMVwtIntT963Pv3HaFkefg== X-Google-Smtp-Source: AGHT+IEKCpN+sjoUHoOzjy3AlR2QyXQ/VOZZgZixg8eQCf9ICXrLokJZzqD9MBhVGoFkQ9os2uFh X-Received: by 2002:a05:6214:905:b0:69b:540d:2a76 with SMTP id dj5-20020a056214090500b0069b540d2a76mr4965173qvb.4.1713004603771; Sat, 13 Apr 2024 03:36:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713004603; cv=pass; d=google.com; s=arc-20160816; b=hdrkxFXGZlmzymwv1jhRaE/5ZVCK9ysmAC1oBQh5/wNI2oor8Wze650R1POAJMFmz7 81gmxdx2YPylLZR+nO3tKwxA1QXbXMB+9RPZZHXv7sUwCCailDs8sPbYgrJ4xvXE5TjB Bzm7L82Jf2Ddk1+KJLLlUgmP/5skthttxhW+DTjQfayVWmWpPlwCkvUClNUQWoPLHTlS fSm3BPjUXHLgXXlkf9bTg9WV8prEIKLrdg7xZUlv9FSHJnc7co4ozbTu/8qepsPb2Jxg C+BryOKNkgfqdlRc5Z66PDroqzJYexe6e/nPyzUPBvLFDOTWrTrR/JfgO5zLWdril1ZR zqlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=VgdSE8l3dcBqLC3G8N5zzXK/SZDTTcBzD6Qq1pKG9y0=; fh=hpdl9YASaczWAO+uj037NfqGq/5DyDqokbTGqRXSE1w=; b=Avm5B4s6aB44nH2XnOWc+xNyrzxPPqPZXgyI428oclFw4BNsN31cxUxYlNhxyc+3oO ZQRg4GtkWPZKJiK3aIc6dVLEHbQE320yeLLY2QzU3m8Sldskbe9YgLOF01YGcQ79xMEh 0ZJxk0HUhHM/8tk4P3KkSp8yOlqn5undRIshq2O7gT+4q1/LETvasrVORXSsHS7SNr13 ch3mXFdEuKDqeL2CnfAv17Ug1UAh+fZAh/pY+EHW4n8+mhqwuCfmYfD9bG990uEj26z+ CVqTNugytn0lNUWHlqkSnRm77ZmHaF2oB3mEV1WMe3aXrBEiauEEFOAQdnzM28GwF5BH RjqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=BkR4hphc; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-140602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140602-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s14-20020ad4524e000000b0069b15ecc34csi5618624qvq.144.2024.04.13.03.36.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 03:36:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=BkR4hphc; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-140602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140602-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5EE5A1C22EA1 for ; Thu, 11 Apr 2024 14:08:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1550014EC7E; Thu, 11 Apr 2024 14:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="BkR4hphc" Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 96D7414E2C8 for ; Thu, 11 Apr 2024 14:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712844472; cv=none; b=LzJ7mc1ReeLKU+4H1i7O3ikLEVlseHwLy1S22YjgWRciwgKIdGR7zjk4HVfEzUZd+7Rm1E2pJDtWfF8ldLCOFciIqFrK9Q80lrGufISfGTX6GAngA0wPOUchDtmH5AGBF2oYTW7bdI7JryReUlNWmNrSEq1rZjYDWyNf+3uBHvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712844472; c=relaxed/simple; bh=PhXZR3X9Z0jJAcRMPU5mx53amxW3OqHiG4oniYQLYGw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VAEULLVvWenB3T682KXb3vT7eaa8btZtWrn9YSf6et81E4l4KBpErkiNhJlGta1bDN1VYNQSesYeBkUIcqMqDUrZd48662yNT1fxol6IZX/7pBw/B9lLNaiBG31bgV0WbU4jfnnkmxSXU4uETGQ85kxFxBNiWBuu7SewxLkCIro= 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=BkR4hphc; arc=none smtp.client-ip=209.85.208.54 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-f54.google.com with SMTP id 4fb4d7f45d1cf-56e2c1650d8so6445509a12.0 for ; Thu, 11 Apr 2024 07:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1712844469; x=1713449269; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=VgdSE8l3dcBqLC3G8N5zzXK/SZDTTcBzD6Qq1pKG9y0=; b=BkR4hphc99hvnAjG9zGj6p3CsU371IyN7CL1sM3sji/Jv1oYgSS5uiSDzeaK0kiaEy Raiw8IoRpVKGdJtKSms5AU7+l9AyzDFtk0O2SVCqkKl/jOZTVs8rV96NLbzk2EpeegQR B8jzZPbVr/vPhCh8NL8ItcB2Y6ZwbHnT9hF57KwL93R4HGJcKRmEULTYIy5RvjNu9PgU Il14nw3yJ1B78RpAmfDfGBz1eWGDRQvGfJpeoW3tGXa0/MayosR54rXIpriwmzUBPsuw F51JFoe80sFay0y63TMHbpNPFaS0WllMZIkB2QtZt4Ac8utgL943VmVEHpkG8C4nqetM p4Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712844469; x=1713449269; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VgdSE8l3dcBqLC3G8N5zzXK/SZDTTcBzD6Qq1pKG9y0=; b=M66Tk5xDRmQWr7aQ15SxDfTq2OvMIfPVZ/bhJa/k9iZd3/jktc1yVmcn2vy3mLUk81 c9SPhuNQH01JzdUM9Y+dObh9FAvs2GdyC6iQ/i48D4pxf1oHd0EEG9V9LwBIUB2c5i8q BnN4h+KDf2S7G78Zhipg9auG1EpIf6Y75Sn5eJBX5WRgnv2VRY+6XrFyzosNy0BijIsE uJlgtlxyK8+dVQd3sYfujersrp0lFZJKxtBtDF0StikBJaeLA0jM8fX/Ez32fvgs2HCq QYKavy1l0NlGW/vJb43EpTOi9PfiB2mdU06VgKyetBXVg5F22ZMA9AZNcEUzlUg612eG sZ2Q== X-Forwarded-Encrypted: i=1; AJvYcCU3zmpCilHTN0IayyyDxYVAfCQbn55nFbHOvmRdy5yp8CXxI7HhPI+IThjMvXN81/YmFFQtdj9wlnDIyId7My1RkldMT0BmfsqxtNot X-Gm-Message-State: AOJu0Yxab4jA1+FF4lc9cVs+4tqFRlY5fpltx2xjZaQ/DKC7ixmf5qdg qtVj2bJZnt02w5HWuOsUj5b4l2+EK7CpHRgiuQzFYac62PXDq3cjoOZ81UMe1D0= X-Received: by 2002:a17:907:7283:b0:a52:2e53:b041 with SMTP id dt3-20020a170907728300b00a522e53b041mr89190ejc.65.1712844468844; Thu, 11 Apr 2024 07:07:48 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.8]) by smtp.gmail.com with ESMTPSA id jw24-20020a170906e95800b00a51adace6ebsm791532ejb.79.2024.04.11.07.07.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Apr 2024 07:07:48 -0700 (PDT) Message-ID: <7985bafe-80ff-412c-b6e5-6db6da6b8323@tuxon.dev> Date: Thu, 11 Apr 2024 17:07:46 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RESEND v8 04/10] watchdog: rzg2l_wdt: Check return status of pm_runtime_put() Content-Language: en-US To: Guenter Roeck Cc: wim@linux-watchdog.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Claudiu Beznea References: <20240410134044.2138310-1-claudiu.beznea.uj@bp.renesas.com> <20240410134044.2138310-5-claudiu.beznea.uj@bp.renesas.com> From: claudiu beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 10.04.2024 19:41, Guenter Roeck wrote: > On Wed, Apr 10, 2024 at 04:40:38PM +0300, Claudiu wrote: >> From: Claudiu Beznea >> >> 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 >> --- >> >> Changes in v8: >> - none >> >> Changes in v7: >> - none >> >> Changes in v6: >> - none >> >> Changes in v5: >> - none >> >> Changes in v4: >> - none >> >> Changes in v3: >> - none >> >> 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; > > Nit: > return pm_runtime_put(wdev->parent); > > would have been sufficient. > pm_runtime_put() may return 1 if the device is already suspended. Further explained in v1 of this series: https://lore.kernel.org/all/92db308f-075c-4799-9777-5bc14438ce68@tuxon.dev/ > Nevertheless, > > Reviewed-by: Guenter Roeck > >> >> 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); >> } >> >> -- >> 2.39.2 >>