[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z7cmHZ_uuM31mGRd@black.fi.intel.com>
Date: Thu, 20 Feb 2025 14:54:53 +0200
From: Raag Jadav <raag.jadav@...el.com>
To: Paul Cercueil <paul@...pouillou.net>
Cc: rafael@...nel.org, andriy.shevchenko@...ux.intel.com,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] PM: Discard runtime_xx() handles using pm_ptr()
On Thu, Feb 20, 2025 at 01:15:19PM +0100, Paul Cercueil wrote:
> Hi Raag,
>
> Le jeudi 20 février 2025 à 13:33 +0530, Raag Jadav a écrit :
> > Discard runtime_xx() handles in RUNTIME_PM_OPS() using pm_ptr() macro
> > and drop unnecessary CONFIG_PM ifdeffery.
>
> So the RUNTIME_PM_OPS() is newer and people should use that, but we're
> not yet at the point where the older SET_RUNTIME_PM_OPS() macro can be
> dropped.
>
> The difference is that in the !CONFIG_PM case, the former will
> reference the suspend/resume functions, but they will be detected as
> dead code; on the other hand, the latter macro won't reference them at
> all. Many drivers still wrap their suspend/resume functions in a #ifdef
> CONFIG_PM to avoid warnings about unused static functions. Therefore if
> you unconditionally force the use of the first macro everywhere, many
> drivers will fail to compile in the !CONFIG_PM case.
>
> As for adding pm_ptr() inside RUNTIME_PM_OPS(), it is unnecesary, as
> the whole pm_ops struct should be referenced through pm_ptr() or
> pm_sleep_ptr() anyway, which means that the whole struct and the
> callback functions will be garbage-collected if PM is disabled.
True. My intent was to garbage collect the runtime handles, atleast until
the users are converted to reference their struct pm_ops through it. I
didn't account for the driver wide CONFIG_PM ifdeffery though.
I guess pm.h has its own learning curve.
Raag
Powered by blists - more mailing lists