FAILED: patch "[PATCH] media: qcom: iris: fix runtime PM reference leaks" failed to apply to 7.2-stable tree
Subsystems (5)
[email protected]
maintainerThe patch below does not apply to the 7.2-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-7.2.y
git checkout FETCH_HEAD
git cherry-pick -x f87d7eda07fca21efe4b96169ae59007db46e60e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090908-modulator-ascent-3261@gregkh' --subject-prefix 'PATCH 7.2.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f87d7eda07fca21efe4b96169ae59007db46e60e Mon Sep 17 00:00:00 2001
From: Hungyu Lin <[email protected]>
Date: Mon, 8 Jun 2026 08:17:20 +0000
Subject: [PATCH] media: qcom: iris: fix runtime PM reference leaks
Use pm_runtime_resume_and_get() in iris_enable_power_domains() to avoid leaking a runtime PM usage count on failure.
Also ensure pm_runtime_put_sync() is always called in iris_disable_power_domains(), even when iris_opp_set_rate() fails, so runtime PM references remain balanced.
drivers/media/platform/qcom/iris/iris_resources.c +6 -5
@@ -78,20 +78,21 @@ int iris_enable_power_domains(struct iris_core *core, struct device *pd_dev)if (ret)return ret; -return pm_runtime_get_sync (pd_dev); +return pm_runtime_resume_and_get (pd_dev); }int iris_disable_power_domains (struct iris_core *core,struct device *pd_dev) {int ret; +int pm_ret; ret =iris_opp_set_rate (core->dev,0 ); -if (ret) -return ret; -pm_runtime_put_sync (pd_dev); + pm_ret =pm_runtime_put_sync (pd_dev); +if (!ret) + ret = pm_ret; -return 0 ; +return ret; }static struct clk *iris_get_clk_by_type (struct iris_core *core,enum platform_clk_type clk_type)
Sasha Levin
maintainerPATCH 1/2 media: remove conditional return with no effect
From: Sang-Heon Jeon <[email protected]>
[ Upstream commit 9508676ad8562368bb1aa7d1991fbd50611ddacb ]
Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from scripts/coccinelle/misc/cond_return_no_effect.cocci.
Stable-dep-of: f87d7eda07fc ("media: qcom: iris: fix runtime PM reference leaks")
--- drivers/media/i2c/mt9p031.c | 6 +----- .../media/platform/microchip/microchip-sama7g5-isc.c | 7 +------ drivers/media/platform/qcom/iris/iris_resources.c | 6 +----- drivers/media/platform/qcom/venus/pm_helpers.c | 7 +------ drivers/media/platform/renesas/rcar-csi2.c | 6 +----- .../media/platform/samsung/s3c-camif/camif-core.c | 7 +------ drivers/media/usb/dvb-usb-v2/mxl111sf.c | 12 ++---------- drivers/media/usb/gspca/jl2005bcd.c | 7 +------ 8 files changed, 9 insertions(+), 49 deletions(-)
drivers/media/i2c/mt9p031.c +1 -5
@@ -452,11 +452,7 @@ static int mt9p031_set_params(struct mt9p031 *mt9p031) ret =mt9p031_write (client,MT9P031_HORIZONTAL_BLANK , hblank -1 );if (ret <0 )return ret; - ret =mt9p031_write (client,MT9P031_VERTICAL_BLANK , vblank -1 ); -if (ret <0 ) -return ret; - -return ret; +return mt9p031_write (client,MT9P031_VERTICAL_BLANK , vblank -1 ); }static int mt9p031_s_stream (struct v4l2_subdev *subdev,int enable)
drivers/media/platform/microchip/microchip-sama7g5-isc.c +1 -6
@@ -598,13 +598,8 @@ static int __maybe_unused xisc_runtime_suspend(struct device *dev)static int __maybe_unused xisc_runtime_resume (struct device *dev) {struct isc_device *isc =dev_get_drvdata (dev); -int ret; - - ret =clk_prepare_enable (isc->hclock); -if (ret) -return ret; -return ret; +return clk_prepare_enable (isc->hclock); }static const struct dev_pm_ops microchip_xisc_dev_pm_ops = {
drivers/media/platform/qcom/iris/iris_resources.c +1 -5
@@ -78,11 +78,7 @@ int iris_enable_power_domains(struct iris_core *core, struct device *pd_dev)if (ret)return ret; - ret =pm_runtime_get_sync (pd_dev); -if (ret <0 ) -return ret; - -return ret; +return pm_runtime_get_sync (pd_dev); }int iris_disable_power_domains (struct iris_core *core,struct device *pd_dev)
drivers/media/platform/qcom/venus/pm_helpers.c +1 -6
@@ -781,7 +781,6 @@ static int decide_core(struct venus_inst *inst)unsigned long max_freq =ULONG_MAX ;struct device *dev = core->dev;struct dev_pm_opp *opp; -int ret =0 ;if (legacy_binding) {if (inst->session_type ==VIDC_SESSION_TYPE_DEC )
@@ -829,11 +828,7 @@ static int decide_core(struct venus_inst *inst) } done: - ret =hfi_session_set_property (inst, ptype, &cu); -if (ret) -return ret; - -return ret; +return hfi_session_set_property (inst, ptype, &cu); }static int acquire_core (struct venus_inst *inst)
drivers/media/platform/renesas/rcar-csi2.c +1 -5
@@ -2273,11 +2273,7 @@ static int rcsi2_init_phtw_v3u(struct rcar_csi2 *priv,return ret; } - ret =rcsi2_phtw_write_array (priv, step4,ARRAY_SIZE (step4)); -if (ret) -return ret; - -return ret; +return rcsi2_phtw_write_array (priv, step4,ARRAY_SIZE (step4)); }/* -----------------------------------------------------------------------------
drivers/media/platform/samsung/s3c-camif/camif-core.c +1 -6
@@ -302,7 +302,6 @@ static int camif_media_dev_init(struct camif_dev *camif)struct media_device *md = &camif->media_dev;struct v4l2_device *v4l2_dev = &camif->v4l2_dev;unsigned int ip_rev = camif->variant->ip_revision; -int ret;memset (md,0 ,sizeof (*md)); snprintf(md->model, sizeof(md->model), "Samsung S3C%s CAMIF",
@@ -317,11 +316,7 @@ static int camif_media_dev_init(struct camif_dev *camif)media_device_init (md); - ret =v4l2_device_register (camif->dev, v4l2_dev); -if (ret <0 ) -return ret; - -return ret; +return v4l2_device_register (camif->dev, v4l2_dev); }static void camif_clk_put (struct camif_dev *camif)
drivers/media/usb/dvb-usb-v2/mxl111sf.c +2 -10
@@ -987,11 +987,7 @@ static int mxl111sf_frontend_attach_atsc_mh(struct dvb_usb_adapter *adap)if (ret <0 )return ret; - ret =mxl111sf_lg2160_frontend_attach (adap,2 ); -if (ret <0 ) -return ret; - -return ret; +return mxl111sf_lg2160_frontend_attach (adap,2 ); }static int mxl111sf_frontend_attach_mercury (struct dvb_usb_adapter *adap)
@@ -1007,11 +1003,7 @@ static int mxl111sf_frontend_attach_mercury(struct dvb_usb_adapter *adap)if (ret <0 )return ret; - ret =mxl111sf_lg2161_ep6_frontend_attach (adap,2 ); -if (ret <0 ) -return ret; - -return ret; +return mxl111sf_lg2161_ep6_frontend_attach (adap,2 ); }static int mxl111sf_frontend_attach_mercury_mh (struct dvb_usb_adapter *adap)
drivers/media/usb/gspca/jl2005bcd.c +1 -6
@@ -148,17 +148,12 @@ static int jl2005c_start_new_frame(struct gspca_dev *gspca_dev)static int jl2005c_write_reg (struct gspca_dev *gspca_dev,unsigned char reg,unsigned char value) { -int retval;u8 instruction[2 ]; instruction[0 ] = reg; instruction[1 ] = value; - retval =jl2005c_write2 (gspca_dev, instruction); -if (retval <0 ) -return retval; - -return retval; +return jl2005c_write2 (gspca_dev, instruction); }static int jl2005c_get_firmware_id (struct gspca_dev *gspca_dev)
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/2 media: qcom: iris: fix runtime PM reference leaks
From: Hungyu Lin <[email protected]>
[ Upstream commit f87d7eda07fca21efe4b96169ae59007db46e60e ]
Use pm_runtime_resume_and_get() in iris_enable_power_domains() to avoid leaking a runtime PM usage count on failure.
Also ensure pm_runtime_put_sync() is always called in iris_disable_power_domains(), even when iris_opp_set_rate() fails, so runtime PM references remain balanced.
--- drivers/media/platform/qcom/iris/iris_resources.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/media/platform/qcom/iris/iris_resources.c +6 -5
@@ -78,20 +78,21 @@ int iris_enable_power_domains(struct iris_core *core, struct device *pd_dev)if (ret)return ret; -return pm_runtime_get_sync (pd_dev); +return pm_runtime_resume_and_get (pd_dev); }int iris_disable_power_domains (struct iris_core *core,struct device *pd_dev) {int ret; +int pm_ret; ret =iris_opp_set_rate (core->dev,0 ); -if (ret) -return ret; -pm_runtime_put_sync (pd_dev); + pm_ret =pm_runtime_put_sync (pd_dev); +if (!ret) + ret = pm_ret; -return 0 ; +return ret; }static struct clk *iris_get_clk_by_type (struct iris_core *core,enum platform_clk_type clk_type)
Signature · 1 line
2.53.0