mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jie Gan <jie.gan@oss.qualcomm.com>
To: Hungyu Lin <dennylin0707@gmail.com>,
	vikash.garodia@oss.qualcomm.com,
	dikshita.agarwal@oss.qualcomm.com, abhinav.kumar@linux.dev,
	bod@kernel.org, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: qcom: iris: fix runtime PM reference leaks
Date: Thu, 4 Jun 2026 10:00:29 +0800	[thread overview]
Message-ID: <36a64e47-9d61-4641-94fd-2568d86fd067@oss.qualcomm.com> (raw)
In-Reply-To: <20260604004404.34797-1-dennylin0707@gmail.com>



On 6/4/2026 8:44 AM, Hungyu Lin wrote:
> 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.
> 

Please add a fix tag for the fix patch.

Fixes: bb8a95aa038e ("media: iris: implement power management")

Thanks,
Jie

> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
> ---
>   drivers/media/platform/qcom/iris/iris_resources.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/media/platform/qcom/iris/iris_resources.c
> index 773f6548370a..f5e3341e1430 100644
> --- a/drivers/media/platform/qcom/iris/iris_resources.c
> +++ b/drivers/media/platform/qcom/iris/iris_resources.c
> @@ -78,11 +78,11 @@ 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)
> +	ret = pm_runtime_resume_and_get(pd_dev);
> +	if (ret)
>   		return ret;
>   
> -	return ret;
> +	return 0;
>   }
>   
>   int iris_disable_power_domains(struct iris_core *core, struct device *pd_dev)
> @@ -90,12 +90,10 @@ int iris_disable_power_domains(struct iris_core *core, struct device *pd_dev)
>   	int ret;
>   
>   	ret = iris_opp_set_rate(core->dev, 0);
> -	if (ret)
> -		return ret;
>   
>   	pm_runtime_put_sync(pd_dev);
>   
> -	return 0;
> +	return ret;
>   }
>   
>   static struct clk *iris_get_clk_by_type(struct iris_core *core, enum platform_clk_type clk_type)


      reply	other threads:[~2026-06-04  2:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  0:44 Hungyu Lin
2026-06-04  2:00 ` Jie Gan [this message]

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=36a64e47-9d61-4641-94fd-2568d86fd067@oss.qualcomm.com \
    --to=jie.gan@oss.qualcomm.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=bod@kernel.org \
    --cc=dennylin0707@gmail.com \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=vikash.garodia@oss.qualcomm.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

all inboxes | Powered by JetHome®