From: Liviu Dudau <liviu.dudau@arm.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Linux PM" <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Ulf Hansson" <ulf.hansson@linaro.org>,
"Brian Norris" <briannorris@chromium.org>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Liu Ying" <victor.liu@nxp.com>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
"Maíra Canal" <mcanal@igalia.com>,
"Raspberry Pi Kernel Maintenance" <kernel-list@raspberrypi.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v1 03/23] drm: Discard pm_runtime_put() return value
Date: Tue, 23 Dec 2025 15:57:20 +0000 [thread overview]
Message-ID: <aUq74DUXcoh-AzZe@e142607> (raw)
In-Reply-To: <3045480.e9J7NaK4W3@rafael.j.wysocki>
On Mon, Dec 22, 2025 at 08:57:35PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Multiple DRM drivers use the pm_runtime_put() return value for printing
> debug or even error messages and all of those messages are at least
> somewhat misleading.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example. It also happens when the kernel
> has been configured with CONFIG_PM unset.
>
> For this reason, modify all of those drivers to simply discard the
> pm_runtime_put() return value which is what they should be doing.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/gpu/drm/arm/malidp_crtc.c | 6 +-----
For the malidp_crtc.c:
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> drivers/gpu/drm/bridge/imx/imx8qm-ldb.c | 4 +---
> drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 4 +---
> drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 5 +----
> drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 5 +----
> drivers/gpu/drm/imx/dc/dc-crtc.c | 12 +++---------
> drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +----
> drivers/gpu/drm/vc4/vc4_vec.c | 12 ++----------
> 8 files changed, 11 insertions(+), 42 deletions(-)
>
> --- a/drivers/gpu/drm/arm/malidp_crtc.c
> +++ b/drivers/gpu/drm/arm/malidp_crtc.c
> @@ -77,7 +77,6 @@ static void malidp_crtc_atomic_disable(s
> crtc);
> struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
> struct malidp_hw_device *hwdev = malidp->dev;
> - int err;
>
> /* always disable planes on the CRTC that is being turned off */
> drm_atomic_helper_disable_planes_on_crtc(old_state, false);
> @@ -87,10 +86,7 @@ static void malidp_crtc_atomic_disable(s
>
> clk_disable_unprepare(hwdev->pxlclk);
>
> - err = pm_runtime_put(crtc->dev->dev);
> - if (err < 0) {
> - DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err);
> - }
> + pm_runtime_put(crtc->dev->dev);
> }
>
> static const struct gamma_curve_segment {
> --- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> @@ -280,9 +280,7 @@ static void imx8qm_ldb_bridge_atomic_dis
> clk_disable_unprepare(imx8qm_ldb->clk_bypass);
> clk_disable_unprepare(imx8qm_ldb->clk_pixel);
>
> - ret = pm_runtime_put(dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(dev);
> }
>
> static const u32 imx8qm_ldb_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> @@ -282,9 +282,7 @@ static void imx8qxp_ldb_bridge_atomic_di
> if (is_split && companion)
> companion->funcs->atomic_disable(companion, state);
>
> - ret = pm_runtime_put(dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(dev);
> }
>
> static const u32 imx8qxp_ldb_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
> @@ -181,11 +181,8 @@ static void imx8qxp_pc_bridge_atomic_dis
> {
> struct imx8qxp_pc_channel *ch = bridge->driver_private;
> struct imx8qxp_pc *pc = ch->pc;
> - int ret;
>
> - ret = pm_runtime_put(pc->dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(pc->dev);
> }
>
> static const u32 imx8qxp_pc_bus_output_fmts[] = {
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
> @@ -127,11 +127,8 @@ static void imx8qxp_pxl2dpi_bridge_atomi
> struct drm_atomic_state *state)
> {
> struct imx8qxp_pxl2dpi *p2d = bridge->driver_private;
> - int ret;
>
> - ret = pm_runtime_put(p2d->dev);
> - if (ret < 0)
> - DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret);
> + pm_runtime_put(p2d->dev);
>
> if (p2d->companion)
> p2d->companion->funcs->atomic_disable(p2d->companion, state);
> --- a/drivers/gpu/drm/imx/dc/dc-crtc.c
> +++ b/drivers/gpu/drm/imx/dc/dc-crtc.c
> @@ -300,7 +300,7 @@ dc_crtc_atomic_disable(struct drm_crtc *
> drm_atomic_get_new_crtc_state(state, crtc);
> struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev);
> struct dc_crtc *dc_crtc = to_dc_crtc(crtc);
> - int idx, ret;
> + int idx;
>
> if (!drm_dev_enter(crtc->dev, &idx))
> goto out;
> @@ -313,16 +313,10 @@ dc_crtc_atomic_disable(struct drm_crtc *
> dc_fg_disable_clock(dc_crtc->fg);
>
> /* request pixel engine power-off as plane is off too */
> - ret = pm_runtime_put(dc_drm->pe->dev);
> - if (ret)
> - dc_crtc_err(crtc, "failed to put DC pixel engine RPM: %d\n",
> - ret);
> + pm_runtime_put(dc_drm->pe->dev);
>
> /* request display engine power-off when CRTC is disabled */
> - ret = pm_runtime_put(dc_crtc->de->dev);
> - if (ret < 0)
> - dc_crtc_err(crtc, "failed to put DC display engine RPM: %d\n",
> - ret);
> + pm_runtime_put(dc_crtc->de->dev);
>
> drm_dev_exit(idx);
>
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -848,7 +848,6 @@ static void vc4_hdmi_encoder_post_crtc_p
> struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> struct drm_device *drm = vc4_hdmi->connector.dev;
> unsigned long flags;
> - int ret;
> int idx;
>
> mutex_lock(&vc4_hdmi->mutex);
> @@ -867,9 +866,7 @@ static void vc4_hdmi_encoder_post_crtc_p
> clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
> clk_disable_unprepare(vc4_hdmi->pixel_clock);
>
> - ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
> - if (ret < 0)
> - drm_err(drm, "Failed to release power domain: %d\n", ret);
> + pm_runtime_put(&vc4_hdmi->pdev->dev);
>
> drm_dev_exit(idx);
>
> --- a/drivers/gpu/drm/vc4/vc4_vec.c
> +++ b/drivers/gpu/drm/vc4/vc4_vec.c
> @@ -542,7 +542,7 @@ static void vc4_vec_encoder_disable(stru
> {
> struct drm_device *drm = encoder->dev;
> struct vc4_vec *vec = encoder_to_vc4_vec(encoder);
> - int idx, ret;
> + int idx;
>
> if (!drm_dev_enter(drm, &idx))
> return;
> @@ -556,17 +556,9 @@ static void vc4_vec_encoder_disable(stru
>
> clk_disable_unprepare(vec->clock);
>
> - ret = pm_runtime_put(&vec->pdev->dev);
> - if (ret < 0) {
> - drm_err(drm, "Failed to release power domain: %d\n", ret);
> - goto err_dev_exit;
> - }
> + pm_runtime_put(&vec->pdev->dev);
>
> drm_dev_exit(idx);
> - return;
> -
> -err_dev_exit:
> - drm_dev_exit(idx);
> }
>
> static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
>
>
>
next prev parent reply other threads:[~2025-12-23 15:58 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-22 19:48 [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Rafael J. Wysocki
2025-12-22 19:50 ` [PATCH v1 01/23] genirq/chip: Change irq_chip_pm_put() return type to void Rafael J. Wysocki
2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:57 ` Alan Stern
2025-12-23 7:56 ` Greg Kroah-Hartman
2025-12-22 19:57 ` [PATCH v1 03/23] drm: " Rafael J. Wysocki
2025-12-23 10:23 ` Dave Stevenson
2025-12-23 15:57 ` Liviu Dudau [this message]
2025-12-22 19:59 ` [PATCH v1 04/23] drm/imagination: " Rafael J. Wysocki
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: " Rafael J. Wysocki
2025-12-23 16:30 ` Laurent Pinchart
2025-12-22 20:03 ` [PATCH v1 06/23] media: ccs: " Rafael J. Wysocki
2025-12-22 20:06 ` [PATCH v1 07/23] media: mediatek: vcodec: " Rafael J. Wysocki
2025-12-22 20:07 ` [PATCH v1 08/23] watchdog: rz: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-28 19:14 ` Guenter Roeck
2025-12-22 20:09 ` [PATCH v1 09/23] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-28 19:15 ` Guenter Roeck
2025-12-22 20:11 ` [PATCH v1 10/23] net: ethernet: ti: am65-cpsw: " Rafael J. Wysocki
2025-12-22 20:14 ` [PATCH v1 11/23] net: cadence: macb: " Rafael J. Wysocki
2025-12-23 8:48 ` Nicolas Ferre
2025-12-22 20:16 ` [PATCH v1 12/23] net: wan: framer: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-22 20:18 ` [PATCH v1 13/23] phy: freescale: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:21 ` [PATCH v1 14/23] phy: rockchip-samsung-dcphy: " Rafael J. Wysocki
2025-12-22 20:22 ` [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-30 10:34 ` Geert Uytterhoeven
2025-12-30 10:54 ` Geert Uytterhoeven
2025-12-30 15:05 ` Geert Uytterhoeven
2025-12-30 16:18 ` Rafael J. Wysocki
2025-12-30 16:17 ` Rafael J. Wysocki
2025-12-22 20:24 ` [PATCH v1 16/23] hwspinlock: omap: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:46 ` Bjorn Andersson
2025-12-22 20:25 ` [PATCH v1 17/23] coresight: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-23 9:53 ` Suzuki K Poulose
2025-12-22 20:27 ` [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-23 3:56 ` Tzung-Bi Shih
2025-12-22 20:29 ` [PATCH v1 19/23] pmdomain: imx: gpcv2: " Rafael J. Wysocki
2025-12-23 13:02 ` Peng Fan
2025-12-28 15:51 ` Ulf Hansson
2025-12-22 20:31 ` [PATCH v1 20/23] scsi: ufs: core: Discard pm_runtime_put() return values Rafael J. Wysocki
2025-12-23 15:29 ` Bart Van Assche
2025-12-22 20:33 ` [PATCH v1 21/23] dmaengine: sh: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:35 ` [PATCH v1 22/23] ASoC: rockchip: " Rafael J. Wysocki
2025-12-22 20:36 ` [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void Rafael J. Wysocki
2025-12-28 15:51 ` Ulf Hansson
2025-12-23 11:28 ` (subset) [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function Vinod Koul
2025-12-23 17:07 ` Mark Brown
2025-12-23 17:44 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aUq74DUXcoh-AzZe@e142607 \
--to=liviu.dudau@arm.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=briannorris@chromium.org \
--cc=dave.stevenson@raspberrypi.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kernel-list@raspberrypi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mcanal@igalia.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rafael@kernel.org \
--cc=rfoss@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=ulf.hansson@linaro.org \
--cc=victor.liu@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).