* [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function
@ 2025-12-22 19:48 Rafael J. Wysocki
2025-12-22 19:50 ` [PATCH v1 01/23] genirq/chip: Change irq_chip_pm_put() return type to void Rafael J. Wysocki
` (25 more replies)
0 siblings, 26 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 19:48 UTC (permalink / raw)
To: Linux PM; +Cc: LKML, Ulf Hansson, Brian Norris
Hi All,
This is something I have had on my todo list for some time, but it is
kind of tricky because the return value of pm_runtime_put() is used in
some places all over the tree.
Nevertheless, I think that it is worth doing because the majority of
users of the pm_runtime_put() return value are at least somewhat
questionable (in fact, IMV the only legitimate use of it is in the
USB core where it is included in a debug message).
This series goes through all of the users of the pm_runtime_put()
return value an makes them discard it. Patches [1-22/23] are
independent of each other and they can be processed separately,
but the last patch (obviously) depends on all of them. Each of
them will be sent to the respective maintainers and it doesn't
matter too much how they are handled, so long as they end up in
the mainline eventually.
Thanks!
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 01/23] genirq/chip: Change irq_chip_pm_put() return type to void
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
@ 2025-12-22 19:50 ` Rafael J. Wysocki
2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
` (24 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 19:50 UTC (permalink / raw)
To: Linux PM; +Cc: LKML, Ulf Hansson, Brian Norris, Thomas Gleixner
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The irq_chip_pm_put() return value is only used in __irq_do_set_handler()
to trigger a WARN_ON() if it is negative, but doing so is not useful
because irq_chip_pm_put() simply passes the pm_runtime_put() return value
to its callers.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
For this reason, modify irq_chip_pm_put() to discard the pm_runtime_put()
return value, change its return type to void, and drop the WARN_ON()
around the irq_chip_pm_put() invocation from __irq_do_set_handler().
Also update the irq_chip_pm_put() kerneldoc comment to be more accurate.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
include/linux/irq.h | 2 +-
kernel/irq/chip.c | 22 +++++++++++-----------
2 files changed, 12 insertions(+), 12 deletions(-)
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -659,7 +659,7 @@ extern void handle_percpu_devid_fasteoi_
extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);
extern int irq_chip_pm_get(struct irq_data *data);
-extern int irq_chip_pm_put(struct irq_data *data);
+extern void irq_chip_pm_put(struct irq_data *data);
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
extern void handle_fasteoi_ack_irq(struct irq_desc *desc);
extern void handle_fasteoi_mask_irq(struct irq_desc *desc);
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -995,7 +995,7 @@ __irq_do_set_handler(struct irq_desc *de
irq_state_set_disabled(desc);
if (is_chained) {
desc->action = NULL;
- WARN_ON(irq_chip_pm_put(irq_desc_get_irq_data(desc)));
+ irq_chip_pm_put(irq_desc_get_irq_data(desc));
}
desc->depth = 1;
}
@@ -1551,20 +1551,20 @@ int irq_chip_pm_get(struct irq_data *dat
}
/**
- * irq_chip_pm_put - Disable power for an IRQ chip
+ * irq_chip_pm_put - Drop a PM reference on an IRQ chip
* @data: Pointer to interrupt specific data
*
- * Disable the power to the IRQ chip referenced by the interrupt data
- * structure, belongs. Note that power will only be disabled, once this
- * function has been called for all IRQs that have called irq_chip_pm_get().
+ * Drop a power management reference, acquired via irq_chip_pm_get(), on the IRQ
+ * chip represented by the interrupt data structure.
+ *
+ * Note that this will not disable power to the IRQ chip until this function
+ * has been called for all IRQs that have called irq_chip_pm_get() and it may
+ * not disable power at all (which may be prefented by user space, for example).
*/
-int irq_chip_pm_put(struct irq_data *data)
+void irq_chip_pm_put(struct irq_data *data)
{
struct device *dev = irq_get_pm_device(data);
- int retval = 0;
-
- if (IS_ENABLED(CONFIG_PM) && dev)
- retval = pm_runtime_put(dev);
- return (retval < 0) ? retval : 0;
+ if (dev)
+ pm_runtime_put(dev);
}
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
2025-12-22 19:50 ` [PATCH v1 01/23] genirq/chip: Change irq_chip_pm_put() return type to void Rafael J. Wysocki
@ 2025-12-22 19:52 ` Rafael J. Wysocki
2025-12-22 20:57 ` Alan Stern
2025-12-23 7:56 ` Greg Kroah-Hartman
2025-12-22 19:57 ` [PATCH v1 03/23] drm: " Rafael J. Wysocki
` (23 subsequent siblings)
25 siblings, 2 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 19:52 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Greg Kroah-Hartman, linux-usb,
Alan Stern
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
To allow the return type of pm_runtime_put() to be changed to void in the
future, modify usb_autopm_put_interface_async() to discard the return
value of pm_runtime_put().
That value is merely used in a debug comment printed by the function in
question and it is not a particularly useful piece of information
because pm_runtime_put() does not guarantee that the device will be
suspended even if it successfully queues up a work item to check
whether or not the device can be suspended.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/usb/core/driver.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1810,13 +1810,11 @@ EXPORT_SYMBOL_GPL(usb_autopm_put_interfa
void usb_autopm_put_interface_async(struct usb_interface *intf)
{
struct usb_device *udev = interface_to_usbdev(intf);
- int status;
usb_mark_last_busy(udev);
- status = pm_runtime_put(&intf->dev);
- dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
- __func__, atomic_read(&intf->dev.power.usage_count),
- status);
+ pm_runtime_put(&intf->dev);
+ dev_vdbg(&intf->dev, "%s: cnt %d\n",
+ __func__, atomic_read(&intf->dev.power.usage_count));
}
EXPORT_SYMBOL_GPL(usb_autopm_put_interface_async);
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 03/23] drm: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
2025-12-22 19:50 ` [PATCH v1 01/23] genirq/chip: Change irq_chip_pm_put() return type to void Rafael J. Wysocki
2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 19:57 ` Rafael J. Wysocki
2025-12-23 10:23 ` Dave Stevenson
2025-12-23 15:57 ` Liviu Dudau
2025-12-22 19:59 ` [PATCH v1 04/23] drm/imagination: " Rafael J. Wysocki
` (22 subsequent siblings)
25 siblings, 2 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 19:57 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Liu Ying, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Shawn Guo,
Sascha Hauer, Fabio Estevam, Dave Stevenson, Maíra Canal,
Raspberry Pi Kernel Maintenance, dri-devel
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Multiple DRM drivers use the pm_runtime_put() return value for printing
debug or even error messages and all of those messages are at least
somewhat misleading.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel
has been configured with CONFIG_PM unset.
For this reason, modify all of those drivers to simply discard the
pm_runtime_put() return value which is what they should be doing.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/gpu/drm/arm/malidp_crtc.c | 6 +-----
drivers/gpu/drm/bridge/imx/imx8qm-ldb.c | 4 +---
drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 4 +---
drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 5 +----
drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 5 +----
drivers/gpu/drm/imx/dc/dc-crtc.c | 12 +++---------
drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +----
drivers/gpu/drm/vc4/vc4_vec.c | 12 ++----------
8 files changed, 11 insertions(+), 42 deletions(-)
--- a/drivers/gpu/drm/arm/malidp_crtc.c
+++ b/drivers/gpu/drm/arm/malidp_crtc.c
@@ -77,7 +77,6 @@ static void malidp_crtc_atomic_disable(s
crtc);
struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
struct malidp_hw_device *hwdev = malidp->dev;
- int err;
/* always disable planes on the CRTC that is being turned off */
drm_atomic_helper_disable_planes_on_crtc(old_state, false);
@@ -87,10 +86,7 @@ static void malidp_crtc_atomic_disable(s
clk_disable_unprepare(hwdev->pxlclk);
- err = pm_runtime_put(crtc->dev->dev);
- if (err < 0) {
- DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err);
- }
+ pm_runtime_put(crtc->dev->dev);
}
static const struct gamma_curve_segment {
--- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
+++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
@@ -280,9 +280,7 @@ static void imx8qm_ldb_bridge_atomic_dis
clk_disable_unprepare(imx8qm_ldb->clk_bypass);
clk_disable_unprepare(imx8qm_ldb->clk_pixel);
- ret = pm_runtime_put(dev);
- if (ret < 0)
- DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
+ pm_runtime_put(dev);
}
static const u32 imx8qm_ldb_bus_output_fmts[] = {
--- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
+++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
@@ -282,9 +282,7 @@ static void imx8qxp_ldb_bridge_atomic_di
if (is_split && companion)
companion->funcs->atomic_disable(companion, state);
- ret = pm_runtime_put(dev);
- if (ret < 0)
- DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
+ pm_runtime_put(dev);
}
static const u32 imx8qxp_ldb_bus_output_fmts[] = {
--- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
+++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
@@ -181,11 +181,8 @@ static void imx8qxp_pc_bridge_atomic_dis
{
struct imx8qxp_pc_channel *ch = bridge->driver_private;
struct imx8qxp_pc *pc = ch->pc;
- int ret;
- ret = pm_runtime_put(pc->dev);
- if (ret < 0)
- DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret);
+ pm_runtime_put(pc->dev);
}
static const u32 imx8qxp_pc_bus_output_fmts[] = {
--- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
+++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
@@ -127,11 +127,8 @@ static void imx8qxp_pxl2dpi_bridge_atomi
struct drm_atomic_state *state)
{
struct imx8qxp_pxl2dpi *p2d = bridge->driver_private;
- int ret;
- ret = pm_runtime_put(p2d->dev);
- if (ret < 0)
- DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret);
+ pm_runtime_put(p2d->dev);
if (p2d->companion)
p2d->companion->funcs->atomic_disable(p2d->companion, state);
--- a/drivers/gpu/drm/imx/dc/dc-crtc.c
+++ b/drivers/gpu/drm/imx/dc/dc-crtc.c
@@ -300,7 +300,7 @@ dc_crtc_atomic_disable(struct drm_crtc *
drm_atomic_get_new_crtc_state(state, crtc);
struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev);
struct dc_crtc *dc_crtc = to_dc_crtc(crtc);
- int idx, ret;
+ int idx;
if (!drm_dev_enter(crtc->dev, &idx))
goto out;
@@ -313,16 +313,10 @@ dc_crtc_atomic_disable(struct drm_crtc *
dc_fg_disable_clock(dc_crtc->fg);
/* request pixel engine power-off as plane is off too */
- ret = pm_runtime_put(dc_drm->pe->dev);
- if (ret)
- dc_crtc_err(crtc, "failed to put DC pixel engine RPM: %d\n",
- ret);
+ pm_runtime_put(dc_drm->pe->dev);
/* request display engine power-off when CRTC is disabled */
- ret = pm_runtime_put(dc_crtc->de->dev);
- if (ret < 0)
- dc_crtc_err(crtc, "failed to put DC display engine RPM: %d\n",
- ret);
+ pm_runtime_put(dc_crtc->de->dev);
drm_dev_exit(idx);
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -848,7 +848,6 @@ static void vc4_hdmi_encoder_post_crtc_p
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
struct drm_device *drm = vc4_hdmi->connector.dev;
unsigned long flags;
- int ret;
int idx;
mutex_lock(&vc4_hdmi->mutex);
@@ -867,9 +866,7 @@ static void vc4_hdmi_encoder_post_crtc_p
clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
clk_disable_unprepare(vc4_hdmi->pixel_clock);
- ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
- if (ret < 0)
- drm_err(drm, "Failed to release power domain: %d\n", ret);
+ pm_runtime_put(&vc4_hdmi->pdev->dev);
drm_dev_exit(idx);
--- a/drivers/gpu/drm/vc4/vc4_vec.c
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
@@ -542,7 +542,7 @@ static void vc4_vec_encoder_disable(stru
{
struct drm_device *drm = encoder->dev;
struct vc4_vec *vec = encoder_to_vc4_vec(encoder);
- int idx, ret;
+ int idx;
if (!drm_dev_enter(drm, &idx))
return;
@@ -556,17 +556,9 @@ static void vc4_vec_encoder_disable(stru
clk_disable_unprepare(vec->clock);
- ret = pm_runtime_put(&vec->pdev->dev);
- if (ret < 0) {
- drm_err(drm, "Failed to release power domain: %d\n", ret);
- goto err_dev_exit;
- }
+ pm_runtime_put(&vec->pdev->dev);
drm_dev_exit(idx);
- return;
-
-err_dev_exit:
- drm_dev_exit(idx);
}
static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 04/23] drm/imagination: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (2 preceding siblings ...)
2025-12-22 19:57 ` [PATCH v1 03/23] drm: " Rafael J. Wysocki
@ 2025-12-22 19:59 ` Rafael J. Wysocki
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: " Rafael J. Wysocki
` (21 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 19:59 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Frank Binns, Matt Coster,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, dri-devel
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The Imagination DRM driver defines pvr_power_put() to pass the return
value of pm_runtime_put() to the caller, but then it never uses the
return value of pvr_power_put().
Modify pvr_power_put() to discard the pm_runtime_put() return value and
change its return type to void.
No intentional functional impact.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/gpu/drm/imagination/pvr_power.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/imagination/pvr_power.h
+++ b/drivers/gpu/drm/imagination/pvr_power.h
@@ -30,12 +30,12 @@ pvr_power_get(struct pvr_device *pvr_dev
return pm_runtime_resume_and_get(drm_dev->dev);
}
-static __always_inline int
+static __always_inline void
pvr_power_put(struct pvr_device *pvr_dev)
{
struct drm_device *drm_dev = from_pvr_device(pvr_dev);
- return pm_runtime_put(drm_dev->dev);
+ pm_runtime_put(drm_dev->dev);
}
int pvr_power_domains_init(struct pvr_device *pvr_dev);
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (3 preceding siblings ...)
2025-12-22 19:59 ` [PATCH v1 04/23] drm/imagination: " Rafael J. Wysocki
@ 2025-12-22 20:01 ` Rafael J. Wysocki
2025-12-23 16:30 ` Laurent Pinchart
2025-12-22 20:03 ` [PATCH v1 06/23] media: ccs: " Rafael J. Wysocki
` (20 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:01 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Dafna Hirschfeld,
Laurent Pinchart, Mauro Carvalho Chehab, Heiko Stuebner,
linux-media, linux-rockchip
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Printing error messages on pm_runtime_put() returning negative values
is not particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
Accordingly, update rkisp1_vb2_stop_streaming() to simply discard the
return value of pm_runtime_put().
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
@@ -1123,7 +1123,6 @@ static void rkisp1_vb2_stop_streaming(st
struct rkisp1_capture *cap = queue->drv_priv;
struct rkisp1_vdev_node *node = &cap->vnode;
struct rkisp1_device *rkisp1 = cap->rkisp1;
- int ret;
mutex_lock(&cap->rkisp1->stream_lock);
@@ -1132,9 +1131,7 @@ static void rkisp1_vb2_stop_streaming(st
rkisp1_return_all_buffers(cap, VB2_BUF_STATE_ERROR);
v4l2_pipeline_pm_put(&node->vdev.entity);
- ret = pm_runtime_put(rkisp1->dev);
- if (ret < 0)
- dev_err(rkisp1->dev, "power down failed error:%d\n", ret);
+ pm_runtime_put(rkisp1->dev);
rkisp1_dummy_buf_destroy(cap);
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 06/23] media: ccs: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (4 preceding siblings ...)
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: " Rafael J. Wysocki
@ 2025-12-22 20:03 ` Rafael J. Wysocki
2025-12-22 20:06 ` [PATCH v1 07/23] media: mediatek: vcodec: " Rafael J. Wysocki
` (19 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:03 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Sakari Ailus,
Mauro Carvalho Chehab, linux-media
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Passing the pm_runtime_put() return value to callers is not particularly
useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update ccs_post_streamoff() to simply discard the return
value of pm_runtime_put() and always return success to the caller.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/media/i2c/ccs/ccs-core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -1974,7 +1974,9 @@ static int ccs_post_streamoff(struct v4l
struct ccs_sensor *sensor = to_ccs_sensor(subdev);
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
- return pm_runtime_put(&client->dev);
+ pm_runtime_put(&client->dev);
+
+ return 0;
}
static int ccs_enum_mbus_code(struct v4l2_subdev *subdev,
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 07/23] media: mediatek: vcodec: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (5 preceding siblings ...)
2025-12-22 20:03 ` [PATCH v1 06/23] media: ccs: " Rafael J. Wysocki
@ 2025-12-22 20:06 ` Rafael J. Wysocki
2025-12-22 20:07 ` [PATCH v1 08/23] watchdog: rz: Discard pm_runtime_put() return values Rafael J. Wysocki
` (18 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:06 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Tiffany Lin, Andrew-CT Chen,
Yunfei Dong, Mauro Carvalho Chehab, Matthias Brugger,
AngeloGioacchino Del Regno, linux-media, linux-mediatek
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Printing error messages on pm_runtime_put() returning negative values
is not particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
Accordingly, update mtk_vcodec_enc_pw_off() and mtk_vcodec_dec_pw_off()
to simply discard the return value of pm_runtime_put().
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c | 6 +-----
drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c | 6 +-----
2 files changed, 2 insertions(+), 10 deletions(-)
--- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c
@@ -67,11 +67,7 @@ static int mtk_vcodec_dec_pw_on(struct m
static void mtk_vcodec_dec_pw_off(struct mtk_vcodec_pm *pm)
{
- int ret;
-
- ret = pm_runtime_put(pm->dev);
- if (ret && ret != -EAGAIN)
- dev_err(pm->dev, "pm_runtime_put fail %d", ret);
+ pm_runtime_put(pm->dev);
}
static void mtk_vcodec_dec_clock_on(struct mtk_vcodec_pm *pm)
--- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c
@@ -71,11 +71,7 @@ int mtk_vcodec_enc_pw_on(struct mtk_vcod
void mtk_vcodec_enc_pw_off(struct mtk_vcodec_pm *pm)
{
- int ret;
-
- ret = pm_runtime_put(pm->dev);
- if (ret && ret != -EAGAIN)
- dev_err(pm->dev, "pm_runtime_put fail %d", ret);
+ pm_runtime_put(pm->dev);
}
void mtk_vcodec_enc_clock_on(struct mtk_vcodec_pm *pm)
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 08/23] watchdog: rz: Discard pm_runtime_put() return values
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (6 preceding siblings ...)
2025-12-22 20:06 ` [PATCH v1 07/23] media: mediatek: vcodec: " Rafael J. Wysocki
@ 2025-12-22 20:07 ` Rafael J. Wysocki
2025-12-28 19:14 ` Guenter Roeck
2025-12-22 20:09 ` [PATCH v1 09/23] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value Rafael J. Wysocki
` (17 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:07 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Wim Van Sebroeck, Guenter Roeck,
linux-watchdog
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Failing a watchdog stop due to pm_runtime_put() returning a negative
value is not particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update rzg2l_wdt_stop() and rzv2h_wdt_stop() to simply
discard the return value of pm_runtime_put().
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/watchdog/rzg2l_wdt.c | 4 +---
drivers/watchdog/rzv2h_wdt.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
--- a/drivers/watchdog/rzg2l_wdt.c
+++ b/drivers/watchdog/rzg2l_wdt.c
@@ -132,9 +132,7 @@ static int rzg2l_wdt_stop(struct watchdo
if (ret)
return ret;
- ret = pm_runtime_put(wdev->parent);
- if (ret < 0)
- return ret;
+ pm_runtime_put(wdev->parent);
return 0;
}
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -174,9 +174,7 @@ static int rzv2h_wdt_stop(struct watchdo
if (priv->of_data->wdtdcr)
rzt2h_wdt_wdtdcr_count_stop(priv);
- ret = pm_runtime_put(wdev->parent);
- if (ret < 0)
- return ret;
+ pm_runtime_put(wdev->parent);
return 0;
}
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 09/23] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (7 preceding siblings ...)
2025-12-22 20:07 ` [PATCH v1 08/23] watchdog: rz: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-22 20:09 ` Rafael J. Wysocki
2025-12-28 19:15 ` Guenter Roeck
2025-12-22 20:11 ` [PATCH v1 10/23] net: ethernet: ti: am65-cpsw: " Rafael J. Wysocki
` (16 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:09 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Wim Van Sebroeck, Guenter Roeck,
linux-watchdog
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Failing device probe due to pm_runtime_put() returning an error is not
particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update rzt2h_wdt_wdtdcr_init() to simply discard the return
value of pm_runtime_put() and return success to the caller after
invoking that function.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/watchdog/rzv2h_wdt.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -268,9 +268,7 @@ static int rzt2h_wdt_wdtdcr_init(struct
rzt2h_wdt_wdtdcr_count_stop(priv);
- ret = pm_runtime_put(&pdev->dev);
- if (ret < 0)
- return ret;
+ pm_runtime_put(&pdev->dev);
return 0;
}
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 10/23] net: ethernet: ti: am65-cpsw: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (8 preceding siblings ...)
2025-12-22 20:09 ` [PATCH v1 09/23] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:11 ` Rafael J. Wysocki
2025-12-22 20:14 ` [PATCH v1 11/23] net: cadence: macb: " Rafael J. Wysocki
` (15 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:11 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Siddharth Vadapalli,
Roger Quadros, netdev
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Printing error messages on pm_runtime_put() returning negative values
is not particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
Accordingly, update am65_cpsw_ethtool_op_begin() and cpsw_ethtool_op_begin()
to simply discard the return value of pm_runtime_put().
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 5 +----
drivers/net/ethernet/ti/cpsw_ethtool.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
--- a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
@@ -391,11 +391,8 @@ static int am65_cpsw_ethtool_op_begin(st
static void am65_cpsw_ethtool_op_complete(struct net_device *ndev)
{
struct am65_cpsw_common *common = am65_ndev_to_common(ndev);
- int ret;
- ret = pm_runtime_put(common->dev);
- if (ret < 0 && ret != -EBUSY)
- dev_err(common->dev, "ethtool complete failed %d\n", ret);
+ pm_runtime_put(common->dev);
}
static void am65_cpsw_get_drvinfo(struct net_device *ndev,
--- a/drivers/net/ethernet/ti/cpsw_ethtool.c
+++ b/drivers/net/ethernet/ti/cpsw_ethtool.c
@@ -374,11 +374,8 @@ int cpsw_ethtool_op_begin(struct net_dev
void cpsw_ethtool_op_complete(struct net_device *ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
- int ret;
- ret = pm_runtime_put(priv->cpsw->dev);
- if (ret < 0)
- cpsw_err(priv, drv, "ethtool complete failed %d\n", ret);
+ pm_runtime_put(priv->cpsw->dev);
}
void cpsw_get_channels(struct net_device *ndev, struct ethtool_channels *ch)
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 11/23] net: cadence: macb: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (9 preceding siblings ...)
2025-12-22 20:11 ` [PATCH v1 10/23] net: ethernet: ti: am65-cpsw: " Rafael J. Wysocki
@ 2025-12-22 20:14 ` Rafael J. Wysocki
2025-12-23 8:48 ` Nicolas Ferre
2025-12-22 20:16 ` [PATCH v1 12/23] net: wan: framer: Discard pm_runtime_put() return values Rafael J. Wysocki
` (14 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:14 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Nicolas Ferre, Claudiu Beznea,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Passing pm_runtime_put() return value to the callers is not particularly
useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update at91ether_close() to simply discard the return
value of pm_runtime_put() and always return success to the caller.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/net/ethernet/cadence/macb_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4837,7 +4837,9 @@ static int at91ether_close(struct net_de
at91ether_stop(lp);
- return pm_runtime_put(&lp->pdev->dev);
+ pm_runtime_put(&lp->pdev->dev);
+
+ return 0;
}
/* Transmit packet */
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 12/23] net: wan: framer: Discard pm_runtime_put() return values
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (10 preceding siblings ...)
2025-12-22 20:14 ` [PATCH v1 11/23] net: cadence: macb: " Rafael J. Wysocki
@ 2025-12-22 20:16 ` Rafael J. Wysocki
2025-12-22 20:18 ` [PATCH v1 13/23] phy: freescale: Discard pm_runtime_put() return value Rafael J. Wysocki
` (13 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:16 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman, netdev
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The framer driver defines framer_pm_runtime_put() to return an int,
but that return value is never used. It also passes the return value
of pm_runtime_put() to the caller which is not very useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
Modify phy_pm_runtime_put() to discard the pm_runtime_put() return
value and change its return type to void.
No intentional functional impact.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/net/wan/framer/framer-core.c | 7 ++-----
include/linux/framer/framer.h | 5 ++---
2 files changed, 4 insertions(+), 8 deletions(-)
--- a/drivers/net/wan/framer/framer-core.c
+++ b/drivers/net/wan/framer/framer-core.c
@@ -60,12 +60,9 @@ int framer_pm_runtime_get_sync(struct fr
}
EXPORT_SYMBOL_GPL(framer_pm_runtime_get_sync);
-int framer_pm_runtime_put(struct framer *framer)
+void framer_pm_runtime_put(struct framer *framer)
{
- if (!pm_runtime_enabled(&framer->dev))
- return -EOPNOTSUPP;
-
- return pm_runtime_put(&framer->dev);
+ pm_runtime_put(&framer->dev);
}
EXPORT_SYMBOL_GPL(framer_pm_runtime_put);
--- a/include/linux/framer/framer.h
+++ b/include/linux/framer/framer.h
@@ -96,7 +96,7 @@ struct framer {
#if IS_ENABLED(CONFIG_GENERIC_FRAMER)
int framer_pm_runtime_get(struct framer *framer);
int framer_pm_runtime_get_sync(struct framer *framer);
-int framer_pm_runtime_put(struct framer *framer);
+void framer_pm_runtime_put(struct framer *framer);
int framer_pm_runtime_put_sync(struct framer *framer);
int framer_init(struct framer *framer);
int framer_exit(struct framer *framer);
@@ -124,9 +124,8 @@ static inline int framer_pm_runtime_get_
return -ENOSYS;
}
-static inline int framer_pm_runtime_put(struct framer *framer)
+static inline void framer_pm_runtime_put(struct framer *framer)
{
- return -ENOSYS;
}
static inline int framer_pm_runtime_put_sync(struct framer *framer)
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 13/23] phy: freescale: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (11 preceding siblings ...)
2025-12-22 20:16 ` [PATCH v1 12/23] net: wan: framer: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-22 20:18 ` Rafael J. Wysocki
2025-12-22 20:21 ` [PATCH v1 14/23] phy: rockchip-samsung-dcphy: " Rafael J. Wysocki
` (12 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:18 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Vinod Koul, Neil Armstrong,
Shawn Guo, Sascha Hauer, Fabio Estevam, linux-phy, imx
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Printing error messages on pm_runtime_put() returning negative values
is not particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
Accordingly, update mixel_lvds_phy_reset() to simply discard the return
value of pm_runtime_put().
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c
+++ b/drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c
@@ -286,11 +286,9 @@ static int mixel_lvds_phy_reset(struct d
regmap_write(priv->regmap, PHY_CTRL, CTRL_RESET_VAL);
- ret = pm_runtime_put(dev);
- if (ret < 0)
- dev_err(dev, "failed to put PM runtime: %d\n", ret);
+ pm_runtime_put(dev);
- return ret;
+ return 0;
}
static struct phy *mixel_lvds_phy_xlate(struct device *dev,
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 14/23] phy: rockchip-samsung-dcphy: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (12 preceding siblings ...)
2025-12-22 20:18 ` [PATCH v1 13/23] phy: freescale: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:21 ` Rafael J. Wysocki
2025-12-22 20:22 ` [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values Rafael J. Wysocki
` (11 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:21 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Vinod Koul, Neil Armstrong,
Heiko Stuebner, linux-phy, linux-rockchip
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Passing pm_runtime_put() return value to the callers is not particularly
useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update samsung_mipi_dcphy_exit() to simply discard the
return value of pm_runtime_put() and always return success to the
caller.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
@@ -1508,7 +1508,9 @@ static int samsung_mipi_dcphy_exit(struc
{
struct samsung_mipi_dcphy *samsung = phy_get_drvdata(phy);
- return pm_runtime_put(samsung->dev);
+ pm_runtime_put(samsung->dev);
+
+ return 0;
}
static const struct phy_ops samsung_mipi_dcphy_ops = {
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (13 preceding siblings ...)
2025-12-22 20:21 ` [PATCH v1 14/23] phy: rockchip-samsung-dcphy: " Rafael J. Wysocki
@ 2025-12-22 20:22 ` Rafael J. Wysocki
2025-12-30 10:34 ` Geert Uytterhoeven
2025-12-22 20:24 ` [PATCH v1 16/23] hwspinlock: omap: Discard pm_runtime_put() return value Rafael J. Wysocki
` (10 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:22 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Vinod Koul, Neil Armstrong,
linux-phy
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The PHY core defines phy_pm_runtime_put() to return an int, but that
return value is never used. It also passes the return value of
pm_runtime_put() to the caller which is not very useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
Modify phy_pm_runtime_put() to discard the pm_runtime_put() return
value and change its return type to void. Also drop the redundant
pm_runtime_enabled() call from there.
No intentional functional impact.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/phy/phy-core.c | 9 +++------
include/linux/phy/phy.h | 7 ++-----
2 files changed, 5 insertions(+), 11 deletions(-)
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
}
EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);
-int phy_pm_runtime_put(struct phy *phy)
+void phy_pm_runtime_put(struct phy *phy)
{
if (!phy)
- return 0;
+ return;
- if (!pm_runtime_enabled(&phy->dev))
- return -ENOTSUPP;
-
- return pm_runtime_put(&phy->dev);
+ pm_runtime_put(&phy->dev);
}
EXPORT_SYMBOL_GPL(phy_pm_runtime_put);
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -232,7 +232,7 @@ static inline void *phy_get_drvdata(stru
#if IS_ENABLED(CONFIG_GENERIC_PHY)
int phy_pm_runtime_get(struct phy *phy);
int phy_pm_runtime_get_sync(struct phy *phy);
-int phy_pm_runtime_put(struct phy *phy);
+void phy_pm_runtime_put(struct phy *phy);
int phy_pm_runtime_put_sync(struct phy *phy);
int phy_init(struct phy *phy);
int phy_exit(struct phy *phy);
@@ -312,11 +312,8 @@ static inline int phy_pm_runtime_get_syn
return -ENOSYS;
}
-static inline int phy_pm_runtime_put(struct phy *phy)
+static inline void phy_pm_runtime_put(struct phy *phy)
{
- if (!phy)
- return 0;
- return -ENOSYS;
}
static inline int phy_pm_runtime_put_sync(struct phy *phy)
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 16/23] hwspinlock: omap: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (14 preceding siblings ...)
2025-12-22 20:22 ` [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-22 20:24 ` Rafael J. Wysocki
2025-12-22 20:46 ` Bjorn Andersson
2025-12-22 20:25 ` [PATCH v1 17/23] coresight: Discard pm_runtime_put() return values Rafael J. Wysocki
` (9 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:24 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Bjorn Andersson, Baolin Wang,
linux-omap, linux-remoteproc
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Failing driver probe due to pm_runtime_put() returning a negative value
is not particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel
has been configured with CONFIG_PM unset.
Accordingly, update omap_hwspinlock_probe() to simply discard the
return value of pm_runtime_put().
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/hwspinlock/omap_hwspinlock.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -101,9 +101,7 @@ static int omap_hwspinlock_probe(struct
* runtime PM will make sure the clock of this module is
* enabled again iff at least one lock is requested
*/
- ret = pm_runtime_put(&pdev->dev);
- if (ret < 0)
- return ret;
+ pm_runtime_put(&pdev->dev);
/* one of the four lsb's must be set, and nothing else */
if (hweight_long(i & 0xf) != 1 || i > 8)
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 17/23] coresight: Discard pm_runtime_put() return values
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (15 preceding siblings ...)
2025-12-22 20:24 ` [PATCH v1 16/23] hwspinlock: omap: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:25 ` Rafael J. Wysocki
2025-12-23 9:53 ` Suzuki K Poulose
2025-12-22 20:27 ` [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value Rafael J. Wysocki
` (8 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:25 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Suzuki K Poulose, Mike Leach,
Alexander Shishkin
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Failing a debugfs write due to pm_runtime_put() returning a negative
value is not particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel
has been configured with CONFIG_PM unset, in which case
debug_disable_func() in the coresight driver will always return an
error.
For this reason, update debug_disable_func() to simply discard the
return value of pm_runtime_put(), change its return type to void, and
propagate that change to debug_func_knob_write().
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/hwtracing/coresight/coresight-cpu-debug.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
--- a/drivers/hwtracing/coresight/coresight-cpu-debug.c
+++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c
@@ -451,10 +451,10 @@ err:
return ret;
}
-static int debug_disable_func(void)
+static void debug_disable_func(void)
{
struct debug_drvdata *drvdata;
- int cpu, ret, err = 0;
+ int cpu;
/*
* Disable debug power domains, records the error and keep
@@ -466,12 +466,8 @@ static int debug_disable_func(void)
if (!drvdata)
continue;
- ret = pm_runtime_put(drvdata->dev);
- if (ret < 0)
- err = ret;
+ pm_runtime_put(drvdata->dev);
}
-
- return err;
}
static ssize_t debug_func_knob_write(struct file *f,
@@ -492,7 +488,7 @@ static ssize_t debug_func_knob_write(str
if (val)
ret = debug_enable_func();
else
- ret = debug_disable_func();
+ debug_disable_func();
if (ret) {
pr_err("%s: unable to %s debug function: %d\n",
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (16 preceding siblings ...)
2025-12-22 20:25 ` [PATCH v1 17/23] coresight: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-22 20:27 ` Rafael J. Wysocki
2025-12-23 3:56 ` Tzung-Bi Shih
2025-12-22 20:29 ` [PATCH v1 19/23] pmdomain: imx: gpcv2: " Rafael J. Wysocki
` (7 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:27 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Dan Callaghan,
Sami Kyöstilä, Benson Leung, Tzung-Bi Shih,
chrome-platform
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Passing pm_runtime_put() return value to the callers is not particularly
useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update hps_release() to simply discard the return value of
pm_runtime_put() and always return success to the caller.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/platform/chrome/cros_hps_i2c.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/platform/chrome/cros_hps_i2c.c
+++ b/drivers/platform/chrome/cros_hps_i2c.c
@@ -46,7 +46,9 @@ static int hps_release(struct inode *ino
struct hps_drvdata, misc_device);
struct device *dev = &hps->client->dev;
- return pm_runtime_put(dev);
+ pm_runtime_put(dev);
+
+ return 0;
}
static const struct file_operations hps_fops = {
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (17 preceding siblings ...)
2025-12-22 20:27 ` [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:29 ` Rafael J. Wysocki
2025-12-23 13:02 ` Peng Fan
2025-12-28 15:51 ` Ulf Hansson
2025-12-22 20:31 ` [PATCH v1 20/23] scsi: ufs: core: Discard pm_runtime_put() return values Rafael J. Wysocki
` (6 subsequent siblings)
25 siblings, 2 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:29 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Shawn Guo, Sascha Hauer,
Fabio Estevam, imx
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Passing pm_runtime_put() return value to the callers is not particularly
useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
Accordingly, update imx_pgc_domain_suspend() to simply discard the
return value of pm_runtime_put() and always return success to the
caller.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/pmdomain/imx/gpcv2.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/pmdomain/imx/gpcv2.c
+++ b/drivers/pmdomain/imx/gpcv2.c
@@ -1420,7 +1420,9 @@ static int imx_pgc_domain_suspend(struct
static int imx_pgc_domain_resume(struct device *dev)
{
- return pm_runtime_put(dev);
+ pm_runtime_put(dev);
+
+ return 0;
}
#endif
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 20/23] scsi: ufs: core: Discard pm_runtime_put() return values
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (18 preceding siblings ...)
2025-12-22 20:29 ` [PATCH v1 19/23] pmdomain: imx: gpcv2: " Rafael J. Wysocki
@ 2025-12-22 20:31 ` Rafael J. Wysocki
2025-12-23 15:29 ` Bart Van Assche
2025-12-22 20:33 ` [PATCH v1 21/23] dmaengine: sh: Discard pm_runtime_put() return value Rafael J. Wysocki
` (5 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:31 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Alim Akhtar, Avri Altman,
Bart Van Assche, James E.J. Bottomley, Martin K. Petersen,
linux-scsi
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The ufshcd driver defines ufshcd_rpm_put() to return an int, but that
return value is never used. It also passes the return value of
pm_runtime_put() to the caller which is not very useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.
Modify ufshcd_rpm_put() to discard the pm_runtime_put() return value
and change its return type to void.
No intentional functional impact.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/ufs/core/ufshcd-priv.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/ufs/core/ufshcd-priv.h
+++ b/drivers/ufs/core/ufshcd-priv.h
@@ -341,9 +341,9 @@ static inline int ufshcd_rpm_resume(stru
return pm_runtime_resume(&hba->ufs_device_wlun->sdev_gendev);
}
-static inline int ufshcd_rpm_put(struct ufs_hba *hba)
+static inline void ufshcd_rpm_put(struct ufs_hba *hba)
{
- return pm_runtime_put(&hba->ufs_device_wlun->sdev_gendev);
+ pm_runtime_put(&hba->ufs_device_wlun->sdev_gendev);
}
/**
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 21/23] dmaengine: sh: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (19 preceding siblings ...)
2025-12-22 20:31 ` [PATCH v1 20/23] scsi: ufs: core: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-22 20:33 ` Rafael J. Wysocki
2025-12-22 20:35 ` [PATCH v1 22/23] ASoC: rockchip: " Rafael J. Wysocki
` (4 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:33 UTC (permalink / raw)
To: Linux PM; +Cc: LKML, Ulf Hansson, Brian Norris, Vinod Koul, dmaengine
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Clobbering an error value to be returned from shdma_tx_submit() with
a pm_runtime_put() return value is not particularly useful, especially
if the latter is 0, so stop doing that.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
drivers/dma/sh/shdma-base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
@@ -143,7 +143,7 @@ static dma_cookie_t shdma_tx_submit(stru
}
schan->pm_state = SHDMA_PM_ESTABLISHED;
- ret = pm_runtime_put(schan->dev);
+ pm_runtime_put(schan->dev);
spin_unlock_irq(&schan->chan_lock);
return ret;
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 22/23] ASoC: rockchip: Discard pm_runtime_put() return value
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (20 preceding siblings ...)
2025-12-22 20:33 ` [PATCH v1 21/23] dmaengine: sh: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:35 ` Rafael J. Wysocki
2025-12-22 20:36 ` [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void Rafael J. Wysocki
` (3 subsequent siblings)
25 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:35 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Nicolas Frattaroli,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Heiko Stuebner, linux-rockchip, linux-sound
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
It is better to check directly whether or not CONFIG_PM has
been enabled instead of relying on an error value returned by
pm_runtime_put() in that case because pm_runtime_put() may also return
an error value in other cases, like after writing "on" to the devices'
runtime PM "control" attribute in sysfs for one example.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
sound/soc/rockchip/rockchip_sai.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/sound/soc/rockchip/rockchip_sai.c
+++ b/sound/soc/rockchip/rockchip_sai.c
@@ -1487,8 +1487,9 @@ static int rockchip_sai_probe(struct pla
return 0;
err_runtime_suspend:
- /* If we're !CONFIG_PM, we get -ENOSYS and disable manually */
- if (pm_runtime_put(&pdev->dev))
+ if (IS_ENABLED(CONFIG_PM))
+ pm_runtime_put(&pdev->dev);
+ else
rockchip_sai_runtime_suspend(&pdev->dev);
return ret;
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (21 preceding siblings ...)
2025-12-22 20:35 ` [PATCH v1 22/23] ASoC: rockchip: " Rafael J. Wysocki
@ 2025-12-22 20:36 ` Rafael J. Wysocki
2025-12-28 15:51 ` Ulf Hansson
2025-12-23 11:28 ` (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Vinod Koul
` (2 subsequent siblings)
25 siblings, 1 reply; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:36 UTC (permalink / raw)
To: Linux PM; +Cc: LKML, Ulf Hansson, Brian Norris
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The primary role of pm_runtime_put() is to decrement the runtime PM
usage counter of the given device. It always does that regardless of
the value returned by it later.
In addition, if the runtime PM usage counter after decrementation turns
out to be zero, a work item is queued up to check whether or not the
device can be suspended. This is not guaranteed to succeed though and
even if it is successful, the device may still not be suspended going
forward.
There are multiple valid reasons why pm_runtime_put() may not decide to
queue up the work item mentioned above, including, but not limited to,
the case when user space has written "on" to the device's runtime PM
"control" file in sysfs. In all of those cases, pm_runtime_put()
returns a negative error code (even though the device's runtime PM
usage counter has been successfully decremented by it) which is very
confusing. In fact, its return value should only be used for debug
purposes and care should be taken when doing it even in that case.
Accordingly, to avoid the confusion mentioned above, change the return
type of pm_runtime_put() to void.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
include/linux/pm_runtime.h | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -545,22 +545,10 @@ static inline int pm_runtime_resume_and_
*
* Decrement the runtime PM usage counter of @dev and if it turns out to be
* equal to 0, queue up a work item for @dev like in pm_request_idle().
- *
- * Return:
- * * 1: Success. Usage counter dropped to zero, but device was already suspended.
- * * 0: Success.
- * * -EINVAL: Runtime PM error.
- * * -EACCES: Runtime PM disabled.
- * * -EAGAIN: Runtime PM usage counter became non-zero or Runtime PM status
- * change ongoing.
- * * -EBUSY: Runtime PM child_count non-zero.
- * * -EPERM: Device PM QoS resume latency 0.
- * * -EINPROGRESS: Suspend already in progress.
- * * -ENOSYS: CONFIG_PM not enabled.
*/
-static inline int pm_runtime_put(struct device *dev)
+static inline void pm_runtime_put(struct device *dev)
{
- return __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
+ __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
}
/**
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 16/23] hwspinlock: omap: Discard pm_runtime_put() return value
2025-12-22 20:24 ` [PATCH v1 16/23] hwspinlock: omap: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:46 ` Bjorn Andersson
0 siblings, 0 replies; 47+ messages in thread
From: Bjorn Andersson @ 2025-12-22 20:46 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Baolin Wang,
linux-omap, linux-remoteproc
On Mon, Dec 22, 2025 at 09:24:19PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Failing driver probe due to pm_runtime_put() returning a negative value
> is not particularly useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel
> has been configured with CONFIG_PM unset.
>
> Accordingly, update omap_hwspinlock_probe() to simply discard the
> return value of pm_runtime_put().
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Andersson <andersson@kernel.org>
Regards,
Bjorn
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/hwspinlock/omap_hwspinlock.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> --- a/drivers/hwspinlock/omap_hwspinlock.c
> +++ b/drivers/hwspinlock/omap_hwspinlock.c
> @@ -101,9 +101,7 @@ static int omap_hwspinlock_probe(struct
> * runtime PM will make sure the clock of this module is
> * enabled again iff at least one lock is requested
> */
> - ret = pm_runtime_put(&pdev->dev);
> - if (ret < 0)
> - return ret;
> + pm_runtime_put(&pdev->dev);
>
> /* one of the four lsb's must be set, and nothing else */
> if (hweight_long(i & 0xf) != 1 || i > 8)
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value
2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:57 ` Alan Stern
2025-12-23 7:56 ` Greg Kroah-Hartman
1 sibling, 0 replies; 47+ messages in thread
From: Alan Stern @ 2025-12-22 20:57 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Greg Kroah-Hartman,
linux-usb
On Mon, Dec 22, 2025 at 08:52:33PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> To allow the return type of pm_runtime_put() to be changed to void in the
> future, modify usb_autopm_put_interface_async() to discard the return
> value of pm_runtime_put().
>
> That value is merely used in a debug comment printed by the function in
> question and it is not a particularly useful piece of information
> because pm_runtime_put() does not guarantee that the device will be
> suspended even if it successfully queues up a work item to check
> whether or not the device can be suspended.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/usb/core/driver.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> --- a/drivers/usb/core/driver.c
> +++ b/drivers/usb/core/driver.c
> @@ -1810,13 +1810,11 @@ EXPORT_SYMBOL_GPL(usb_autopm_put_interfa
> void usb_autopm_put_interface_async(struct usb_interface *intf)
> {
> struct usb_device *udev = interface_to_usbdev(intf);
> - int status;
>
> usb_mark_last_busy(udev);
> - status = pm_runtime_put(&intf->dev);
> - dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
> - __func__, atomic_read(&intf->dev.power.usage_count),
> - status);
> + pm_runtime_put(&intf->dev);
> + dev_vdbg(&intf->dev, "%s: cnt %d\n",
> + __func__, atomic_read(&intf->dev.power.usage_count));
> }
> EXPORT_SYMBOL_GPL(usb_autopm_put_interface_async);
>
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value
2025-12-22 20:27 ` [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-23 3:56 ` Tzung-Bi Shih
0 siblings, 0 replies; 47+ messages in thread
From: Tzung-Bi Shih @ 2025-12-23 3:56 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Dan Callaghan,
Sami Kyöstilä, Benson Leung, chrome-platform
On Mon, Dec 22, 2025 at 09:27:44PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Passing pm_runtime_put() return value to the callers is not particularly
> useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel is
> configured with CONFIG_PM unset.
>
> Accordingly, update hps_release() to simply discard the return value of
> pm_runtime_put() and always return success to the caller.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value
2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:57 ` Alan Stern
@ 2025-12-23 7:56 ` Greg Kroah-Hartman
1 sibling, 0 replies; 47+ messages in thread
From: Greg Kroah-Hartman @ 2025-12-23 7:56 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, linux-usb, Alan Stern
On Mon, Dec 22, 2025 at 08:52:33PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> To allow the return type of pm_runtime_put() to be changed to void in the
> future, modify usb_autopm_put_interface_async() to discard the return
> value of pm_runtime_put().
>
> That value is merely used in a debug comment printed by the function in
> question and it is not a particularly useful piece of information
> because pm_runtime_put() does not guarantee that the device will be
> suspended even if it successfully queues up a work item to check
> whether or not the device can be suspended.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 11/23] net: cadence: macb: Discard pm_runtime_put() return value
2025-12-22 20:14 ` [PATCH v1 11/23] net: cadence: macb: " Rafael J. Wysocki
@ 2025-12-23 8:48 ` Nicolas Ferre
0 siblings, 0 replies; 47+ messages in thread
From: Nicolas Ferre @ 2025-12-23 8:48 UTC (permalink / raw)
To: Rafael J. Wysocki, Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
On 22/12/2025 at 21:14, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Passing pm_runtime_put() return value to the callers is not particularly
> useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel is
> configured with CONFIG_PM unset.
>
> Accordingly, update at91ether_close() to simply discard the return
> value of pm_runtime_put() and always return success to the caller.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Ok to take whichever route you choose, with a preference in staying with
the other patches of the batch.
Thanks, regards,
Nicolas
> ---
> drivers/net/ethernet/cadence/macb_main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4837,7 +4837,9 @@ static int at91ether_close(struct net_de
>
> at91ether_stop(lp);
>
> - return pm_runtime_put(&lp->pdev->dev);
> + pm_runtime_put(&lp->pdev->dev);
> +
> + return 0;
> }
>
> /* Transmit packet */
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 17/23] coresight: Discard pm_runtime_put() return values
2025-12-22 20:25 ` [PATCH v1 17/23] coresight: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-23 9:53 ` Suzuki K Poulose
0 siblings, 0 replies; 47+ messages in thread
From: Suzuki K Poulose @ 2025-12-23 9:53 UTC (permalink / raw)
To: Rafael J. Wysocki, Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Mike Leach, Alexander Shishkin
On 22/12/2025 20:25, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Failing a debugfs write due to pm_runtime_put() returning a negative
> value is not particularly useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel
> has been configured with CONFIG_PM unset, in which case
> debug_disable_func() in the coresight driver will always return an
> error.
>
> For this reason, update debug_disable_func() to simply discard the
> return value of pm_runtime_put(), change its return type to void, and
> propagate that change to debug_func_knob_write().
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
Happy for you to pick it with your series.
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>
> ---
> drivers/hwtracing/coresight/coresight-cpu-debug.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c
> +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c
> @@ -451,10 +451,10 @@ err:
> return ret;
> }
>
> -static int debug_disable_func(void)
> +static void debug_disable_func(void)
> {
> struct debug_drvdata *drvdata;
> - int cpu, ret, err = 0;
> + int cpu;
>
> /*
> * Disable debug power domains, records the error and keep
> @@ -466,12 +466,8 @@ static int debug_disable_func(void)
> if (!drvdata)
> continue;
>
> - ret = pm_runtime_put(drvdata->dev);
> - if (ret < 0)
> - err = ret;
> + pm_runtime_put(drvdata->dev);
> }
> -
> - return err;
> }
>
> static ssize_t debug_func_knob_write(struct file *f,
> @@ -492,7 +488,7 @@ static ssize_t debug_func_knob_write(str
> if (val)
> ret = debug_enable_func();
> else
> - ret = debug_disable_func();
> + debug_disable_func();
>
> if (ret) {
> pr_err("%s: unable to %s debug function: %d\n",
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 03/23] drm: Discard pm_runtime_put() return value
2025-12-22 19:57 ` [PATCH v1 03/23] drm: " Rafael J. Wysocki
@ 2025-12-23 10:23 ` Dave Stevenson
2025-12-23 15:57 ` Liviu Dudau
1 sibling, 0 replies; 47+ messages in thread
From: Dave Stevenson @ 2025-12-23 10:23 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Liviu Dudau,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Liu Ying, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Shawn Guo, Sascha Hauer, Fabio Estevam, Maíra Canal,
Raspberry Pi Kernel Maintenance, dri-devel
On Mon, 22 Dec 2025 at 20:38, Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Multiple DRM drivers use the pm_runtime_put() return value for printing
> debug or even error messages and all of those messages are at least
> somewhat misleading.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel
> has been configured with CONFIG_PM unset.
>
> For this reason, modify all of those drivers to simply discard the
> pm_runtime_put() return value which is what they should be doing.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/gpu/drm/arm/malidp_crtc.c | 6 +-----
> drivers/gpu/drm/bridge/imx/imx8qm-ldb.c | 4 +---
> drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 4 +---
> drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 5 +----
> drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 5 +----
> drivers/gpu/drm/imx/dc/dc-crtc.c | 12 +++---------
> drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +----
> drivers/gpu/drm/vc4/vc4_vec.c | 12 ++----------
For vc4_hdmi and vc4_vec:
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> 8 files changed, 11 insertions(+), 42 deletions(-)
>
> --- a/drivers/gpu/drm/arm/malidp_crtc.c
> +++ b/drivers/gpu/drm/arm/malidp_crtc.c
> @@ -77,7 +77,6 @@ static void malidp_crtc_atomic_disable(s
> crtc);
> struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
> struct malidp_hw_device *hwdev = malidp->dev;
> - int err;
>
> /* always disable planes on the CRTC that is being turned off */
> drm_atomic_helper_disable_planes_on_crtc(old_state, false);
> @@ -87,10 +86,7 @@ static void malidp_crtc_atomic_disable(s
>
> clk_disable_unprepare(hwdev->pxlclk);
>
> - err = pm_runtime_put(crtc->dev->dev);
> - if (err < 0) {
> - DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err);
> - }
> + pm_runtime_put(crtc->dev->dev);
> }
>
> static const struct gamma_curve_segment {
> --- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> @@ -280,9 +280,7 @@ static void imx8qm_ldb_bridge_atomic_dis
> clk_disable_unprepare(imx8qm_ldb->clk_bypass);
> clk_disable_unprepare(imx8qm_ldb->clk_pixel);
>
> - ret = pm_runtime_put(dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(dev);
> }
>
> static const u32 imx8qm_ldb_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> @@ -282,9 +282,7 @@ static void imx8qxp_ldb_bridge_atomic_di
> if (is_split && companion)
> companion->funcs->atomic_disable(companion, state);
>
> - ret = pm_runtime_put(dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(dev);
> }
>
> static const u32 imx8qxp_ldb_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
> @@ -181,11 +181,8 @@ static void imx8qxp_pc_bridge_atomic_dis
> {
> struct imx8qxp_pc_channel *ch = bridge->driver_private;
> struct imx8qxp_pc *pc = ch->pc;
> - int ret;
>
> - ret = pm_runtime_put(pc->dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(pc->dev);
> }
>
> static const u32 imx8qxp_pc_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
> @@ -127,11 +127,8 @@ static void imx8qxp_pxl2dpi_bridge_atomi
> struct drm_atomic_state *state)
> {
> struct imx8qxp_pxl2dpi *p2d = bridge->driver_private;
> - int ret;
>
> - ret = pm_runtime_put(p2d->dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(p2d->dev);
>
> if (p2d->companion)
> p2d->companion->funcs->atomic_disable(p2d->companion, state);
> --- a/drivers/gpu/drm/imx/dc/dc-crtc.c
> +++ b/drivers/gpu/drm/imx/dc/dc-crtc.c
> @@ -300,7 +300,7 @@ dc_crtc_atomic_disable(struct drm_crtc *
> drm_atomic_get_new_crtc_state(state, crtc);
> struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev);
> struct dc_crtc *dc_crtc = to_dc_crtc(crtc);
> - int idx, ret;
> + int idx;
>
> if (!drm_dev_enter(crtc->dev, &idx))
> goto out;
> @@ -313,16 +313,10 @@ dc_crtc_atomic_disable(struct drm_crtc *
> dc_fg_disable_clock(dc_crtc->fg);
>
> /* request pixel engine power-off as plane is off too */
> - ret = pm_runtime_put(dc_drm->pe->dev);
> - if (ret)
> - dc_crtc_err(crtc, "failed to put DC pixel engine RPM: %d\n",
> - ret);
> + pm_runtime_put(dc_drm->pe->dev);
>
> /* request display engine power-off when CRTC is disabled */
> - ret = pm_runtime_put(dc_crtc->de->dev);
> - if (ret < 0)
> - dc_crtc_err(crtc, "failed to put DC display engine RPM: %d\n",
> - ret);
> + pm_runtime_put(dc_crtc->de->dev);
>
> drm_dev_exit(idx);
>
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -848,7 +848,6 @@ static void vc4_hdmi_encoder_post_crtc_p
> struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> struct drm_device *drm = vc4_hdmi->connector.dev;
> unsigned long flags;
> - int ret;
> int idx;
>
> mutex_lock(&vc4_hdmi->mutex);
> @@ -867,9 +866,7 @@ static void vc4_hdmi_encoder_post_crtc_p
> clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
> clk_disable_unprepare(vc4_hdmi->pixel_clock);
>
> - ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
> - if (ret < 0)
> - drm_err(drm, "Failed to release power domain: %d\n", ret);
> + pm_runtime_put(&vc4_hdmi->pdev->dev);
>
> drm_dev_exit(idx);
>
> --- a/drivers/gpu/drm/vc4/vc4_vec.c
> +++ b/drivers/gpu/drm/vc4/vc4_vec.c
> @@ -542,7 +542,7 @@ static void vc4_vec_encoder_disable(stru
> {
> struct drm_device *drm = encoder->dev;
> struct vc4_vec *vec = encoder_to_vc4_vec(encoder);
> - int idx, ret;
> + int idx;
>
> if (!drm_dev_enter(drm, &idx))
> return;
> @@ -556,17 +556,9 @@ static void vc4_vec_encoder_disable(stru
>
> clk_disable_unprepare(vec->clock);
>
> - ret = pm_runtime_put(&vec->pdev->dev);
> - if (ret < 0) {
> - drm_err(drm, "Failed to release power domain: %d\n", ret);
> - goto err_dev_exit;
> - }
> + pm_runtime_put(&vec->pdev->dev);
>
> drm_dev_exit(idx);
> - return;
> -
> -err_dev_exit:
> - drm_dev_exit(idx);
> }
>
> static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (22 preceding siblings ...)
2025-12-22 20:36 ` [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void Rafael J. Wysocki
@ 2025-12-23 11:28 ` Vinod Koul
2025-12-23 17:07 ` Mark Brown
2025-12-23 17:44 ` Vinod Koul
25 siblings, 0 replies; 47+ messages in thread
From: Vinod Koul @ 2025-12-23 11:28 UTC (permalink / raw)
To: Linux PM, Rafael J. Wysocki; +Cc: LKML, Ulf Hansson, Brian Norris
On Mon, 22 Dec 2025 20:48:11 +0100, Rafael J. Wysocki wrote:
> This is something I have had on my todo list for some time, but it is
> kind of tricky because the return value of pm_runtime_put() is used in
> some places all over the tree.
>
> Nevertheless, I think that it is worth doing because the majority of
> users of the pm_runtime_put() return value are at least somewhat
> questionable (in fact, IMV the only legitimate use of it is in the
> USB core where it is included in a debug message).
>
> [...]
Applied, thanks!
[21/23] dmaengine: sh: Discard pm_runtime_put() return value
commit: b442377c0ea2044a8f50ffa3fe59448f9ed922c9
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value
2025-12-22 20:29 ` [PATCH v1 19/23] pmdomain: imx: gpcv2: " Rafael J. Wysocki
@ 2025-12-23 13:02 ` Peng Fan
2025-12-28 15:51 ` Ulf Hansson
1 sibling, 0 replies; 47+ messages in thread
From: Peng Fan @ 2025-12-23 13:02 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Shawn Guo,
Sascha Hauer, Fabio Estevam, imx
On Mon, Dec 22, 2025 at 09:29:41PM +0100, Rafael J. Wysocki wrote:
>From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
>Passing pm_runtime_put() return value to the callers is not particularly
>useful.
>
>Returning an error code from pm_runtime_put() merely means that it has
>not queued up a work item to check whether or not the device can be
>suspended and there are many perfectly valid situations in which that
>can happen, like after writing "on" to the devices' runtime PM "control"
>attribute in sysfs for one example.
>
>Accordingly, update imx_pgc_domain_suspend() to simply discard the
>return value of pm_runtime_put() and always return success to the
>caller.
>
>This will facilitate a planned change of the pm_runtime_put() return
>type to void in the future.
>
>Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 20/23] scsi: ufs: core: Discard pm_runtime_put() return values
2025-12-22 20:31 ` [PATCH v1 20/23] scsi: ufs: core: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-23 15:29 ` Bart Van Assche
0 siblings, 0 replies; 47+ messages in thread
From: Bart Van Assche @ 2025-12-23 15:29 UTC (permalink / raw)
To: Rafael J. Wysocki, Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Alim Akhtar, Avri Altman,
James E.J. Bottomley, Martin K. Petersen, linux-scsi
On 12/22/25 9:31 PM, Rafael J. Wysocki wrote:>
> The ufshcd driver defines ufshcd_rpm_put() to return an int, but that
> return value is never used. It also passes the return value of
> pm_runtime_put() to the caller which is not very useful.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 03/23] drm: Discard pm_runtime_put() return value
2025-12-22 19:57 ` [PATCH v1 03/23] drm: " Rafael J. Wysocki
2025-12-23 10:23 ` Dave Stevenson
@ 2025-12-23 15:57 ` Liviu Dudau
1 sibling, 0 replies; 47+ messages in thread
From: Liviu Dudau @ 2025-12-23 15:57 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Liu Ying, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Shawn Guo,
Sascha Hauer, Fabio Estevam, Dave Stevenson, Maíra Canal,
Raspberry Pi Kernel Maintenance, dri-devel
On Mon, Dec 22, 2025 at 08:57:35PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Multiple DRM drivers use the pm_runtime_put() return value for printing
> debug or even error messages and all of those messages are at least
> somewhat misleading.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel
> has been configured with CONFIG_PM unset.
>
> For this reason, modify all of those drivers to simply discard the
> pm_runtime_put() return value which is what they should be doing.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/gpu/drm/arm/malidp_crtc.c | 6 +-----
For the malidp_crtc.c:
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> drivers/gpu/drm/bridge/imx/imx8qm-ldb.c | 4 +---
> drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 4 +---
> drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 5 +----
> drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 5 +----
> drivers/gpu/drm/imx/dc/dc-crtc.c | 12 +++---------
> drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +----
> drivers/gpu/drm/vc4/vc4_vec.c | 12 ++----------
> 8 files changed, 11 insertions(+), 42 deletions(-)
>
> --- a/drivers/gpu/drm/arm/malidp_crtc.c
> +++ b/drivers/gpu/drm/arm/malidp_crtc.c
> @@ -77,7 +77,6 @@ static void malidp_crtc_atomic_disable(s
> crtc);
> struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
> struct malidp_hw_device *hwdev = malidp->dev;
> - int err;
>
> /* always disable planes on the CRTC that is being turned off */
> drm_atomic_helper_disable_planes_on_crtc(old_state, false);
> @@ -87,10 +86,7 @@ static void malidp_crtc_atomic_disable(s
>
> clk_disable_unprepare(hwdev->pxlclk);
>
> - err = pm_runtime_put(crtc->dev->dev);
> - if (err < 0) {
> - DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err);
> - }
> + pm_runtime_put(crtc->dev->dev);
> }
>
> static const struct gamma_curve_segment {
> --- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> @@ -280,9 +280,7 @@ static void imx8qm_ldb_bridge_atomic_dis
> clk_disable_unprepare(imx8qm_ldb->clk_bypass);
> clk_disable_unprepare(imx8qm_ldb->clk_pixel);
>
> - ret = pm_runtime_put(dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(dev);
> }
>
> static const u32 imx8qm_ldb_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> @@ -282,9 +282,7 @@ static void imx8qxp_ldb_bridge_atomic_di
> if (is_split && companion)
> companion->funcs->atomic_disable(companion, state);
>
> - ret = pm_runtime_put(dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(dev);
> }
>
> static const u32 imx8qxp_ldb_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
> @@ -181,11 +181,8 @@ static void imx8qxp_pc_bridge_atomic_dis
> {
> struct imx8qxp_pc_channel *ch = bridge->driver_private;
> struct imx8qxp_pc *pc = ch->pc;
> - int ret;
>
> - ret = pm_runtime_put(pc->dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(pc->dev);
> }
>
> static const u32 imx8qxp_pc_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
> @@ -127,11 +127,8 @@ static void imx8qxp_pxl2dpi_bridge_atomi
> struct drm_atomic_state *state)
> {
> struct imx8qxp_pxl2dpi *p2d = bridge->driver_private;
> - int ret;
>
> - ret = pm_runtime_put(p2d->dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(p2d->dev);
>
> if (p2d->companion)
> p2d->companion->funcs->atomic_disable(p2d->companion, state);
> --- a/drivers/gpu/drm/imx/dc/dc-crtc.c
> +++ b/drivers/gpu/drm/imx/dc/dc-crtc.c
> @@ -300,7 +300,7 @@ dc_crtc_atomic_disable(struct drm_crtc *
> drm_atomic_get_new_crtc_state(state, crtc);
> struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev);
> struct dc_crtc *dc_crtc = to_dc_crtc(crtc);
> - int idx, ret;
> + int idx;
>
> if (!drm_dev_enter(crtc->dev, &idx))
> goto out;
> @@ -313,16 +313,10 @@ dc_crtc_atomic_disable(struct drm_crtc *
> dc_fg_disable_clock(dc_crtc->fg);
>
> /* request pixel engine power-off as plane is off too */
> - ret = pm_runtime_put(dc_drm->pe->dev);
> - if (ret)
> - dc_crtc_err(crtc, "failed to put DC pixel engine RPM: %d\n",
> - ret);
> + pm_runtime_put(dc_drm->pe->dev);
>
> /* request display engine power-off when CRTC is disabled */
> - ret = pm_runtime_put(dc_crtc->de->dev);
> - if (ret < 0)
> - dc_crtc_err(crtc, "failed to put DC display engine RPM: %d\n",
> - ret);
> + pm_runtime_put(dc_crtc->de->dev);
>
> drm_dev_exit(idx);
>
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -848,7 +848,6 @@ static void vc4_hdmi_encoder_post_crtc_p
> struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> struct drm_device *drm = vc4_hdmi->connector.dev;
> unsigned long flags;
> - int ret;
> int idx;
>
> mutex_lock(&vc4_hdmi->mutex);
> @@ -867,9 +866,7 @@ static void vc4_hdmi_encoder_post_crtc_p
> clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
> clk_disable_unprepare(vc4_hdmi->pixel_clock);
>
> - ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
> - if (ret < 0)
> - drm_err(drm, "Failed to release power domain: %d\n", ret);
> + pm_runtime_put(&vc4_hdmi->pdev->dev);
>
> drm_dev_exit(idx);
>
> --- a/drivers/gpu/drm/vc4/vc4_vec.c
> +++ b/drivers/gpu/drm/vc4/vc4_vec.c
> @@ -542,7 +542,7 @@ static void vc4_vec_encoder_disable(stru
> {
> struct drm_device *drm = encoder->dev;
> struct vc4_vec *vec = encoder_to_vc4_vec(encoder);
> - int idx, ret;
> + int idx;
>
> if (!drm_dev_enter(drm, &idx))
> return;
> @@ -556,17 +556,9 @@ static void vc4_vec_encoder_disable(stru
>
> clk_disable_unprepare(vec->clock);
>
> - ret = pm_runtime_put(&vec->pdev->dev);
> - if (ret < 0) {
> - drm_err(drm, "Failed to release power domain: %d\n", ret);
> - goto err_dev_exit;
> - }
> + pm_runtime_put(&vec->pdev->dev);
>
> drm_dev_exit(idx);
> - return;
> -
> -err_dev_exit:
> - drm_dev_exit(idx);
> }
>
> static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: " Rafael J. Wysocki
@ 2025-12-23 16:30 ` Laurent Pinchart
0 siblings, 0 replies; 47+ messages in thread
From: Laurent Pinchart @ 2025-12-23 16:30 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Dafna Hirschfeld,
Mauro Carvalho Chehab, Heiko Stuebner, linux-media,
linux-rockchip
Hi Rafael,
Thank you for the patch.
On Mon, Dec 22, 2025 at 09:01:55PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Printing error messages on pm_runtime_put() returning negative values
> is not particularly useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example.
>
> Accordingly, update rkisp1_vb2_stop_streaming() to simply discard the
> return value of pm_runtime_put().
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
I've applied the patch to my tree for v6.20.
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> @@ -1123,7 +1123,6 @@ static void rkisp1_vb2_stop_streaming(st
> struct rkisp1_capture *cap = queue->drv_priv;
> struct rkisp1_vdev_node *node = &cap->vnode;
> struct rkisp1_device *rkisp1 = cap->rkisp1;
> - int ret;
>
> mutex_lock(&cap->rkisp1->stream_lock);
>
> @@ -1132,9 +1131,7 @@ static void rkisp1_vb2_stop_streaming(st
> rkisp1_return_all_buffers(cap, VB2_BUF_STATE_ERROR);
>
> v4l2_pipeline_pm_put(&node->vdev.entity);
> - ret = pm_runtime_put(rkisp1->dev);
> - if (ret < 0)
> - dev_err(rkisp1->dev, "power down failed error:%d\n", ret);
> + pm_runtime_put(rkisp1->dev);
>
> rkisp1_dummy_buf_destroy(cap);
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (23 preceding siblings ...)
2025-12-23 11:28 ` (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Vinod Koul
@ 2025-12-23 17:07 ` Mark Brown
2025-12-23 17:44 ` Vinod Koul
25 siblings, 0 replies; 47+ messages in thread
From: Mark Brown @ 2025-12-23 17:07 UTC (permalink / raw)
To: Linux PM, Rafael J. Wysocki; +Cc: LKML, Ulf Hansson, Brian Norris
On Mon, 22 Dec 2025 20:48:11 +0100, Rafael J. Wysocki wrote:
> This is something I have had on my todo list for some time, but it is
> kind of tricky because the return value of pm_runtime_put() is used in
> some places all over the tree.
>
> Nevertheless, I think that it is worth doing because the majority of
> users of the pm_runtime_put() return value are at least somewhat
> questionable (in fact, IMV the only legitimate use of it is in the
> USB core where it is included in a debug message).
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[22/23] ASoC: rockchip: Discard pm_runtime_put() return value
commit: f92d27a6ee158c43e276712af23c79997780471a
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
` (24 preceding siblings ...)
2025-12-23 17:07 ` Mark Brown
@ 2025-12-23 17:44 ` Vinod Koul
25 siblings, 0 replies; 47+ messages in thread
From: Vinod Koul @ 2025-12-23 17:44 UTC (permalink / raw)
To: Linux PM, Rafael J. Wysocki; +Cc: LKML, Ulf Hansson, Brian Norris
On Mon, 22 Dec 2025 20:48:11 +0100, Rafael J. Wysocki wrote:
> This is something I have had on my todo list for some time, but it is
> kind of tricky because the return value of pm_runtime_put() is used in
> some places all over the tree.
>
> Nevertheless, I think that it is worth doing because the majority of
> users of the pm_runtime_put() return value are at least somewhat
> questionable (in fact, IMV the only legitimate use of it is in the
> USB core where it is included in a debug message).
>
> [...]
Applied, thanks!
[13/23] phy: freescale: Discard pm_runtime_put() return value
commit: 8bb108e4f6747dcea590710c4b6f95eebf4a04d6
[14/23] phy: rockchip-samsung-dcphy: Discard pm_runtime_put() return value
commit: 455bf7d9256495e09fd3fd4a4e8a41e727f1043b
[15/23] phy: core: Discard pm_runtime_put() return values
commit: caad07ae07e3fb173e804abdd53fb96aa7186830
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value
2025-12-22 20:29 ` [PATCH v1 19/23] pmdomain: imx: gpcv2: " Rafael J. Wysocki
2025-12-23 13:02 ` Peng Fan
@ 2025-12-28 15:51 ` Ulf Hansson
1 sibling, 0 replies; 47+ messages in thread
From: Ulf Hansson @ 2025-12-28 15:51 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Brian Norris, Shawn Guo, Sascha Hauer,
Fabio Estevam, imx
On Mon, 22 Dec 2025 at 21:37, Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Passing pm_runtime_put() return value to the callers is not particularly
> useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example.
>
> Accordingly, update imx_pgc_domain_suspend() to simply discard the
> return value of pm_runtime_put() and always return success to the
> caller.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/pmdomain/imx/gpcv2.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/pmdomain/imx/gpcv2.c
> +++ b/drivers/pmdomain/imx/gpcv2.c
> @@ -1420,7 +1420,9 @@ static int imx_pgc_domain_suspend(struct
>
> static int imx_pgc_domain_resume(struct device *dev)
> {
> - return pm_runtime_put(dev);
> + pm_runtime_put(dev);
> +
> + return 0;
> }
> #endif
>
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void
2025-12-22 20:36 ` [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void Rafael J. Wysocki
@ 2025-12-28 15:51 ` Ulf Hansson
0 siblings, 0 replies; 47+ messages in thread
From: Ulf Hansson @ 2025-12-28 15:51 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux PM, LKML, Brian Norris
On Mon, 22 Dec 2025 at 21:37, Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The primary role of pm_runtime_put() is to decrement the runtime PM
> usage counter of the given device. It always does that regardless of
> the value returned by it later.
>
> In addition, if the runtime PM usage counter after decrementation turns
> out to be zero, a work item is queued up to check whether or not the
> device can be suspended. This is not guaranteed to succeed though and
> even if it is successful, the device may still not be suspended going
> forward.
>
> There are multiple valid reasons why pm_runtime_put() may not decide to
> queue up the work item mentioned above, including, but not limited to,
> the case when user space has written "on" to the device's runtime PM
> "control" file in sysfs. In all of those cases, pm_runtime_put()
> returns a negative error code (even though the device's runtime PM
> usage counter has been successfully decremented by it) which is very
> confusing. In fact, its return value should only be used for debug
> purposes and care should be taken when doing it even in that case.
>
> Accordingly, to avoid the confusion mentioned above, change the return
> type of pm_runtime_put() to void.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Nice cleanup!
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
> ---
> include/linux/pm_runtime.h | 16 ++--------------
> 1 file changed, 2 insertions(+), 14 deletions(-)
>
> --- a/include/linux/pm_runtime.h
> +++ b/include/linux/pm_runtime.h
> @@ -545,22 +545,10 @@ static inline int pm_runtime_resume_and_
> *
> * Decrement the runtime PM usage counter of @dev and if it turns out to be
> * equal to 0, queue up a work item for @dev like in pm_request_idle().
> - *
> - * Return:
> - * * 1: Success. Usage counter dropped to zero, but device was already suspended.
> - * * 0: Success.
> - * * -EINVAL: Runtime PM error.
> - * * -EACCES: Runtime PM disabled.
> - * * -EAGAIN: Runtime PM usage counter became non-zero or Runtime PM status
> - * change ongoing.
> - * * -EBUSY: Runtime PM child_count non-zero.
> - * * -EPERM: Device PM QoS resume latency 0.
> - * * -EINPROGRESS: Suspend already in progress.
> - * * -ENOSYS: CONFIG_PM not enabled.
> */
> -static inline int pm_runtime_put(struct device *dev)
> +static inline void pm_runtime_put(struct device *dev)
> {
> - return __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
> + __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
> }
>
> /**
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 08/23] watchdog: rz: Discard pm_runtime_put() return values
2025-12-22 20:07 ` [PATCH v1 08/23] watchdog: rz: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-28 19:14 ` Guenter Roeck
0 siblings, 0 replies; 47+ messages in thread
From: Guenter Roeck @ 2025-12-28 19:14 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Wim Van Sebroeck,
linux-watchdog
On Mon, Dec 22, 2025 at 09:07:46PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Failing a watchdog stop due to pm_runtime_put() returning a negative
> value is not particularly useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel is
> configured with CONFIG_PM unset.
>
> Accordingly, update rzg2l_wdt_stop() and rzv2h_wdt_stop() to simply
> discard the return value of pm_runtime_put().
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/watchdog/rzg2l_wdt.c | 4 +---
> drivers/watchdog/rzv2h_wdt.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> --- a/drivers/watchdog/rzg2l_wdt.c
> +++ b/drivers/watchdog/rzg2l_wdt.c
> @@ -132,9 +132,7 @@ static int rzg2l_wdt_stop(struct watchdo
> if (ret)
> return ret;
>
> - ret = pm_runtime_put(wdev->parent);
> - if (ret < 0)
> - return ret;
> + pm_runtime_put(wdev->parent);
>
> return 0;
> }
> --- a/drivers/watchdog/rzv2h_wdt.c
> +++ b/drivers/watchdog/rzv2h_wdt.c
> @@ -174,9 +174,7 @@ static int rzv2h_wdt_stop(struct watchdo
> if (priv->of_data->wdtdcr)
> rzt2h_wdt_wdtdcr_count_stop(priv);
>
> - ret = pm_runtime_put(wdev->parent);
> - if (ret < 0)
> - return ret;
> + pm_runtime_put(wdev->parent);
>
> return 0;
> }
>
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 09/23] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value
2025-12-22 20:09 ` [PATCH v1 09/23] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-28 19:15 ` Guenter Roeck
0 siblings, 0 replies; 47+ messages in thread
From: Guenter Roeck @ 2025-12-28 19:15 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Wim Van Sebroeck,
linux-watchdog
On Mon, Dec 22, 2025 at 09:09:22PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Failing device probe due to pm_runtime_put() returning an error is not
> particularly useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel is
> configured with CONFIG_PM unset.
>
> Accordingly, update rzt2h_wdt_wdtdcr_init() to simply discard the return
> value of pm_runtime_put() and return success to the caller after
> invoking that function.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values
2025-12-22 20:22 ` [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values Rafael J. Wysocki
@ 2025-12-30 10:34 ` Geert Uytterhoeven
2025-12-30 10:54 ` Geert Uytterhoeven
0 siblings, 1 reply; 47+ messages in thread
From: Geert Uytterhoeven @ 2025-12-30 10:34 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Vinod Koul,
Neil Armstrong, linux-phy, Linux-Renesas
Hi Rafael,
On Mon, 22 Dec 2025 at 21:40, Rafael J. Wysocki <rafael@kernel.org> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The PHY core defines phy_pm_runtime_put() to return an int, but that
> return value is never used. It also passes the return value of
> pm_runtime_put() to the caller which is not very useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example.
>
> Modify phy_pm_runtime_put() to discard the pm_runtime_put() return
> value and change its return type to void. Also drop the redundant
> pm_runtime_enabled() call from there.
>
> No intentional functional impact.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Thanks for your patch, which is now commit caad07ae07e3fb17 ("phy:
core: Discard pm_runtime_put() return values") in phy/next.
This is causing several messages like
phy phy-e6590100.usb-phy-controller.2: Runtime PM usage count underflow!
during boot, and s2ram on Koelsch (R-Car M2-W).
Reverting this commit fixes the issue.
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
> }
> EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);
>
> -int phy_pm_runtime_put(struct phy *phy)
> +void phy_pm_runtime_put(struct phy *phy)
> {
> if (!phy)
> - return 0;
> + return;
>
> - if (!pm_runtime_enabled(&phy->dev))
> - return -ENOTSUPP;
Adding some instrumentation shows that this branch was taken before,
thus skipping the call to pm_runtime_put().
Can I just put the check back, or is there an underlying problem that
should be fixed instead?
Thanks!
> -
> - return pm_runtime_put(&phy->dev);
> + pm_runtime_put(&phy->dev);
> }
> EXPORT_SYMBOL_GPL(phy_pm_runtime_put);
>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values
2025-12-30 10:34 ` Geert Uytterhoeven
@ 2025-12-30 10:54 ` Geert Uytterhoeven
2025-12-30 15:05 ` Geert Uytterhoeven
2025-12-30 16:17 ` Rafael J. Wysocki
0 siblings, 2 replies; 47+ messages in thread
From: Geert Uytterhoeven @ 2025-12-30 10:54 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Vinod Koul,
Neil Armstrong, linux-phy, Linux-Renesas
On Tue, 30 Dec 2025 at 11:34, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Mon, 22 Dec 2025 at 21:40, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > The PHY core defines phy_pm_runtime_put() to return an int, but that
> > return value is never used. It also passes the return value of
> > pm_runtime_put() to the caller which is not very useful.
> >
> > Returning an error code from pm_runtime_put() merely means that it has
> > not queued up a work item to check whether or not the device can be
> > suspended and there are many perfectly valid situations in which that
> > can happen, like after writing "on" to the devices' runtime PM "control"
> > attribute in sysfs for one example.
> >
> > Modify phy_pm_runtime_put() to discard the pm_runtime_put() return
> > value and change its return type to void. Also drop the redundant
> > pm_runtime_enabled() call from there.
> >
> > No intentional functional impact.
> >
> > This will facilitate a planned change of the pm_runtime_put() return
> > type to void in the future.
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Thanks for your patch, which is now commit caad07ae07e3fb17 ("phy:
> core: Discard pm_runtime_put() return values") in phy/next.
>
> This is causing several messages like
>
> phy phy-e6590100.usb-phy-controller.2: Runtime PM usage count underflow!
>
> during boot, and s2ram on Koelsch (R-Car M2-W).
On R-Car Gen3, there are no such messages, as e.g.
drivers/phy/renesas/phy-rcar-gen3-usb2.c does support Runtime PM.
R-Car Gen2 uses drivers/phy/renesas/phy-rcar-gen2.c, which does not
use Runtime PM yet, but still relies on explicit clock management.
> > --- a/drivers/phy/phy-core.c
> > +++ b/drivers/phy/phy-core.c
> > @@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
> > }
> > EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);
> >
> > -int phy_pm_runtime_put(struct phy *phy)
> > +void phy_pm_runtime_put(struct phy *phy)
> > {
> > if (!phy)
> > - return 0;
> > + return;
> >
> > - if (!pm_runtime_enabled(&phy->dev))
> > - return -ENOTSUPP;
>
> Adding some instrumentation shows that this branch was taken before,
> thus skipping the call to pm_runtime_put().
>
> Can I just put the check back, or is there an underlying problem that
> should be fixed instead?
I assume the PHY core should support both drivers that do and do not
support Runtime PM.
> Thanks!
>
> > -
> > - return pm_runtime_put(&phy->dev);
> > + pm_runtime_put(&phy->dev);
> > }
> > EXPORT_SYMBOL_GPL(phy_pm_runtime_put);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values
2025-12-30 10:54 ` Geert Uytterhoeven
@ 2025-12-30 15:05 ` Geert Uytterhoeven
2025-12-30 16:18 ` Rafael J. Wysocki
2025-12-30 16:17 ` Rafael J. Wysocki
1 sibling, 1 reply; 47+ messages in thread
From: Geert Uytterhoeven @ 2025-12-30 15:05 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Vinod Koul,
Neil Armstrong, linux-phy, Linux-Renesas
On Tue, 30 Dec 2025 at 11:54, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Tue, 30 Dec 2025 at 11:34, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Mon, 22 Dec 2025 at 21:40, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > >
> > > The PHY core defines phy_pm_runtime_put() to return an int, but that
> > > return value is never used. It also passes the return value of
> > > pm_runtime_put() to the caller which is not very useful.
> > >
> > > Returning an error code from pm_runtime_put() merely means that it has
> > > not queued up a work item to check whether or not the device can be
> > > suspended and there are many perfectly valid situations in which that
> > > can happen, like after writing "on" to the devices' runtime PM "control"
> > > attribute in sysfs for one example.
> > >
> > > Modify phy_pm_runtime_put() to discard the pm_runtime_put() return
> > > value and change its return type to void. Also drop the redundant
> > > pm_runtime_enabled() call from there.
> > >
> > > No intentional functional impact.
> > >
> > > This will facilitate a planned change of the pm_runtime_put() return
> > > type to void in the future.
> > >
> > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > Thanks for your patch, which is now commit caad07ae07e3fb17 ("phy:
> > core: Discard pm_runtime_put() return values") in phy/next.
> >
> > This is causing several messages like
> >
> > phy phy-e6590100.usb-phy-controller.2: Runtime PM usage count underflow!
> >
> > during boot, and s2ram on Koelsch (R-Car M2-W).
>
> On R-Car Gen3, there are no such messages, as e.g.
> drivers/phy/renesas/phy-rcar-gen3-usb2.c does support Runtime PM.
> R-Car Gen2 uses drivers/phy/renesas/phy-rcar-gen2.c, which does not
> use Runtime PM yet, but still relies on explicit clock management.
>
> > > --- a/drivers/phy/phy-core.c
> > > +++ b/drivers/phy/phy-core.c
> > > @@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
> > > }
> > > EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);
> > >
> > > -int phy_pm_runtime_put(struct phy *phy)
> > > +void phy_pm_runtime_put(struct phy *phy)
> > > {
> > > if (!phy)
> > > - return 0;
> > > + return;
> > >
> > > - if (!pm_runtime_enabled(&phy->dev))
> > > - return -ENOTSUPP;
> >
> > Adding some instrumentation shows that this branch was taken before,
> > thus skipping the call to pm_runtime_put().
> >
> > Can I just put the check back, or is there an underlying problem that
> > should be fixed instead?
>
> I assume the PHY core should support both drivers that do and do not
> support Runtime PM.
I have sent a patch:
https://lore.kernel.org/3ca9f8166d21685bfbf97535da30172f74822130.1767107014.git.geert+renesas@glider.be
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values
2025-12-30 10:54 ` Geert Uytterhoeven
2025-12-30 15:05 ` Geert Uytterhoeven
@ 2025-12-30 16:17 ` Rafael J. Wysocki
1 sibling, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-30 16:17 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Rafael J. Wysocki, Linux PM, LKML, Ulf Hansson, Brian Norris,
Vinod Koul, Neil Armstrong, linux-phy, Linux-Renesas
On Tue, Dec 30, 2025 at 11:54 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>
> On Tue, 30 Dec 2025 at 11:34, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Mon, 22 Dec 2025 at 21:40, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > >
> > > The PHY core defines phy_pm_runtime_put() to return an int, but that
> > > return value is never used. It also passes the return value of
> > > pm_runtime_put() to the caller which is not very useful.
> > >
> > > Returning an error code from pm_runtime_put() merely means that it has
> > > not queued up a work item to check whether or not the device can be
> > > suspended and there are many perfectly valid situations in which that
> > > can happen, like after writing "on" to the devices' runtime PM "control"
> > > attribute in sysfs for one example.
> > >
> > > Modify phy_pm_runtime_put() to discard the pm_runtime_put() return
> > > value and change its return type to void. Also drop the redundant
> > > pm_runtime_enabled() call from there.
> > >
> > > No intentional functional impact.
> > >
> > > This will facilitate a planned change of the pm_runtime_put() return
> > > type to void in the future.
> > >
> > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > Thanks for your patch, which is now commit caad07ae07e3fb17 ("phy:
> > core: Discard pm_runtime_put() return values") in phy/next.
> >
> > This is causing several messages like
> >
> > phy phy-e6590100.usb-phy-controller.2: Runtime PM usage count underflow!
> >
> > during boot, and s2ram on Koelsch (R-Car M2-W).
>
> On R-Car Gen3, there are no such messages, as e.g.
> drivers/phy/renesas/phy-rcar-gen3-usb2.c does support Runtime PM.
> R-Car Gen2 uses drivers/phy/renesas/phy-rcar-gen2.c, which does not
> use Runtime PM yet, but still relies on explicit clock management.
>
> > > --- a/drivers/phy/phy-core.c
> > > +++ b/drivers/phy/phy-core.c
> > > @@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
> > > }
> > > EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);
> > >
> > > -int phy_pm_runtime_put(struct phy *phy)
> > > +void phy_pm_runtime_put(struct phy *phy)
> > > {
> > > if (!phy)
> > > - return 0;
> > > + return;
> > >
> > > - if (!pm_runtime_enabled(&phy->dev))
> > > - return -ENOTSUPP;
> >
> > Adding some instrumentation shows that this branch was taken before,
> > thus skipping the call to pm_runtime_put().
> >
> > Can I just put the check back, or is there an underlying problem that
> > should be fixed instead?
Sorry for breaking this!
> I assume the PHY core should support both drivers that do and do not
> support Runtime PM.
Yes, it should be sufficient to restore the pm_runtime_enabled() check.
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values
2025-12-30 15:05 ` Geert Uytterhoeven
@ 2025-12-30 16:18 ` Rafael J. Wysocki
0 siblings, 0 replies; 47+ messages in thread
From: Rafael J. Wysocki @ 2025-12-30 16:18 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Rafael J. Wysocki, Linux PM, LKML, Ulf Hansson, Brian Norris,
Vinod Koul, Neil Armstrong, linux-phy, Linux-Renesas
On Tue, Dec 30, 2025 at 4:05 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> On Tue, 30 Dec 2025 at 11:54, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Tue, 30 Dec 2025 at 11:34, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > On Mon, 22 Dec 2025 at 21:40, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > >
> > > > The PHY core defines phy_pm_runtime_put() to return an int, but that
> > > > return value is never used. It also passes the return value of
> > > > pm_runtime_put() to the caller which is not very useful.
> > > >
> > > > Returning an error code from pm_runtime_put() merely means that it has
> > > > not queued up a work item to check whether or not the device can be
> > > > suspended and there are many perfectly valid situations in which that
> > > > can happen, like after writing "on" to the devices' runtime PM "control"
> > > > attribute in sysfs for one example.
> > > >
> > > > Modify phy_pm_runtime_put() to discard the pm_runtime_put() return
> > > > value and change its return type to void. Also drop the redundant
> > > > pm_runtime_enabled() call from there.
> > > >
> > > > No intentional functional impact.
> > > >
> > > > This will facilitate a planned change of the pm_runtime_put() return
> > > > type to void in the future.
> > > >
> > > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > >
> > > Thanks for your patch, which is now commit caad07ae07e3fb17 ("phy:
> > > core: Discard pm_runtime_put() return values") in phy/next.
> > >
> > > This is causing several messages like
> > >
> > > phy phy-e6590100.usb-phy-controller.2: Runtime PM usage count underflow!
> > >
> > > during boot, and s2ram on Koelsch (R-Car M2-W).
> >
> > On R-Car Gen3, there are no such messages, as e.g.
> > drivers/phy/renesas/phy-rcar-gen3-usb2.c does support Runtime PM.
> > R-Car Gen2 uses drivers/phy/renesas/phy-rcar-gen2.c, which does not
> > use Runtime PM yet, but still relies on explicit clock management.
> >
> > > > --- a/drivers/phy/phy-core.c
> > > > +++ b/drivers/phy/phy-core.c
> > > > @@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
> > > > }
> > > > EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);
> > > >
> > > > -int phy_pm_runtime_put(struct phy *phy)
> > > > +void phy_pm_runtime_put(struct phy *phy)
> > > > {
> > > > if (!phy)
> > > > - return 0;
> > > > + return;
> > > >
> > > > - if (!pm_runtime_enabled(&phy->dev))
> > > > - return -ENOTSUPP;
> > >
> > > Adding some instrumentation shows that this branch was taken before,
> > > thus skipping the call to pm_runtime_put().
> > >
> > > Can I just put the check back, or is there an underlying problem that
> > > should be fixed instead?
> >
> > I assume the PHY core should support both drivers that do and do not
> > support Runtime PM.
>
> I have sent a patch:
> https://lore.kernel.org/3ca9f8166d21685bfbf97535da30172f74822130.1767107014.git.geert+renesas@glider.be
LGTM
^ permalink raw reply [flat|nested] 47+ messages in thread
end of thread, other threads:[~2025-12-30 16:18 UTC | newest]
Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
2025-12-22 19:50 ` [PATCH v1 01/23] genirq/chip: Change irq_chip_pm_put() return type to void Rafael J. Wysocki
2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:57 ` Alan Stern
2025-12-23 7:56 ` Greg Kroah-Hartman
2025-12-22 19:57 ` [PATCH v1 03/23] drm: " Rafael J. Wysocki
2025-12-23 10:23 ` Dave Stevenson
2025-12-23 15:57 ` Liviu Dudau
2025-12-22 19:59 ` [PATCH v1 04/23] drm/imagination: " Rafael J. Wysocki
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: " Rafael J. Wysocki
2025-12-23 16:30 ` Laurent Pinchart
2025-12-22 20:03 ` [PATCH v1 06/23] media: ccs: " Rafael J. Wysocki
2025-12-22 20:06 ` [PATCH v1 07/23] media: mediatek: vcodec: " Rafael J. Wysocki
2025-12-22 20:07 ` [PATCH v1 08/23] watchdog: rz: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-28 19:14 ` Guenter Roeck
2025-12-22 20:09 ` [PATCH v1 09/23] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-28 19:15 ` Guenter Roeck
2025-12-22 20:11 ` [PATCH v1 10/23] net: ethernet: ti: am65-cpsw: " Rafael J. Wysocki
2025-12-22 20:14 ` [PATCH v1 11/23] net: cadence: macb: " Rafael J. Wysocki
2025-12-23 8:48 ` Nicolas Ferre
2025-12-22 20:16 ` [PATCH v1 12/23] net: wan: framer: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-22 20:18 ` [PATCH v1 13/23] phy: freescale: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:21 ` [PATCH v1 14/23] phy: rockchip-samsung-dcphy: " Rafael J. Wysocki
2025-12-22 20:22 ` [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-30 10:34 ` Geert Uytterhoeven
2025-12-30 10:54 ` Geert Uytterhoeven
2025-12-30 15:05 ` Geert Uytterhoeven
2025-12-30 16:18 ` Rafael J. Wysocki
2025-12-30 16:17 ` Rafael J. Wysocki
2025-12-22 20:24 ` [PATCH v1 16/23] hwspinlock: omap: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:46 ` Bjorn Andersson
2025-12-22 20:25 ` [PATCH v1 17/23] coresight: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-23 9:53 ` Suzuki K Poulose
2025-12-22 20:27 ` [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-23 3:56 ` Tzung-Bi Shih
2025-12-22 20:29 ` [PATCH v1 19/23] pmdomain: imx: gpcv2: " Rafael J. Wysocki
2025-12-23 13:02 ` Peng Fan
2025-12-28 15:51 ` Ulf Hansson
2025-12-22 20:31 ` [PATCH v1 20/23] scsi: ufs: core: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-23 15:29 ` Bart Van Assche
2025-12-22 20:33 ` [PATCH v1 21/23] dmaengine: sh: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:35 ` [PATCH v1 22/23] ASoC: rockchip: " Rafael J. Wysocki
2025-12-22 20:36 ` [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void Rafael J. Wysocki
2025-12-28 15:51 ` Ulf Hansson
2025-12-23 11:28 ` (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Vinod Koul
2025-12-23 17:07 ` Mark Brown
2025-12-23 17:44 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).