* [PATCH v3 2/2] PM: runtime: fix stub pm_runtime_get_if_in_use() for !CONFIG_PM
[not found] <20261117173738.1073856-1-Frank.Li@oss.nxp.com>
@ 2026-11-17 17:37 ` Frank.Li
2026-11-25 15:07 ` Ulf Hansson
0 siblings, 1 reply; 5+ messages in thread
From: Frank.Li @ 2026-11-17 17:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Matthias Brugger, AngeloGioacchino Del Regno,
Heiko Stuebner, Ulf Hansson, Rodrigo Vivi, Matthew Auld,
Hans de Goede, Patrik Jakobsson, Peter Ujfalusi, Mark Brown,
Pierre-Louis Bossart, Ranjani Sridharan, Yong Wu, Will Deacon,
Tomasz Figa, Marek Vasut, Michael Tretter, Sakari Ailus,
Hans Verkuil, open list:POWER MANAGEMENT CORE, open list,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
open list:ARM/Rockchip SoC support:Keyword:b[Rr]ock[Cc]hipb
Cc: imx, Frank Li, linux-pm, Jani Nikula, Joonas Lahtinen,
Tvrtko Ursulin, Maarten Lankhorst, Maxime Ripard,
Thomas Hellstrom, Simona Vetter, David Airlie, Matthew Brost,
Thomas Zimmermann, Alessio Belle, Luigi Santivetti, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Bard Liao, Kai Vehmanen,
Robin Murphy, Mauro Carvalho Chehab, Dafna Hirschfeld,
Laurent Pinchart, Daniel Baluta, Vijendar Mukunda, dri-devel,
imagination, intel-gfx, intel-xe, iommu, linux-arm-kernel,
linux-mediatek, linux-media, linux-rockchip, linux-sound,
sound-open-firmware
From: Frank Li <Frank.Li@nxp.com>
The stub for pm_runtime_get_if_in_use() under !CONFIG_PM currently
returns -EINVAL. The real implementation returns:
1 - device is active and its usage counter is non-zero (bumped)
0 - device is not in use or not active (counter not bumped)
-EINVAL - runtime PM disabled for this device
When CONFIG_PM is not set every device is permanently "active" and
always considered "in use", so the stub must return 1, mirroring
__pm_runtime_resume() which already returns 1 in the same build.
Returning -EINVAL breaks callers that test the return value with
comparisons other than "!= 0 / == 0":
drivers/gpu/drm/i915/intel_runtime_pm.c:
if (intel_runtime_pm_get_if_in_use(rpm))
which wraps to: ret = pm_runtime_get_if_in_use(); return ret > 0;
With -EINVAL the wrapper returns false, causing an incorrect error
path in the GT fence revocation code.
drivers/gpu/drm/xe/xe_pm.c:
if (pm_runtime_get_if_in_use(xe->drm.dev) > 0)
With -EINVAL the condition is false; xe_pm_runtime_get_if_in_use()
returns false, so callers believe the device is not usable.
drivers/gpu/drm/gma500/power.c:
return pm_runtime_get_if_in_use(dev) == 1;
-EINVAL != 1, so the helper always returns false when !CONFIG_PM.
drivers/gpu/drm/imagination/pvr_power.c:
if (pm_runtime_get_if_in_use(...) <= 0)
-EINVAL <= 0 is true, so the driver always takes the "requeue" error
path instead of proceeding with the active device.
sound/soc/sof/debug.c:
if (pm_runtime_get_if_in_use(sdev->dev) == 1)
-EINVAL != 1, so d3_prevented is never set, corrupting exception
debug accounting.
drivers/iommu/mtk_iommu.c:
if (pm_runtime_get_if_in_use(dom->plat_dev->dev) <= 0)
-EINVAL <= 0 skips the TLB flush, leaving stale IOMMU mappings.
drivers/iommu/rockchip-iommu.c:
Three call sites use WARN_ON_ONCE(err < 0) or similar patterns.
-EINVAL < 0 triggers a spurious WARNING on every call.
drivers/media/i2c/isl7998x.c:
if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
-EINVAL <= 0 causes the driver to always skip register programming
when !CONFIG_PM.
drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c:
if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
-EINVAL <= 0 prevents any debug statistics from being collected.
Fixes: a436b6a19f57 ("PM / runtime: Add new helper for conditional usage count incrementation")
Fixes: 3b85b7bcccf4 ("drm/xe: Fix display runtime_pm handling")
Fixes: 672c473576ca ("drm/gma500: Rewrite power management code")
Fixes: b30289e7fa92 ("ASoC: SOF: Fix runtime pm usage counter balance after fw exception")
Fixes: c0b57581b73b ("iommu/mediatek: Add power-domain operation")
Fixes: 51ef2be546e2 ("media: i2c: isl7998x: Add driver for Intersil ISL7998x")
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Change in v3
- drop tag: cbb819c363c5 ("media: rkisp1: debug: Collect input status by sampling ISP_FLAGS_SHD")
selected PM at arch config
- drop tag: 0f181d3cf7d9 ("iommu/rockchip: Add runtime PM support")
selected PM at arch config
- drop tag: 9d58aa46291d ("drm/i915: Fix the GT fence revocation runtime PM logic")
guard by CONFIG_PM
- drop tag 727538a4bbff ("drm/imagination: Implement power management")
depend on PM
`
Change in v2
- new patches.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: "Thomas Hellstrom" <thomas.hellstrom@linux.intel.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: David Airlie <airlied@gmail.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Alessio Belle <alessio.belle@imgtec.com>
Cc: Luigi Santivetti <luigi.santivetti@imgtec.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Yong Wu <yong.wu@mediatek.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Dafna Hirschfeld <dafna@fastmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Michael Tretter <m.tretter@pengutronix.de>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Cc: Will Deacon <will@kernel.org>
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: dri-devel@lists.freedesktop.org
Cc: imagination@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: iommu@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-media@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-sound@vger.kernel.org
Cc: sound-open-firmware@alsa-project.org
Cc: imx@lists.linux.dev
---
include/linux/pm_runtime.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index de9e7518ecef2..1d983fe55a16a 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -276,7 +276,7 @@ static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
}
static inline int pm_runtime_get_if_in_use(struct device *dev)
{
- return -EINVAL;
+ return 1;
}
static inline int pm_runtime_get_if_active(struct device *dev)
{
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] PM: runtime: fix stub pm_runtime_get_if_in_use() for !CONFIG_PM
2026-11-17 17:37 ` [PATCH v3 2/2] PM: runtime: fix stub pm_runtime_get_if_in_use() for !CONFIG_PM Frank.Li
@ 2026-11-25 15:07 ` Ulf Hansson
2026-11-25 15:53 ` Rafael J. Wysocki (Intel)
0 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2026-11-25 15:07 UTC (permalink / raw)
To: Frank.Li
Cc: Rafael J. Wysocki, Matthias Brugger, AngeloGioacchino Del Regno,
Heiko Stuebner, Ulf Hansson, Rodrigo Vivi, Matthew Auld,
Hans de Goede, Patrik Jakobsson, Peter Ujfalusi, Mark Brown,
Pierre-Louis Bossart, Ranjani Sridharan, Yong Wu, Will Deacon,
Tomasz Figa, Marek Vasut, Michael Tretter, Sakari Ailus,
Hans Verkuil, open list:POWER MANAGEMENT CORE, open list,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
open list:ARM/Rockchip SoC support:Keyword:b[Rr]ock[Cc]hipb, imx,
Frank Li, Jani Nikula, Joonas Lahtinen, Tvrtko Ursulin,
Maarten Lankhorst, Maxime Ripard, Thomas Hellstrom, Simona Vetter,
David Airlie, Matthew Brost, Thomas Zimmermann, Alessio Belle,
Luigi Santivetti, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Bard Liao, Kai Vehmanen, Robin Murphy, Mauro Carvalho Chehab,
Dafna Hirschfeld, Laurent Pinchart, Daniel Baluta,
Vijendar Mukunda, dri-devel, imagination, intel-gfx, intel-xe,
iommu, linux-media, linux-sound, sound-open-firmware
On Tue, Nov 17, 2026 at 6:38 PM <Frank.Li@oss.nxp.com> wrote:
>
> From: Frank Li <Frank.Li@nxp.com>
>
> The stub for pm_runtime_get_if_in_use() under !CONFIG_PM currently
> returns -EINVAL. The real implementation returns:
> 1 - device is active and its usage counter is non-zero (bumped)
> 0 - device is not in use or not active (counter not bumped)
> -EINVAL - runtime PM disabled for this device
>
> When CONFIG_PM is not set every device is permanently "active" and
> always considered "in use", so the stub must return 1, mirroring
> __pm_runtime_resume() which already returns 1 in the same build.
>
> Returning -EINVAL breaks callers that test the return value with
> comparisons other than "!= 0 / == 0":
>
> drivers/gpu/drm/i915/intel_runtime_pm.c:
> if (intel_runtime_pm_get_if_in_use(rpm))
> which wraps to: ret = pm_runtime_get_if_in_use(); return ret > 0;
> With -EINVAL the wrapper returns false, causing an incorrect error
> path in the GT fence revocation code.
>
> drivers/gpu/drm/xe/xe_pm.c:
> if (pm_runtime_get_if_in_use(xe->drm.dev) > 0)
> With -EINVAL the condition is false; xe_pm_runtime_get_if_in_use()
> returns false, so callers believe the device is not usable.
>
> drivers/gpu/drm/gma500/power.c:
> return pm_runtime_get_if_in_use(dev) == 1;
> -EINVAL != 1, so the helper always returns false when !CONFIG_PM.
>
> drivers/gpu/drm/imagination/pvr_power.c:
> if (pm_runtime_get_if_in_use(...) <= 0)
> -EINVAL <= 0 is true, so the driver always takes the "requeue" error
> path instead of proceeding with the active device.
>
> sound/soc/sof/debug.c:
> if (pm_runtime_get_if_in_use(sdev->dev) == 1)
> -EINVAL != 1, so d3_prevented is never set, corrupting exception
> debug accounting.
>
> drivers/iommu/mtk_iommu.c:
> if (pm_runtime_get_if_in_use(dom->plat_dev->dev) <= 0)
> -EINVAL <= 0 skips the TLB flush, leaving stale IOMMU mappings.
>
> drivers/iommu/rockchip-iommu.c:
> Three call sites use WARN_ON_ONCE(err < 0) or similar patterns.
> -EINVAL < 0 triggers a spurious WARNING on every call.
>
> drivers/media/i2c/isl7998x.c:
> if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
> -EINVAL <= 0 causes the driver to always skip register programming
> when !CONFIG_PM.
>
> drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c:
> if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
> -EINVAL <= 0 prevents any debug statistics from being collected.
>
> Fixes: a436b6a19f57 ("PM / runtime: Add new helper for conditional usage count incrementation")
> Fixes: 3b85b7bcccf4 ("drm/xe: Fix display runtime_pm handling")
> Fixes: 672c473576ca ("drm/gma500: Rewrite power management code")
> Fixes: b30289e7fa92 ("ASoC: SOF: Fix runtime pm usage counter balance after fw exception")
> Fixes: c0b57581b73b ("iommu/mediatek: Add power-domain operation")
> Fixes: 51ef2be546e2 ("media: i2c: isl7998x: Add driver for Intersil ISL7998x")
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Change in v3
> - drop tag: cbb819c363c5 ("media: rkisp1: debug: Collect input status by sampling ISP_FLAGS_SHD")
> selected PM at arch config
> - drop tag: 0f181d3cf7d9 ("iommu/rockchip: Add runtime PM support")
> selected PM at arch config
> - drop tag: 9d58aa46291d ("drm/i915: Fix the GT fence revocation runtime PM logic")
> guard by CONFIG_PM
> - drop tag 727538a4bbff ("drm/imagination: Implement power management")
> depend on PM
> `
> Change in v2
> - new patches.
>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: linux-pm@vger.kernel.org
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tursulin@ursulin.net>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: "Thomas Hellstrom" <thomas.hellstrom@linux.intel.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
> Cc: Alessio Belle <alessio.belle@imgtec.com>
> Cc: Luigi Santivetti <luigi.santivetti@imgtec.com>
> Cc: Liam Girdwood <lgirdwood@gmail.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.com>
> Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
> Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Yong Wu <yong.wu@mediatek.com>
> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Dafna Hirschfeld <dafna@fastmail.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Michael Tretter <m.tretter@pengutronix.de>
> Cc: Daniel Baluta <daniel.baluta@nxp.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imagination@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: intel-xe@lists.freedesktop.org
> Cc: iommu@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-mediatek@lists.infradead.org
> Cc: linux-media@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Cc: linux-sound@vger.kernel.org
> Cc: sound-open-firmware@alsa-project.org
> Cc: imx@lists.linux.dev
> ---
> include/linux/pm_runtime.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
> index de9e7518ecef2..1d983fe55a16a 100644
> --- a/include/linux/pm_runtime.h
> +++ b/include/linux/pm_runtime.h
> @@ -276,7 +276,7 @@ static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
> }
> static inline int pm_runtime_get_if_in_use(struct device *dev)
> {
> - return -EINVAL;
> + return 1;
This should be return 0, as we did not bump the usage count.
> }
> static inline int pm_runtime_get_if_active(struct device *dev)
> {
> --
> 2.43.0
>
Kind regards
Uffe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] PM: runtime: fix stub pm_runtime_get_if_in_use() for !CONFIG_PM
2026-11-25 15:07 ` Ulf Hansson
@ 2026-11-25 15:53 ` Rafael J. Wysocki (Intel)
2026-11-25 16:00 ` Frank Li
2026-11-26 11:05 ` Ulf Hansson
0 siblings, 2 replies; 5+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-11-25 15:53 UTC (permalink / raw)
To: Ulf Hansson
Cc: Frank.Li, Rafael J. Wysocki, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Ulf Hansson,
Rodrigo Vivi, Matthew Auld, Hans de Goede, Patrik Jakobsson,
Peter Ujfalusi, Mark Brown, Pierre-Louis Bossart,
Ranjani Sridharan, Yong Wu, Will Deacon, Tomasz Figa, Marek Vasut,
Michael Tretter, Sakari Ailus, Hans Verkuil,
open list:POWER MANAGEMENT CORE, open list,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
open list:ARM/Rockchip SoC support:Keyword:b[Rr]ock[Cc]hipb, imx,
Frank Li, Jani Nikula, Joonas Lahtinen, Tvrtko Ursulin,
Maarten Lankhorst, Maxime Ripard, Thomas Hellstrom, Simona Vetter,
David Airlie, Matthew Brost, Thomas Zimmermann, Alessio Belle,
Luigi Santivetti, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Bard Liao, Kai Vehmanen, Robin Murphy, Mauro Carvalho Chehab,
Dafna Hirschfeld, Laurent Pinchart, Daniel Baluta,
Vijendar Mukunda, dri-devel, imagination, intel-gfx, intel-xe,
iommu, linux-media, linux-sound, sound-open-firmware
On Wed, Nov 25, 2026 at 4:07 PM Ulf Hansson
<ulf.hansson@oss.qualcomm.com> wrote:
>
> On Tue, Nov 17, 2026 at 6:38 PM <Frank.Li@oss.nxp.com> wrote:
> >
> > From: Frank Li <Frank.Li@nxp.com>
> >
> > The stub for pm_runtime_get_if_in_use() under !CONFIG_PM currently
> > returns -EINVAL. The real implementation returns:
> > 1 - device is active and its usage counter is non-zero (bumped)
> > 0 - device is not in use or not active (counter not bumped)
> > -EINVAL - runtime PM disabled for this device
> >
> > When CONFIG_PM is not set every device is permanently "active" and
> > always considered "in use", so the stub must return 1, mirroring
> > __pm_runtime_resume() which already returns 1 in the same build.
> >
> > Returning -EINVAL breaks callers that test the return value with
> > comparisons other than "!= 0 / == 0":
> >
> > drivers/gpu/drm/i915/intel_runtime_pm.c:
> > if (intel_runtime_pm_get_if_in_use(rpm))
> > which wraps to: ret = pm_runtime_get_if_in_use(); return ret > 0;
> > With -EINVAL the wrapper returns false, causing an incorrect error
> > path in the GT fence revocation code.
> >
> > drivers/gpu/drm/xe/xe_pm.c:
> > if (pm_runtime_get_if_in_use(xe->drm.dev) > 0)
> > With -EINVAL the condition is false; xe_pm_runtime_get_if_in_use()
> > returns false, so callers believe the device is not usable.
> >
> > drivers/gpu/drm/gma500/power.c:
> > return pm_runtime_get_if_in_use(dev) == 1;
> > -EINVAL != 1, so the helper always returns false when !CONFIG_PM.
> >
> > drivers/gpu/drm/imagination/pvr_power.c:
> > if (pm_runtime_get_if_in_use(...) <= 0)
> > -EINVAL <= 0 is true, so the driver always takes the "requeue" error
> > path instead of proceeding with the active device.
> >
> > sound/soc/sof/debug.c:
> > if (pm_runtime_get_if_in_use(sdev->dev) == 1)
> > -EINVAL != 1, so d3_prevented is never set, corrupting exception
> > debug accounting.
> >
> > drivers/iommu/mtk_iommu.c:
> > if (pm_runtime_get_if_in_use(dom->plat_dev->dev) <= 0)
> > -EINVAL <= 0 skips the TLB flush, leaving stale IOMMU mappings.
> >
> > drivers/iommu/rockchip-iommu.c:
> > Three call sites use WARN_ON_ONCE(err < 0) or similar patterns.
> > -EINVAL < 0 triggers a spurious WARNING on every call.
> >
> > drivers/media/i2c/isl7998x.c:
> > if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
> > -EINVAL <= 0 causes the driver to always skip register programming
> > when !CONFIG_PM.
> >
> > drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c:
> > if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
> > -EINVAL <= 0 prevents any debug statistics from being collected.
> >
> > Fixes: a436b6a19f57 ("PM / runtime: Add new helper for conditional usage count incrementation")
> > Fixes: 3b85b7bcccf4 ("drm/xe: Fix display runtime_pm handling")
> > Fixes: 672c473576ca ("drm/gma500: Rewrite power management code")
> > Fixes: b30289e7fa92 ("ASoC: SOF: Fix runtime pm usage counter balance after fw exception")
> > Fixes: c0b57581b73b ("iommu/mediatek: Add power-domain operation")
> > Fixes: 51ef2be546e2 ("media: i2c: isl7998x: Add driver for Intersil ISL7998x")
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > Change in v3
> > - drop tag: cbb819c363c5 ("media: rkisp1: debug: Collect input status by sampling ISP_FLAGS_SHD")
> > selected PM at arch config
> > - drop tag: 0f181d3cf7d9 ("iommu/rockchip: Add runtime PM support")
> > selected PM at arch config
> > - drop tag: 9d58aa46291d ("drm/i915: Fix the GT fence revocation runtime PM logic")
> > guard by CONFIG_PM
> > - drop tag 727538a4bbff ("drm/imagination: Implement power management")
> > depend on PM
> > `
> > Change in v2
> > - new patches.
> >
> > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > Cc: linux-pm@vger.kernel.org
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Tvrtko Ursulin <tursulin@ursulin.net>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: "Thomas Hellstrom" <thomas.hellstrom@linux.intel.com>
> > Cc: Simona Vetter <simona@ffwll.ch>
> > Cc: David Airlie <airlied@gmail.com>
> > Cc: Matthew Brost <matthew.brost@intel.com>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
> > Cc: Alessio Belle <alessio.belle@imgtec.com>
> > Cc: Luigi Santivetti <luigi.santivetti@imgtec.com>
> > Cc: Liam Girdwood <lgirdwood@gmail.com>
> > Cc: Mark Brown <broonie@kernel.org>
> > Cc: Jaroslav Kysela <perex@perex.cz>
> > Cc: Takashi Iwai <tiwai@suse.com>
> > Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
> > Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
> > Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> > Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> > Cc: Robin Murphy <robin.murphy@arm.com>
> > Cc: Yong Wu <yong.wu@mediatek.com>
> > Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > Cc: Matthias Brugger <matthias.bgg@gmail.com>
> > Cc: Heiko Stuebner <heiko@sntech.de>
> > Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> > Cc: Dafna Hirschfeld <dafna@fastmail.com>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: Michael Tretter <m.tretter@pengutronix.de>
> > Cc: Daniel Baluta <daniel.baluta@nxp.com>
> > Cc: Will Deacon <will@kernel.org>
> > Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: imagination@lists.freedesktop.org
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: intel-xe@lists.freedesktop.org
> > Cc: iommu@lists.linux.dev
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-mediatek@lists.infradead.org
> > Cc: linux-media@vger.kernel.org
> > Cc: linux-rockchip@lists.infradead.org
> > Cc: linux-sound@vger.kernel.org
> > Cc: sound-open-firmware@alsa-project.org
> > Cc: imx@lists.linux.dev
> > ---
> > include/linux/pm_runtime.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
> > index de9e7518ecef2..1d983fe55a16a 100644
> > --- a/include/linux/pm_runtime.h
> > +++ b/include/linux/pm_runtime.h
> > @@ -276,7 +276,7 @@ static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
> > }
> > static inline int pm_runtime_get_if_in_use(struct device *dev)
> > {
> > - return -EINVAL;
> > + return 1;
>
> This should be return 0, as we did not bump the usage count.
This is kind of moot because there is no usage counter.
However, the caller may always take the opportunistic "in use" path
because there are no potential costs related to it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] PM: runtime: fix stub pm_runtime_get_if_in_use() for !CONFIG_PM
2026-11-25 15:53 ` Rafael J. Wysocki (Intel)
@ 2026-11-25 16:00 ` Frank Li
2026-11-26 11:05 ` Ulf Hansson
1 sibling, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-11-25 16:00 UTC (permalink / raw)
To: Rafael J. Wysocki (Intel)
Cc: Ulf Hansson, Matthias Brugger, AngeloGioacchino Del Regno,
Heiko Stuebner, Ulf Hansson, Rodrigo Vivi, Matthew Auld,
Hans de Goede, Patrik Jakobsson, Peter Ujfalusi, Mark Brown,
Pierre-Louis Bossart, Ranjani Sridharan, Yong Wu, Will Deacon,
Tomasz Figa, Marek Vasut, Michael Tretter, Sakari Ailus,
Hans Verkuil, open list:POWER MANAGEMENT CORE, open list,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
open list:ARM/Rockchip SoC support:Keyword:b[Rr]ock[Cc]hipb, imx,
Frank Li, Jani Nikula, Joonas Lahtinen, Tvrtko Ursulin,
Maarten Lankhorst, Maxime Ripard, Thomas Hellstrom, Simona Vetter,
David Airlie, Matthew Brost, Thomas Zimmermann, Alessio Belle,
Luigi Santivetti, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Bard Liao, Kai Vehmanen, Robin Murphy, Mauro Carvalho Chehab,
Dafna Hirschfeld, Laurent Pinchart, Daniel Baluta,
Vijendar Mukunda, dri-devel, imagination, intel-gfx, intel-xe,
iommu, linux-media, linux-sound, sound-open-firmware
On Wed, Nov 25, 2026 at 04:53:35PM +0100, Rafael J. Wysocki (Intel) wrote:
> On Wed, Nov 25, 2026 at 4:07 PM Ulf Hansson
> <ulf.hansson@oss.qualcomm.com> wrote:
> >
> > On Tue, Nov 17, 2026 at 6:38 PM <Frank.Li@oss.nxp.com> wrote:
> > >
> > > From: Frank Li <Frank.Li@nxp.com>
> > >
> > > The stub for pm_runtime_get_if_in_use() under !CONFIG_PM currently
> > > returns -EINVAL. The real implementation returns:
> > > 1 - device is active and its usage counter is non-zero (bumped)
> > > 0 - device is not in use or not active (counter not bumped)
> > > -EINVAL - runtime PM disabled for this device
> > >
> > > When CONFIG_PM is not set every device is permanently "active" and
> > > always considered "in use", so the stub must return 1, mirroring
> > > __pm_runtime_resume() which already returns 1 in the same build.
> > >
> > > Returning -EINVAL breaks callers that test the return value with
> > > comparisons other than "!= 0 / == 0":
> > >
> > > drivers/gpu/drm/i915/intel_runtime_pm.c:
> > > if (intel_runtime_pm_get_if_in_use(rpm))
> > > which wraps to: ret = pm_runtime_get_if_in_use(); return ret > 0;
> > > With -EINVAL the wrapper returns false, causing an incorrect error
> > > path in the GT fence revocation code.
> > >
> > > drivers/gpu/drm/xe/xe_pm.c:
> > > if (pm_runtime_get_if_in_use(xe->drm.dev) > 0)
> > > With -EINVAL the condition is false; xe_pm_runtime_get_if_in_use()
> > > returns false, so callers believe the device is not usable.
> > >
> > > drivers/gpu/drm/gma500/power.c:
> > > return pm_runtime_get_if_in_use(dev) == 1;
> > > -EINVAL != 1, so the helper always returns false when !CONFIG_PM.
> > >
> > > drivers/gpu/drm/imagination/pvr_power.c:
> > > if (pm_runtime_get_if_in_use(...) <= 0)
> > > -EINVAL <= 0 is true, so the driver always takes the "requeue" error
> > > path instead of proceeding with the active device.
> > >
> > > sound/soc/sof/debug.c:
> > > if (pm_runtime_get_if_in_use(sdev->dev) == 1)
> > > -EINVAL != 1, so d3_prevented is never set, corrupting exception
> > > debug accounting.
> > >
> > > drivers/iommu/mtk_iommu.c:
> > > if (pm_runtime_get_if_in_use(dom->plat_dev->dev) <= 0)
> > > -EINVAL <= 0 skips the TLB flush, leaving stale IOMMU mappings.
> > >
> > > drivers/iommu/rockchip-iommu.c:
> > > Three call sites use WARN_ON_ONCE(err < 0) or similar patterns.
> > > -EINVAL < 0 triggers a spurious WARNING on every call.
> > >
> > > drivers/media/i2c/isl7998x.c:
> > > if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
> > > -EINVAL <= 0 causes the driver to always skip register programming
> > > when !CONFIG_PM.
> > >
> > > drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c:
> > > if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
> > > -EINVAL <= 0 prevents any debug statistics from being collected.
> > >
> > > Fixes: a436b6a19f57 ("PM / runtime: Add new helper for conditional usage count incrementation")
> > > Fixes: 3b85b7bcccf4 ("drm/xe: Fix display runtime_pm handling")
> > > Fixes: 672c473576ca ("drm/gma500: Rewrite power management code")
> > > Fixes: b30289e7fa92 ("ASoC: SOF: Fix runtime pm usage counter balance after fw exception")
> > > Fixes: c0b57581b73b ("iommu/mediatek: Add power-domain operation")
> > > Fixes: 51ef2be546e2 ("media: i2c: isl7998x: Add driver for Intersil ISL7998x")
> > > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > > ---
> > > Change in v3
> > > - drop tag: cbb819c363c5 ("media: rkisp1: debug: Collect input status by sampling ISP_FLAGS_SHD")
> > > selected PM at arch config
> > > - drop tag: 0f181d3cf7d9 ("iommu/rockchip: Add runtime PM support")
> > > selected PM at arch config
> > > - drop tag: 9d58aa46291d ("drm/i915: Fix the GT fence revocation runtime PM logic")
> > > guard by CONFIG_PM
> > > - drop tag 727538a4bbff ("drm/imagination: Implement power management")
> > > depend on PM
> > > `
> > > Change in v2
> > > - new patches.
> > >
> > > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > > Cc: linux-pm@vger.kernel.org
> > > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Cc: Tvrtko Ursulin <tursulin@ursulin.net>
> > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > Cc: Maxime Ripard <mripard@kernel.org>
> > > Cc: "Thomas Hellstrom" <thomas.hellstrom@linux.intel.com>
> > > Cc: Simona Vetter <simona@ffwll.ch>
> > > Cc: David Airlie <airlied@gmail.com>
> > > Cc: Matthew Brost <matthew.brost@intel.com>
> > > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > > Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
> > > Cc: Alessio Belle <alessio.belle@imgtec.com>
> > > Cc: Luigi Santivetti <luigi.santivetti@imgtec.com>
> > > Cc: Liam Girdwood <lgirdwood@gmail.com>
> > > Cc: Mark Brown <broonie@kernel.org>
> > > Cc: Jaroslav Kysela <perex@perex.cz>
> > > Cc: Takashi Iwai <tiwai@suse.com>
> > > Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
> > > Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
> > > Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> > > Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> > > Cc: Robin Murphy <robin.murphy@arm.com>
> > > Cc: Yong Wu <yong.wu@mediatek.com>
> > > Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > > Cc: Matthias Brugger <matthias.bgg@gmail.com>
> > > Cc: Heiko Stuebner <heiko@sntech.de>
> > > Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> > > Cc: Dafna Hirschfeld <dafna@fastmail.com>
> > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Cc: Michael Tretter <m.tretter@pengutronix.de>
> > > Cc: Daniel Baluta <daniel.baluta@nxp.com>
> > > Cc: Will Deacon <will@kernel.org>
> > > Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> > > Cc: dri-devel@lists.freedesktop.org
> > > Cc: imagination@lists.freedesktop.org
> > > Cc: intel-gfx@lists.freedesktop.org
> > > Cc: intel-xe@lists.freedesktop.org
> > > Cc: iommu@lists.linux.dev
> > > Cc: linux-arm-kernel@lists.infradead.org
> > > Cc: linux-mediatek@lists.infradead.org
> > > Cc: linux-media@vger.kernel.org
> > > Cc: linux-rockchip@lists.infradead.org
> > > Cc: linux-sound@vger.kernel.org
> > > Cc: sound-open-firmware@alsa-project.org
> > > Cc: imx@lists.linux.dev
> > > ---
> > > include/linux/pm_runtime.h | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
> > > index de9e7518ecef2..1d983fe55a16a 100644
> > > --- a/include/linux/pm_runtime.h
> > > +++ b/include/linux/pm_runtime.h
> > > @@ -276,7 +276,7 @@ static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
> > > }
> > > static inline int pm_runtime_get_if_in_use(struct device *dev)
> > > {
> > > - return -EINVAL;
> > > + return 1;
> >
> > This should be return 0, as we did not bump the usage count.
>
> This is kind of moot because there is no usage counter.
>
> However, the caller may always take the opportunistic "in use" path
> because there are no potential costs related to it.
When !CONFIG_PM, all device is active state, which should be equal to bump
usage count case.
And it'd better return the same value of pm_runtime_get().
Frank
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] PM: runtime: fix stub pm_runtime_get_if_in_use() for !CONFIG_PM
2026-11-25 15:53 ` Rafael J. Wysocki (Intel)
2026-11-25 16:00 ` Frank Li
@ 2026-11-26 11:05 ` Ulf Hansson
1 sibling, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2026-11-26 11:05 UTC (permalink / raw)
To: Rafael J. Wysocki (Intel)
Cc: Frank.Li, Matthias Brugger, AngeloGioacchino Del Regno,
Heiko Stuebner, Ulf Hansson, Rodrigo Vivi, Matthew Auld,
Hans de Goede, Patrik Jakobsson, Peter Ujfalusi, Mark Brown,
Pierre-Louis Bossart, Ranjani Sridharan, Yong Wu, Will Deacon,
Tomasz Figa, Marek Vasut, Michael Tretter, Sakari Ailus,
Hans Verkuil, open list:POWER MANAGEMENT CORE, open list,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
open list:ARM/Rockchip SoC support:Keyword:b[Rr]ock[Cc]hipb, imx,
Frank Li, Jani Nikula, Joonas Lahtinen, Tvrtko Ursulin,
Maarten Lankhorst, Maxime Ripard, Thomas Hellstrom, Simona Vetter,
David Airlie, Matthew Brost, Thomas Zimmermann, Alessio Belle,
Luigi Santivetti, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Bard Liao, Kai Vehmanen, Robin Murphy, Mauro Carvalho Chehab,
Dafna Hirschfeld, Laurent Pinchart, Daniel Baluta,
Vijendar Mukunda, dri-devel, imagination, intel-gfx, intel-xe,
iommu, linux-media, linux-sound, sound-open-firmware
On Wed, Nov 25, 2026 at 4:53 PM Rafael J. Wysocki (Intel)
<rafael@kernel.org> wrote:
>
> On Wed, Nov 25, 2026 at 4:07 PM Ulf Hansson
> <ulf.hansson@oss.qualcomm.com> wrote:
> >
> > On Tue, Nov 17, 2026 at 6:38 PM <Frank.Li@oss.nxp.com> wrote:
> > >
> > > From: Frank Li <Frank.Li@nxp.com>
> > >
> > > The stub for pm_runtime_get_if_in_use() under !CONFIG_PM currently
> > > returns -EINVAL. The real implementation returns:
> > > 1 - device is active and its usage counter is non-zero (bumped)
> > > 0 - device is not in use or not active (counter not bumped)
> > > -EINVAL - runtime PM disabled for this device
> > >
> > > When CONFIG_PM is not set every device is permanently "active" and
> > > always considered "in use", so the stub must return 1, mirroring
> > > __pm_runtime_resume() which already returns 1 in the same build.
> > >
> > > Returning -EINVAL breaks callers that test the return value with
> > > comparisons other than "!= 0 / == 0":
> > >
> > > drivers/gpu/drm/i915/intel_runtime_pm.c:
> > > if (intel_runtime_pm_get_if_in_use(rpm))
> > > which wraps to: ret = pm_runtime_get_if_in_use(); return ret > 0;
> > > With -EINVAL the wrapper returns false, causing an incorrect error
> > > path in the GT fence revocation code.
> > >
> > > drivers/gpu/drm/xe/xe_pm.c:
> > > if (pm_runtime_get_if_in_use(xe->drm.dev) > 0)
> > > With -EINVAL the condition is false; xe_pm_runtime_get_if_in_use()
> > > returns false, so callers believe the device is not usable.
> > >
> > > drivers/gpu/drm/gma500/power.c:
> > > return pm_runtime_get_if_in_use(dev) == 1;
> > > -EINVAL != 1, so the helper always returns false when !CONFIG_PM.
> > >
> > > drivers/gpu/drm/imagination/pvr_power.c:
> > > if (pm_runtime_get_if_in_use(...) <= 0)
> > > -EINVAL <= 0 is true, so the driver always takes the "requeue" error
> > > path instead of proceeding with the active device.
> > >
> > > sound/soc/sof/debug.c:
> > > if (pm_runtime_get_if_in_use(sdev->dev) == 1)
> > > -EINVAL != 1, so d3_prevented is never set, corrupting exception
> > > debug accounting.
> > >
> > > drivers/iommu/mtk_iommu.c:
> > > if (pm_runtime_get_if_in_use(dom->plat_dev->dev) <= 0)
> > > -EINVAL <= 0 skips the TLB flush, leaving stale IOMMU mappings.
> > >
> > > drivers/iommu/rockchip-iommu.c:
> > > Three call sites use WARN_ON_ONCE(err < 0) or similar patterns.
> > > -EINVAL < 0 triggers a spurious WARNING on every call.
> > >
> > > drivers/media/i2c/isl7998x.c:
> > > if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
> > > -EINVAL <= 0 causes the driver to always skip register programming
> > > when !CONFIG_PM.
> > >
> > > drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c:
> > > if (pm_runtime_get_if_in_use(dev) <= 0) (two call sites)
> > > -EINVAL <= 0 prevents any debug statistics from being collected.
> > >
> > > Fixes: a436b6a19f57 ("PM / runtime: Add new helper for conditional usage count incrementation")
> > > Fixes: 3b85b7bcccf4 ("drm/xe: Fix display runtime_pm handling")
> > > Fixes: 672c473576ca ("drm/gma500: Rewrite power management code")
> > > Fixes: b30289e7fa92 ("ASoC: SOF: Fix runtime pm usage counter balance after fw exception")
> > > Fixes: c0b57581b73b ("iommu/mediatek: Add power-domain operation")
> > > Fixes: 51ef2be546e2 ("media: i2c: isl7998x: Add driver for Intersil ISL7998x")
> > > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > > ---
> > > Change in v3
> > > - drop tag: cbb819c363c5 ("media: rkisp1: debug: Collect input status by sampling ISP_FLAGS_SHD")
> > > selected PM at arch config
> > > - drop tag: 0f181d3cf7d9 ("iommu/rockchip: Add runtime PM support")
> > > selected PM at arch config
> > > - drop tag: 9d58aa46291d ("drm/i915: Fix the GT fence revocation runtime PM logic")
> > > guard by CONFIG_PM
> > > - drop tag 727538a4bbff ("drm/imagination: Implement power management")
> > > depend on PM
> > > `
> > > Change in v2
> > > - new patches.
> > >
> > > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > > Cc: linux-pm@vger.kernel.org
> > > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Cc: Tvrtko Ursulin <tursulin@ursulin.net>
> > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > Cc: Maxime Ripard <mripard@kernel.org>
> > > Cc: "Thomas Hellstrom" <thomas.hellstrom@linux.intel.com>
> > > Cc: Simona Vetter <simona@ffwll.ch>
> > > Cc: David Airlie <airlied@gmail.com>
> > > Cc: Matthew Brost <matthew.brost@intel.com>
> > > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > > Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
> > > Cc: Alessio Belle <alessio.belle@imgtec.com>
> > > Cc: Luigi Santivetti <luigi.santivetti@imgtec.com>
> > > Cc: Liam Girdwood <lgirdwood@gmail.com>
> > > Cc: Mark Brown <broonie@kernel.org>
> > > Cc: Jaroslav Kysela <perex@perex.cz>
> > > Cc: Takashi Iwai <tiwai@suse.com>
> > > Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
> > > Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
> > > Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> > > Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> > > Cc: Robin Murphy <robin.murphy@arm.com>
> > > Cc: Yong Wu <yong.wu@mediatek.com>
> > > Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > > Cc: Matthias Brugger <matthias.bgg@gmail.com>
> > > Cc: Heiko Stuebner <heiko@sntech.de>
> > > Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> > > Cc: Dafna Hirschfeld <dafna@fastmail.com>
> > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Cc: Michael Tretter <m.tretter@pengutronix.de>
> > > Cc: Daniel Baluta <daniel.baluta@nxp.com>
> > > Cc: Will Deacon <will@kernel.org>
> > > Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> > > Cc: dri-devel@lists.freedesktop.org
> > > Cc: imagination@lists.freedesktop.org
> > > Cc: intel-gfx@lists.freedesktop.org
> > > Cc: intel-xe@lists.freedesktop.org
> > > Cc: iommu@lists.linux.dev
> > > Cc: linux-arm-kernel@lists.infradead.org
> > > Cc: linux-mediatek@lists.infradead.org
> > > Cc: linux-media@vger.kernel.org
> > > Cc: linux-rockchip@lists.infradead.org
> > > Cc: linux-sound@vger.kernel.org
> > > Cc: sound-open-firmware@alsa-project.org
> > > Cc: imx@lists.linux.dev
> > > ---
> > > include/linux/pm_runtime.h | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
> > > index de9e7518ecef2..1d983fe55a16a 100644
> > > --- a/include/linux/pm_runtime.h
> > > +++ b/include/linux/pm_runtime.h
> > > @@ -276,7 +276,7 @@ static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
> > > }
> > > static inline int pm_runtime_get_if_in_use(struct device *dev)
> > > {
> > > - return -EINVAL;
> > > + return 1;
> >
> > This should be return 0, as we did not bump the usage count.
>
> This is kind of moot because there is no usage counter.
>
> However, the caller may always take the opportunistic "in use" path
> because there are no potential costs related to it.
Of course, for the !CONFIG_PM case that makes sense.
Please add:
Reviewed-by: Ulf Hansson <ulfh@kernel.org>
Kind regards
Uffe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-26 11:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261117173738.1073856-1-Frank.Li@oss.nxp.com>
2026-11-17 17:37 ` [PATCH v3 2/2] PM: runtime: fix stub pm_runtime_get_if_in_use() for !CONFIG_PM Frank.Li
2026-11-25 15:07 ` Ulf Hansson
2026-11-25 15:53 ` Rafael J. Wysocki (Intel)
2026-11-25 16:00 ` Frank Li
2026-11-26 11:05 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox