[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251027051430.hmix3vxdqhmt5xfu@lcpd911>
Date: Mon, 27 Oct 2025 10:44:30 +0530
From: Dhruva Gole <d-gole@...com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: Linux PM <linux-pm@...r.kernel.org>,
Jonathan Cameron
<jonathan.cameron@...wei.com>,
Takashi Iwai <tiwai@...e.de>, LKML
<linux-kernel@...r.kernel.org>,
Linux PCI <linux-pci@...r.kernel.org>,
Alex
Williamson <alex.williamson@...hat.com>,
Bjorn Helgaas <helgaas@...nel.org>,
Zhang Qilong <zhangqilong3@...wei.com>,
Ulf Hansson <ulf.hansson@...aro.org>, Frank Li <Frank.Li@....com>,
Dan Williams <dan.j.williams@...el.com>
Subject: Re: [PATCH v1] PM: runtime: Fix conditional guard definitions
On Oct 20, 2025 at 17:03:28 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Since pm_runtime_get_active() returns 0 on success, all of the
> DEFINE_GUARD_COND() macros in pm_runtime.h need the "_RET == 0"
> condition at the end of the argument list or they would not work
> correctly.
>
> Fixes: 9a0abc39450a ("PM: runtime: Add auto-cleanup macros for "resume and get" operations")
> Reported-by: kernel test robot <lkp@...el.com>
> Link: https://lore.kernel.org/linux-pm/202510191529.BCyjKlLQ-lkp@intel.com/
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> include/linux/pm_runtime.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> --- a/include/linux/pm_runtime.h
> +++ b/include/linux/pm_runtime.h
> @@ -629,13 +629,13 @@ DEFINE_GUARD(pm_runtime_active_auto, str
> * device.
> */
> DEFINE_GUARD_COND(pm_runtime_active, _try,
> - pm_runtime_get_active(_T, RPM_TRANSPARENT))
> + pm_runtime_get_active(_T, RPM_TRANSPARENT), _RET == 0)
> DEFINE_GUARD_COND(pm_runtime_active, _try_enabled,
> - pm_runtime_resume_and_get(_T))
> + pm_runtime_resume_and_get(_T), _RET == 0)
> DEFINE_GUARD_COND(pm_runtime_active_auto, _try,
> - pm_runtime_get_active(_T, RPM_TRANSPARENT))
> + pm_runtime_get_active(_T, RPM_TRANSPARENT), _RET == 0)
> DEFINE_GUARD_COND(pm_runtime_active_auto, _try_enabled,
> - pm_runtime_resume_and_get(_T))
> + pm_runtime_resume_and_get(_T), _RET == 0)
The 3-argument form automatically assumes success, so we were
essentially ignoring RET val. This seems correct now.
Reviewed-by: Dhruva Gole <d-gole@...com>
Best regards,
Dhruva Gole
Texas Instruments Incorporated
Powered by blists - more mailing lists