Re: [PATCH 1/1] PM: runtime: change stub pm_runtime_get_if_active() return 1 when !CONFIG_PM

From
Dan Carpenter <hidden>
Date
2026-10-30 13:54:34
Also in
dri-devel, imx, intel-gfx, intel-xe, linux-arm-msm, linux-hwmon, linux-iommu, linux-media, linux-pm, linux-staging, linux-usb, netdev
Reply to
Alex Elder, 2026-10-30
On Fri, Oct 30, 2026 at 08:46:07AM -0500, Alex Elder wrote:
On 10/30/26 3:57 AM, Sakari Ailus wrote:
quoted
Hi Frank,

Thanks for the patch.

On Thu, Oct 29, 2026 at 12:30:37PM -0400, Frank.Li@oss.nxp.com wrote:
quoted
From: Frank Li <Frank.Li@nxp.com>

When CONFIG_PM is not enabled, all devices runtime PM state should be
treated as active.

__pm_runtime_resume() returns 1 (called by pm_runtime_get()).
pm_runtime_get_if_active() is the try-and-get version of pm_runtime_get().
stub pm_runtime_active() also returns true. So pm_runtime_get_if_active()
should return the same value as the stub pm_runtime_get(), which is 1.
Shouldn't the same change be done to pm_runtime_get_if_in_use()? It's
otherwise the same, except that it requires also the use count to be
non-zero.
I think "yes."

I think the logic for !CONFIG_PM should basically pretend runtime
PM is enabled for all devices, and they're all ACTIVE and effectively
in use.

That implies:
- disable_depth == 0, so usage accounting would (if enabled) be done
- runtime_status == RPM_ACTIVE (power is on, no delay)
- usage_count > 0
- runtime_error == 0
- Maybe ignore_children is false?

This might not be complete (and could be wrong!).
We could add this kind of information as a comment somewhere?

regards,
dan carpenter

Thread (6 messages) 6 messages, 4 authors, last reply 5d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help