Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm: Discard pm_runtime_put() return value

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>
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/2256082.irdbgypaU6@rafael.j.wysocki

+11 -42
+1 -5
drivers/gpu/drm/arm/malidp_crtc.c
··· 77 77 crtc); 78 78 struct malidp_drm *malidp = crtc_to_malidp_device(crtc); 79 79 struct malidp_hw_device *hwdev = malidp->dev; 80 - int err; 81 80 82 81 /* always disable planes on the CRTC that is being turned off */ 83 82 drm_atomic_helper_disable_planes_on_crtc(old_state, false); ··· 86 87 87 88 clk_disable_unprepare(hwdev->pxlclk); 88 89 89 - err = pm_runtime_put(crtc->dev->dev); 90 - if (err < 0) { 91 - DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err); 92 - } 90 + pm_runtime_put(crtc->dev->dev); 93 91 } 94 92 95 93 static const struct gamma_curve_segment {
+1 -3
drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
··· 280 280 clk_disable_unprepare(imx8qm_ldb->clk_bypass); 281 281 clk_disable_unprepare(imx8qm_ldb->clk_pixel); 282 282 283 - ret = pm_runtime_put(dev); 284 - if (ret < 0) 285 - DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret); 283 + pm_runtime_put(dev); 286 284 } 287 285 288 286 static const u32 imx8qm_ldb_bus_output_fmts[] = {
+1 -3
drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
··· 282 282 if (is_split && companion) 283 283 companion->funcs->atomic_disable(companion, state); 284 284 285 - ret = pm_runtime_put(dev); 286 - if (ret < 0) 287 - DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret); 285 + pm_runtime_put(dev); 288 286 } 289 287 290 288 static const u32 imx8qxp_ldb_bus_output_fmts[] = {
+1 -4
drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
··· 181 181 { 182 182 struct imx8qxp_pc_channel *ch = bridge->driver_private; 183 183 struct imx8qxp_pc *pc = ch->pc; 184 - int ret; 185 184 186 - ret = pm_runtime_put(pc->dev); 187 - if (ret < 0) 188 - DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret); 185 + pm_runtime_put(pc->dev); 189 186 } 190 187 191 188 static const u32 imx8qxp_pc_bus_output_fmts[] = {
+1 -4
drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
··· 127 127 struct drm_atomic_state *state) 128 128 { 129 129 struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; 130 - int ret; 131 130 132 - ret = pm_runtime_put(p2d->dev); 133 - if (ret < 0) 134 - DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret); 131 + pm_runtime_put(p2d->dev); 135 132 136 133 if (p2d->companion) 137 134 p2d->companion->funcs->atomic_disable(p2d->companion, state);
+3 -9
drivers/gpu/drm/imx/dc/dc-crtc.c
··· 300 300 drm_atomic_get_new_crtc_state(state, crtc); 301 301 struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev); 302 302 struct dc_crtc *dc_crtc = to_dc_crtc(crtc); 303 - int idx, ret; 303 + int idx; 304 304 305 305 if (!drm_dev_enter(crtc->dev, &idx)) 306 306 goto out; ··· 313 313 dc_fg_disable_clock(dc_crtc->fg); 314 314 315 315 /* request pixel engine power-off as plane is off too */ 316 - ret = pm_runtime_put(dc_drm->pe->dev); 317 - if (ret) 318 - dc_crtc_err(crtc, "failed to put DC pixel engine RPM: %d\n", 319 - ret); 316 + pm_runtime_put(dc_drm->pe->dev); 320 317 321 318 /* request display engine power-off when CRTC is disabled */ 322 - ret = pm_runtime_put(dc_crtc->de->dev); 323 - if (ret < 0) 324 - dc_crtc_err(crtc, "failed to put DC display engine RPM: %d\n", 325 - ret); 319 + pm_runtime_put(dc_crtc->de->dev); 326 320 327 321 drm_dev_exit(idx); 328 322
+1 -4
drivers/gpu/drm/vc4/vc4_hdmi.c
··· 848 848 struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); 849 849 struct drm_device *drm = vc4_hdmi->connector.dev; 850 850 unsigned long flags; 851 - int ret; 852 851 int idx; 853 852 854 853 mutex_lock(&vc4_hdmi->mutex); ··· 866 867 clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock); 867 868 clk_disable_unprepare(vc4_hdmi->pixel_clock); 868 869 869 - ret = pm_runtime_put(&vc4_hdmi->pdev->dev); 870 - if (ret < 0) 871 - drm_err(drm, "Failed to release power domain: %d\n", ret); 870 + pm_runtime_put(&vc4_hdmi->pdev->dev); 872 871 873 872 drm_dev_exit(idx); 874 873
+2 -10
drivers/gpu/drm/vc4/vc4_vec.c
··· 542 542 { 543 543 struct drm_device *drm = encoder->dev; 544 544 struct vc4_vec *vec = encoder_to_vc4_vec(encoder); 545 - int idx, ret; 545 + int idx; 546 546 547 547 if (!drm_dev_enter(drm, &idx)) 548 548 return; ··· 556 556 557 557 clk_disable_unprepare(vec->clock); 558 558 559 - ret = pm_runtime_put(&vec->pdev->dev); 560 - if (ret < 0) { 561 - drm_err(drm, "Failed to release power domain: %d\n", ret); 562 - goto err_dev_exit; 563 - } 559 + pm_runtime_put(&vec->pdev->dev); 564 560 565 - drm_dev_exit(idx); 566 - return; 567 - 568 - err_dev_exit: 569 561 drm_dev_exit(idx); 570 562 } 571 563