Skip to contentSkip to conversation

PM: runtime: Convert pm_runtime_put() to a void function

PATCH Applied Rafael J. Wysocki 24 participants 74 messages Dec 22, 2025 – Feb 23

Subsystems (39)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore

Rafael J. Wysocki

author maintainer
#0 lore raw

cover PM: runtime: Convert pm_runtime_put() to a void function

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!

author maintainer
#1 lore raw

PATCH 1/23 genirq/chip: Change irq_chip_pm_put() return type to void

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
include/linux/irq.h +1 -1
@@ -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);
kernel/irq/chip.c +11 -11
@@ -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);
 }
maintainer Reviewed-by on v1 1/23
#2 lore raw

Re: [PATCH v1 01/23] genirq/chip: Change irq_chip_pm_put() return type to void

Quoted 18 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 4 lines

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

author maintainer
#3 lore raw

PATCH 2/23 USB: core: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/usb/core/driver.c +3 -5
@@ -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);
 
Acked-by on v1 2/23
#4 lore raw

Re: [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value

Quoted 6 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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().

Quoted 8 lines

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.

---

Quoted 35 lines

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(-)
drivers/usb/core/driver.c +3 -5
@@ -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);
 
maintainer Acked-by on v1 2/23
#5 lore raw

Re: [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki
Quoted 6 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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().

Quoted 7 lines

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.

author maintainer
#6 lore raw

PATCH 3/23 drm: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/gpu/drm/arm/malidp_crtc.c +1 -5
@@ -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 {
drivers/gpu/drm/bridge/imx/imx8qm-ldb.c +1 -3
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c +1 -3
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +1 -4
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +1 -4
@@ -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);
drivers/gpu/drm/imx/dc/dc-crtc.c +3 -9
@@ -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);
 
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -4
@@ -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);
 
drivers/gpu/drm/vc4/vc4_vec.c +2 -10
@@ -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,
maintainer Acked-by on v1 3/23
#7 lore raw

Re: [PATCH v1 03/23] drm: Discard pm_runtime_put() return value

Quoted 32 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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.

Quoted 9 lines
---
 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:

Quoted 164 lines
 8 files changed, 11 insertions(+), 42 deletions(-)
drivers/gpu/drm/arm/malidp_crtc.c +1 -5
@@ -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 {
drivers/gpu/drm/bridge/imx/imx8qm-ldb.c +1 -3
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c +1 -3
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +1 -4
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +1 -4
@@ -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);
drivers/gpu/drm/imx/dc/dc-crtc.c +3 -9
@@ -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);
 
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -4
@@ -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);
 
drivers/gpu/drm/vc4/vc4_vec.c +2 -10
@@ -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,
maintainer Acked-by on v1 3/23
#8 lore raw

Re: [PATCH v1 03/23] drm: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki
Quoted 25 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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.

Quoted 8 lines

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:

Best regards,
Liviu

Quoted 171 lines
 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(-)
drivers/gpu/drm/arm/malidp_crtc.c +1 -5
@@ -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 {
drivers/gpu/drm/bridge/imx/imx8qm-ldb.c +1 -3
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c +1 -3
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +1 -4
@@ -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[] = {
drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +1 -4
@@ -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);
drivers/gpu/drm/imx/dc/dc-crtc.c +3 -9
@@ -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);
 
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -4
@@ -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);
 
drivers/gpu/drm/vc4/vc4_vec.c +2 -10
@@ -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,
author maintainer
#9 lore raw

PATCH 4/23 drm/imagination: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/gpu/drm/imagination/pvr_power.h +2 -2
@@ -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);
Reviewed-by on v1 4/23
#10 lore raw

Re: [PATCH v1 04/23] drm/imagination: Discard pm_runtime_put() return value

Quoted 9 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines

No intentional functional impact.

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Hi Rafael,

Apologies for the late reply, I was on holiday. If this hasn't already landed, feel free to add:

Cheers,
Matt

Quoted 35 lines

---

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(-)
drivers/gpu/drm/imagination/pvr_power.h +2 -2
@@ -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);
Signature · 2 lines
Matt Coster
E: [email protected]
author maintainer
#11 lore raw

PATCH 5/23 media: rkisp1: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +1 -4
@@ -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);
 
maintainer Reviewed-by on v1 5/23 Applied
#12 lore raw

Re: [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value

Hi Rafael,

Thank you for the patch.

Quoted 11 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 7 lines

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.

Quoted 7 lines

---

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.

Quoted 28 lines

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(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +1 -4
@@ -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);
 
Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer
#13 lore raw

PATCH 6/23 media: ccs: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/media/i2c/ccs/ccs-core.c +3 -1
@@ -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,
maintainer Acked-by on v1 6/23
#14 lore raw

Re: [PATCH v1 06/23] media: ccs: Discard pm_runtime_put() return value

Hi Rafael,

Quoted 21 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

Quoted 8 lines

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.

Signature · 1 line
Sakari Ailus
author maintainer
#15 lore raw

PATCH 7/23 media: mediatek: vcodec: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c +1 -5
@@ -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)
drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c +1 -5
@@ -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)
author maintainer
#16 lore raw

PATCH 8/23 watchdog: rz: Discard pm_runtime_put() return values

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/watchdog/rzg2l_wdt.c +1 -3
@@ -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;
 }
drivers/watchdog/rzv2h_wdt.c +1 -3
@@ -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;
 }
maintainer Reviewed-by on v1 8/23
#17 lore raw

Re: [PATCH v1 08/23] watchdog: rz: Discard pm_runtime_put() return values

Quoted 12 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 7 lines

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.

Quoted 45 lines

---

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(-)
drivers/watchdog/rzg2l_wdt.c +1 -3
@@ -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;
 }
drivers/watchdog/rzv2h_wdt.c +1 -3
@@ -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;
 }
author maintainer
#18 lore raw

PATCH 9/23 watchdog: rzv2h_wdt: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/watchdog/rzv2h_wdt.c +1 -3
@@ -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;
 }
maintainer Reviewed-by on v1 9/23
#19 lore raw

Re: [PATCH v1 09/23] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value

Quoted 12 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 8 lines

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.

author maintainer
#20 lore raw

PATCH 10/23 net: ethernet: ti: am65-cpsw: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +1 -4
@@ -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,
drivers/net/ethernet/ti/cpsw_ethtool.c +1 -4
@@ -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)
maintainer
#21 lore raw

Re: [PATCH v1 10/23] net: ethernet: ti: am65-cpsw: Discard pm_runtime_put() return value

Quoted 2 lines · On Mon, 22 Dec 2025 21:11:42 +0100 Rafael J. Wysocki wrote:

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.

Would you mind reposting patches 10, 11, 12 of the series as a single set? If we get CCed only on a subset of the series PW assumes the rest got eaten by email goblins and our CI doesn't process any of them.

author maintainer
#22 lore raw

Re: [PATCH v1 10/23] net: ethernet: ti: am65-cpsw: Discard pm_runtime_put() return value

Quoted 8 lines · Jakub Kicinski
Quoted 2 lines · On Mon, 22 Dec 2025 21:11:42 +0100 Rafael J. Wysocki wrote:

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.

Would you mind reposting patches 10, 11, 12 of the series as a single set? If we get CCed only on a subset of the series PW assumes the rest got eaten by email goblins and our CI doesn't process any of them.

Done:

https://lore.kernel.org/linux-pm/[email protected]/

and I've fixed the last patch while doing it.

Thanks!

author maintainer
#23 lore raw

PATCH 11/23 net: cadence: macb: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/net/ethernet/cadence/macb_main.c +3 -1
@@ -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 */
Acked-by on v1 11/23
#24 lore raw

Re: [PATCH v1 11/23] net: cadence: macb: Discard pm_runtime_put() return value

Quoted 21 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

Quoted 8 lines

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.

Ok to take whichever route you choose, with a preference in staying with the other patches of the batch.

Thanks, regards,
Nicolas

Quoted 20 lines
---
  drivers/net/ethernet/cadence/macb_main.c |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/cadence/macb_main.c +3 -1
@@ -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 */
author maintainer
#25 lore raw

PATCH 12/23 net: wan: framer: Discard pm_runtime_put() return values

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/net/wan/framer/framer-core.c +2 -5
@@ -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);
 
include/linux/framer/framer.h +2 -3
@@ -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)
author maintainer
#26 lore raw

PATCH 13/23 phy: freescale: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c +2 -4
@@ -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,
author maintainer
#27 lore raw

PATCH 14/23 phy: rockchip-samsung-dcphy: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c +3 -1
@@ -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 = {
author maintainer
#28 lore raw

PATCH 15/23 phy: core: Discard pm_runtime_put() return values

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/phy/phy-core.c +3 -6
@@ -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);
 
include/linux/phy/phy.h +2 -5
@@ -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)
#29 lore raw

Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values

Hi Rafael,

Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines

No intentional functional impact.

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

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.

Quoted 5 lines
drivers/phy/phy-core.c +0 -0
@@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
 }
 EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);

drivers/phy/phy-core.c int phy_pm_runtime_get_sync(struct phy * · line 199

Quoted 10 lines
drivers/phy/phy-core.c +2 -4
 
-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!

drivers/phy/phy-core.c int phy_pm_runtime_get_sync(struct phy * · line 201

Quoted 6 lines
drivers/phy/phy-core.c +1 -2
-
-       return pm_runtime_put(&phy->dev);
+       pm_runtime_put(&phy->dev);
 }
 EXPORT_SYMBOL_GPL(phy_pm_runtime_put);
 

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#30 lore raw

Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values

Quoted 24 lines · Geert Uytterhoeven
Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines

No intentional functional impact.

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Quoted 8 lines

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.

Quoted 13 lines
Quoted 13 lines
drivers/phy/phy-core.c +2 -2
@@ -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;
 
Quoted 8 lines

drivers/phy/phy-core.c int phy_pm_runtime_get_sync(struct phy * · line 199

Quoted 2 lines
drivers/phy/phy-core.c +0 -2
-       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.

Quoted 7 lines

Thanks!

Quoted 5 lines
drivers/phy/phy-core.c +1 -2
-
-       return pm_runtime_put(&phy->dev);
+       pm_runtime_put(&phy->dev);
 }
 EXPORT_SYMBOL_GPL(phy_pm_runtime_put);

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#31 lore raw

Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values

Quoted 58 lines · Geert Uytterhoeven
Quoted 24 lines · Geert Uytterhoeven
Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines

No intentional functional impact.

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Quoted 8 lines

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.

Quoted 19 lines
Quoted 5 lines
drivers/phy/phy-core.c +0 -0
@@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
 }
 EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);

drivers/phy/phy-core.c int phy_pm_runtime_get_sync(struct phy * · line 199

Quoted 10 lines
drivers/phy/phy-core.c +2 -4
 
-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().

Quoted 5 lines
Quoted 2 lines

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

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
author maintainer
#32 lore raw

Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values

Quoted 60 lines · Geert Uytterhoeven
Quoted 58 lines · Geert Uytterhoeven
Quoted 24 lines · Geert Uytterhoeven
Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines

No intentional functional impact.

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Quoted 8 lines

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.

Quoted 19 lines
Quoted 5 lines
drivers/phy/phy-core.c +0 -0
@@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
 }
 EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);

drivers/phy/phy-core.c int phy_pm_runtime_get_sync(struct phy * · line 199

Quoted 10 lines
drivers/phy/phy-core.c +2 -4
 
-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().

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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

author maintainer
#33 lore raw

Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values

In reply to Geert Uytterhoeven
Quoted 31 lines · Geert Uytterhoeven
Quoted 29 lines · Geert Uytterhoeven
Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines

No intentional functional impact.

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

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

Quoted 30 lines
Quoted 3 lines

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.

Quoted 21 lines
Quoted 5 lines
drivers/phy/phy-core.c +0 -0
@@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
 }
 EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);

drivers/phy/phy-core.c int phy_pm_runtime_get_sync(struct phy * · line 199

Quoted 10 lines
drivers/phy/phy-core.c +2 -4
 
-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!

Quoted 2 lines

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.

author maintainer
#34 lore raw

PATCH 16/23 hwspinlock: omap: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/hwspinlock/omap_hwspinlock.c +1 -3
@@ -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)
maintainer Acked-by on v1 16/23
#35 lore raw

Re: [PATCH v1 16/23] hwspinlock: omap: Discard pm_runtime_put() return value

Quoted 12 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 7 lines

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.

Regards,
Bjorn

Quoted 31 lines

---

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(-)
drivers/hwspinlock/omap_hwspinlock.c +1 -3
@@ -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)
author maintainer
#36 lore raw

PATCH 17/23 coresight: Discard pm_runtime_put() return values

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/hwtracing/coresight/coresight-cpu-debug.c +4 -8
@@ -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",
maintainer Acked-by on v1 17/23
#37 lore raw

Re: [PATCH v1 17/23] coresight: Discard pm_runtime_put() return values

Quoted 24 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

Quoted 8 lines

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.

Quoted 46 lines
---
  drivers/hwtracing/coresight/coresight-cpu-debug.c |   12 ++++--------
  1 file changed, 4 insertions(+), 8 deletions(-)
drivers/hwtracing/coresight/coresight-cpu-debug.c +4 -8
@@ -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",
author maintainer
#38 lore raw

PATCH 18/23 platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/platform/chrome/cros_hps_i2c.c +3 -1
@@ -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 = {
maintainer Acked-by on v1 18/23
#39 lore raw

Re: [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value

Quoted 12 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 7 lines

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.

author maintainer
#40 lore raw

PATCH 19/23 pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/pmdomain/imx/gpcv2.c +3 -1
@@ -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
 
Acked-by on v1 19/23
#41 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

Quoted 11 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 8 lines

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.

#42 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki
Quoted 12 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 8 lines

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.

Applied for next, thanks!

Kind regards
Uffe

Quoted 31 lines

---

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(-)
drivers/pmdomain/imx/gpcv2.c +3 -1
@@ -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
 
author maintainer
#43 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

Hi Ulf,

Quoted 18 lines · Ulf Hansson
Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines
Quoted 4 lines

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Applied for next, thanks!

Since you applied this one, I'm assuming no objections, so I'm going to queue it up separately along with the patch changing pm_runtime_put() to void because I would prefer to make that change in 7.0 to dragging it for another cycle.

An ACK would be helpful though, I think.

Quoted 31 lines
Quoted 31 lines

---

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(-)
drivers/pmdomain/imx/gpcv2.c +3 -1
@@ -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
 
#44 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

Quoted 27 lines · Rafael J. Wysocki

Hi Ulf,

Quoted 23 lines · Ulf Hansson
Quoted 20 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 8 lines
Quoted 1 line

Applied for next, thanks!

Since you applied this one, I'm assuming no objections, so I'm going to queue it up separately along with the patch changing pm_runtime_put() to void because I would prefer to make that change in 7.0 to dragging it for another cycle.

An ACK would be helpful though, I think.

I was still hoping that Linus was considering to pull my pull-request for pmdomain, but it seems like that may happen. Assuming that doesn't change, I can re-base my next branch on Monday to drop $subject patch, but please wait until my confirmation so we don't end up having two commits in linux-next for the same change.

Kind regards
Uffe

Quoted 32 lines
Quoted 32 lines
Quoted 32 lines

---

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(-)
drivers/pmdomain/imx/gpcv2.c +3 -1
@@ -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
 
author maintainer
#45 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

Quoted 36 lines · Ulf Hansson
Quoted 34 lines · Rafael J. Wysocki

Hi Ulf,

Quoted 18 lines · Ulf Hansson
Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines
Quoted 4 lines

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Applied for next, thanks!

Since you applied this one, I'm assuming no objections, so I'm going to queue it up separately along with the patch changing pm_runtime_put() to void because I would prefer to make that change in 7.0 to dragging it for another cycle.

Quoted 7 lines
Quoted 1 line

An ACK would be helpful though, I think.

I was still hoping that Linus was considering to pull my pull-request for pmdomain, but it seems like that may happen. Assuming that doesn't change, I can re-base my next branch on Monday to drop $subject patch, but please wait until my confirmation so we don't end up having two commits in linux-next for the same change.

Sure, no problem.

author maintainer
#46 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

Quoted 40 lines · Rafael J. Wysocki
Quoted 38 lines · Ulf Hansson
Quoted 35 lines · Rafael J. Wysocki

Hi Ulf,

Quoted 18 lines · Ulf Hansson
Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines
Quoted 4 lines

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Applied for next, thanks!

Since you applied this one, I'm assuming no objections, so I'm going to queue it up separately along with the patch changing pm_runtime_put() to void because I would prefer to make that change in 7.0 to dragging it for another cycle.

An ACK would be helpful though, I think.

Quoted 7 lines
Quoted 5 lines

I was still hoping that Linus was considering to pull my pull-request for pmdomain, but it seems like that may happen. Assuming that doesn't change, I can re-base my next branch on Monday to drop $subject patch, but please wait until my confirmation so we don't end up having two commits in linux-next for the same change.

Sure, no problem.

That said, git can cope with merging two branches carrying exactly the same patch. It just creates an empty commit for the second copy AFAICS.

author maintainer
#47 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

Quoted 48 lines · Rafael J. Wysocki
Quoted 46 lines · Rafael J. Wysocki
Quoted 43 lines · Ulf Hansson
Quoted 27 lines · Rafael J. Wysocki

Hi Ulf,

Quoted 23 lines · Ulf Hansson
Quoted 20 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 8 lines
Quoted 1 line

Applied for next, thanks!

Since you applied this one, I'm assuming no objections, so I'm going to queue it up separately along with the patch changing pm_runtime_put() to void because I would prefer to make that change in 7.0 to dragging it for another cycle.

An ACK would be helpful though, I think.

I was still hoping that Linus was considering to pull my pull-request for pmdomain, but it seems like that may happen. Assuming that doesn't change, I can re-base my next branch on Monday to drop $subject patch, but please wait until my confirmation so we don't end up having two commits in linux-next for the same change.

Quoted 5 lines
Quoted 1 line

Sure, no problem.

That said, git can cope with merging two branches carrying exactly the same patch. It just creates an empty commit for the second copy AFAICS.

A correction on the latter: That's what rebase would do, if I'm not mistaken. A merge simply doesn't update files that are already identical in both parents.

Acked-by
#48 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki
Quoted 40 lines · Rafael J. Wysocki
Quoted 38 lines · Ulf Hansson
Quoted 35 lines · Rafael J. Wysocki

Hi Ulf,

Quoted 18 lines · Ulf Hansson
Quoted 16 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines
Quoted 4 lines

This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Applied for next, thanks!

Since you applied this one, I'm assuming no objections, so I'm going to queue it up separately along with the patch changing pm_runtime_put() to void because I would prefer to make that change in 7.0 to dragging it for another cycle.

An ACK would be helpful though, I think.

Quoted 7 lines
Quoted 5 lines

I was still hoping that Linus was considering to pull my pull-request for pmdomain, but it seems like that may happen. Assuming that doesn't change, I can re-base my next branch on Monday to drop $subject patch, but please wait until my confirmation so we don't end up having two commits in linux-next for the same change.

Sure, no problem.

I have updated my next branch and dropped the $subject patch from it. Please add my ack when applying.

Kind regards
Uffe

author maintainer
#49 lore raw

Re: [PATCH v1 19/23] pmdomain: imx: gpcv2: Discard pm_runtime_put() return value

Quoted 48 lines · Ulf Hansson
Quoted 46 lines · Rafael J. Wysocki
Quoted 43 lines · Ulf Hansson
Quoted 27 lines · Rafael J. Wysocki

Hi Ulf,

Quoted 23 lines · Ulf Hansson
Quoted 20 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 8 lines
Quoted 1 line

Applied for next, thanks!

Since you applied this one, I'm assuming no objections, so I'm going to queue it up separately along with the patch changing pm_runtime_put() to void because I would prefer to make that change in 7.0 to dragging it for another cycle.

An ACK would be helpful though, I think.

I was still hoping that Linus was considering to pull my pull-request for pmdomain, but it seems like that may happen. Assuming that doesn't change, I can re-base my next branch on Monday to drop $subject patch, but please wait until my confirmation so we don't end up having two commits in linux-next for the same change.

Quoted 6 lines
Quoted 1 line

Sure, no problem.

I have updated my next branch and dropped the $subject patch from it. Please add my ack when applying.

Thanks!

author maintainer
#50 lore raw

PATCH 20/23 scsi: ufs: core: Discard pm_runtime_put() return values

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/ufs/core/ufshcd-priv.h +2 -2
@@ -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);
 }
 
 /**
reviewer Reviewed-by on v1 20/23
#51 lore raw

Re: [PATCH v1 20/23] scsi: ufs: core: Discard pm_runtime_put() return values

On 12/22/25 9:31 PM, Rafael J. Wysocki wrote:>

Quoted 3 lines

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.

author maintainer
#53 lore raw

PATCH 21/23 dmaengine: sh: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
drivers/dma/sh/shdma-base.c +1 -1
@@ -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;
author maintainer
#54 lore raw

PATCH 22/23 ASoC: rockchip: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---

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(-)
sound/soc/rockchip/rockchip_sai.c +3 -2
@@ -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;
author maintainer
#55 lore raw

PATCH 23/23 PM: runtime: Change pm_runtime_put() return type to void

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

---
 include/linux/pm_runtime.h |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
include/linux/pm_runtime.h +2 -14
@@ -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);
 }
 
 /**
Reviewed-by on v1 23/23
#56 lore raw

Re: [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void

Quoted 22 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 4 lines

Accordingly, to avoid the confusion mentioned above, change the return type of pm_runtime_put() to void.

Nice cleanup!

Kind regards
Uffe

Quoted 34 lines
---
 include/linux/pm_runtime.h |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
include/linux/pm_runtime.h +2 -14
@@ -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);
 }
 
 /**
Reviewed-by on v1 23/23
#57 lore raw

Re: [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void

In reply to Rafael J. Wysocki
Quoted 21 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 7 lines

Accordingly, to avoid the confusion mentioned above, change the return type of pm_runtime_put() to void.

---
 include/linux/pm_runtime.h |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

I'm always happy to see rough edges of the runtime PM API sanded off. Thanks for doing this!

maintainer Applied
#58 lore raw

Re: (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function

In reply to Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

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,

Signature · 1 line
~Vinod
maintainer
#59 lore raw

Re: (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function

In reply to Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

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

maintainer Applied
#60 lore raw

Re: (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function

In reply to Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

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,

Signature · 1 line
~Vinod
author maintainer
#61 lore raw

PATCH v2 1/3 net: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

Hi All,

This mostly is a resend of patches [10-12/23] from:

https://lore.kernel.org/linux-pm/[email protected]/

as requested by Jakub, except for the last patch that has been fixed while at it and so the version has been bumped up.

The patches are independent of each other and they are all requisite for converting pm_runtime_put() into a void function.

Thanks!

author maintainer
#62 lore raw

PATCH v2 1/3 net: ethernet: ti: am65-cpsw: Discard pm_runtime_put() return value

From: "Rafael J. Wysocki" <[email protected]>

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.

---

v1 -> v2: No changes

---
 drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 5 +----
 drivers/net/ethernet/ti/cpsw_ethtool.c      | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +1 -4
index c57497074ae6..98d60da7cc3b 100644
@@ -391,11 +391,8 @@ static int am65_cpsw_ethtool_op_begin(struct net_device *ndev)
 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,
drivers/net/ethernet/ti/cpsw_ethtool.c +1 -4
index bdc4db0d169c..a43f75ee269e 100644
@@ -374,11 +374,8 @@ int cpsw_ethtool_op_begin(struct net_device *ndev)
 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)
Signature · 1 line
2.51.0
author maintainer
#63 lore raw

PATCH v2 2/3 net: cadence: macb: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: "Rafael J. Wysocki" <[email protected]>

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.

---

v1 -> v2: Added Acked-by from Nicolas.

---
 drivers/net/ethernet/cadence/macb_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/cadence/macb_main.c +3 -1
index e461f5072884..1079613953bc 100644
@@ -4810,7 +4810,9 @@ static int at91ether_close(struct net_device *dev)
 
 	at91ether_stop(lp);
 
-	return pm_runtime_put(&lp->pdev->dev);
+	pm_runtime_put(&lp->pdev->dev);
+
+	return 0;
 }
 
 /* Transmit packet */
Signature · 1 line
2.51.0
author maintainer
#64 lore raw

PATCH v2 3/3 net: wan: framer: Discard pm_runtime_put() return values

In reply to Rafael J. Wysocki

From: "Rafael J. Wysocki" <[email protected]>

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.

---

v1 -> v2:
* Do not remove the pm_runtime_enabled() check from framer_pm_runtime_put() so that it also works when runtime PM is disabled.

---
 drivers/net/wan/framer/framer-core.c | 6 +++---
 include/linux/framer/framer.h        | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/wan/framer/framer-core.c +3 -3
index 58f5143359df..bf7ac7dd2804 100644
@@ -60,12 +60,12 @@ int framer_pm_runtime_get_sync(struct framer *framer)
 }
 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;
 
-	return pm_runtime_put(&framer->dev);
+	pm_runtime_put(&framer->dev);
 }
 EXPORT_SYMBOL_GPL(framer_pm_runtime_put);
 
include/linux/framer/framer.h +2 -3
index 2b85fe9e7f9a..b1e575665fc5 100644
@@ -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_sync(struct framer *framer)
 	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)
Signature · 1 line
2.51.0
maintainer
#65 lore raw

Re: [PATCH v2 1/3] net: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki
Quoted 1 line · On Sat, 03 Jan 2026 22:23:52 +0100 Rafael J. Wysocki wrote:

Subject: [PATCH v2 1/3] net: Discard pm_runtime_put() return value

Sorry for noticing late -- looks like the subject prefix being 1/3 instead of 0/3 is throwing patchwork off. Patchwork seems to have mis-guessed that these are the first 3 patches of the missing ones in your full 23 patch series, instead of treating this as a fresh posting:

https://patchwork.kernel.org/project/netdevbpf/list/?series=1035812&state=*

Could you resend one more time with the cover letter subject corrected?

author maintainer
#66 lore raw

Re: [PATCH v2 1/3] net: Discard pm_runtime_put() return value

Quoted 6 lines · Jakub Kicinski
Quoted 1 line · On Sat, 03 Jan 2026 22:23:52 +0100 Rafael J. Wysocki wrote:

Subject: [PATCH v2 1/3] net: Discard pm_runtime_put() return value

Sorry for noticing late -- looks like the subject prefix being 1/3 instead of 0/3 is throwing patchwork off.

No worries.

Quoted 8 lines

Patchwork seems to have
mis-guessed that these are the first 3 patches of the missing ones in your full 23 patch series, instead of treating this as a fresh posting:

https://patchwork.kernel.org/project/netdevbpf/list/?series=1035812&state=*

Could you resend one more time with the cover letter subject corrected?

Done:

https://lore.kernel.org/linux-pm/[email protected]/

Interestingly enough, the kernel.org Patchwork seems to have got that right:

https://patchwork.kernel.org/project/linux-pm/list/?series=1038125

author maintainer
#67 lore raw

v2 cover net: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

Hi All,

This is a resend of

https://lore.kernel.org/linux-pm/[email protected]/

which mostly was a resend of patches [10-12/23] from:

https://lore.kernel.org/linux-pm/[email protected]/

as requested by Jakub, except for the last patch that has been fixed while at it and so the version has been bumped up.

The patches are independent of each other and they are all requisite for converting pm_runtime_put() into a void function.

Thanks!

author maintainer
#68 lore raw

PATCH RESEND v2 1/3 net: ethernet: ti: am65-cpsw: Discard pm_runtime_put() return value

From: "Rafael J. Wysocki" <[email protected]>

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.

---

v1 -> v2: No changes

---
 drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 5 +----
 drivers/net/ethernet/ti/cpsw_ethtool.c      | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +1 -4
index c57497074ae6..98d60da7cc3b 100644
@@ -391,11 +391,8 @@ static int am65_cpsw_ethtool_op_begin(struct net_device *ndev)
 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,
drivers/net/ethernet/ti/cpsw_ethtool.c +1 -4
index bdc4db0d169c..a43f75ee269e 100644
@@ -374,11 +374,8 @@ int cpsw_ethtool_op_begin(struct net_device *ndev)
 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)
Signature · 1 line
2.51.0
author maintainer
#69 lore raw

PATCH RESEND v2 2/3 net: cadence: macb: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki

From: "Rafael J. Wysocki" <[email protected]>

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.

---

v1 -> v2: Added Acked-by from Nicolas

---
 drivers/net/ethernet/cadence/macb_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/cadence/macb_main.c +3 -1
index e461f5072884..1079613953bc 100644
@@ -4810,7 +4810,9 @@ static int at91ether_close(struct net_device *dev)
 
 	at91ether_stop(lp);
 
-	return pm_runtime_put(&lp->pdev->dev);
+	pm_runtime_put(&lp->pdev->dev);
+
+	return 0;
 }
 
 /* Transmit packet */
Signature · 1 line
2.51.0
author maintainer
#70 lore raw

PATCH RESEND v2 3/3 net: wan: framer: Discard pm_runtime_put() return values

In reply to Rafael J. Wysocki

From: "Rafael J. Wysocki" <[email protected]>

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.

---

v1 -> v2:
* Do not remove the pm_runtime_enabled() check from framer_pm_runtime_put() so that it also works when runtime PM is disabled.

---
 drivers/net/wan/framer/framer-core.c | 6 +++---
 include/linux/framer/framer.h        | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/wan/framer/framer-core.c +3 -3
index 58f5143359df..bf7ac7dd2804 100644
@@ -60,12 +60,12 @@ int framer_pm_runtime_get_sync(struct framer *framer)
 }
 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;
 
-	return pm_runtime_put(&framer->dev);
+	pm_runtime_put(&framer->dev);
 }
 EXPORT_SYMBOL_GPL(framer_pm_runtime_put);
 
include/linux/framer/framer.h +2 -3
index 2b85fe9e7f9a..b1e575665fc5 100644
@@ -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_sync(struct framer *framer)
 	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)
Signature · 1 line
2.51.0
author maintainer
#71 lore raw

Re: [RESEND][PATCH v2 0/3] net: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki
Quoted 9 lines · Rafael J. Wysocki

Hi All,

This is a resend of

https://lore.kernel.org/linux-pm/[email protected]/

which mostly was a resend of patches [10-12/23] from:

Quoted 7 lines

https://lore.kernel.org/linux-pm/[email protected]/

as requested by Jakub, except for the last patch that has been fixed while at it and so the version has been bumped up.

The patches are independent of each other and they are all requisite for converting pm_runtime_put() into a void function.

Any news on this or do I need to resend it again?

maintainer
#72 lore raw

Re: [RESEND][PATCH v2 0/3] net: Discard pm_runtime_put() return value

Quoted 8 lines · On Thu, 8 Jan 2026 15:06:55 +0100 Rafael J. Wysocki wrote:
Quoted 8 lines

This is a resend of

https://lore.kernel.org/linux-pm/[email protected]/

which mostly was a resend of patches [10-12/23] from:

https://lore.kernel.org/linux-pm/[email protected]/

Quoted 7 lines
Quoted 5 lines

as requested by Jakub, except for the last patch that has been fixed while at it and so the version has been bumped up.

The patches are independent of each other and they are all requisite for converting pm_runtime_put() into a void function.

Any news on this or do I need to resend it again?

All good, just mis-scheduled my day yesterday and had too little time for upstream :(

#73 lore raw

Re: [RESEND][PATCH v2 0/3] net: Discard pm_runtime_put() return value

In reply to Rafael J. Wysocki
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Wed, 07 Jan 2026 13:31:03 +0100 you wrote:

Hi All,

This is a resend of

https://lore.kernel.org/linux-pm/[email protected]/

which mostly was a resend of patches [10-12/23] from:

[...]

Here is the summary with links:
- [RESEND,v2,1/3] net: ethernet: ti: am65-cpsw: Discard pm_runtime_put() return value

    https://git.kernel.org/netdev/net-next/c/6961aa43654b
  - [RESEND,v2,2/3] net: cadence: macb: Discard pm_runtime_put() return value
    https://git.kernel.org/netdev/net-next/c/46786f66f2cc
  - [RESEND,v2,3/3] net: wan: framer: Discard pm_runtime_put() return values
    https://git.kernel.org/netdev/net-next/c/36775f3d5f70

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html