From: Akhil P Oommen <akhilpo@oss.qualcomm.com>
To: Haoxiang Li <haoxiang_li2024@163.com>,
robin.clark@oss.qualcomm.com, sean@poorly.run,
konradybcio@kernel.org, lumag@kernel.org,
abhinav.kumar@linux.dev, jesszhan0024@gmail.com,
marijn.suijten@somainline.org, airlied@gmail.com,
simona@ffwll.ch
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/msm/gpu: Unwind power and clocks on resume failure
Date: Fri, 27 Nov 2026 01:18:40 +0530 [thread overview]
Message-ID: <b95594e1-fb17-4058-abaa-e889eb6e952c@oss.qualcomm.com> (raw)
In-Reply-To: <20261119034718.2818183-1-haoxiang_li2024@163.com>
On 11/19/2026 9:17 AM, Haoxiang Li wrote:
> msm_gpu_pm_resume() returns without disabling the power rails when
> enabling the GPU clocks fails. If enabling the AXI clock fails, both
> the GPU clocks and power rails remain enabled. In addition,
> enable_pwrrail() leaves gpu_reg enabled if enabling gpu_cx fails.
>
> Disable gpu_reg when enabling gpu_cx fails, and unwind the completed
> power and clock stages in reverse order when resume fails.
>
> Fixes: 7198e6b03155 ("drm/msm: add a3xx gpu support")
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
-Akhil
> ---
> drivers/gpu/drm/msm/msm_gpu.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 8319119041eb..5480abe1aba2 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -40,6 +40,8 @@ static int enable_pwrrail(struct msm_gpu *gpu)
> ret = regulator_enable(gpu->gpu_cx);
> if (ret) {
> DRM_DEV_ERROR(dev->dev, "failed to enable 'gpu_cx': %d\n", ret);
> + if (gpu->gpu_reg)
> + regulator_disable(gpu->gpu_reg);
> return ret;
> }
> }
> @@ -110,17 +112,24 @@ int msm_gpu_pm_resume(struct msm_gpu *gpu)
>
> ret = enable_clk(gpu);
> if (ret)
> - return ret;
> + goto err_disable_pwrrail;
>
> ret = enable_axi(gpu);
> if (ret)
> - return ret;
> + goto err_disable_clk;
>
> msm_devfreq_resume(gpu);
>
> gpu->needs_hw_init = true;
>
> return 0;
> +
> +err_disable_clk:
> + disable_clk(gpu);
> +
> +err_disable_pwrrail:
> + disable_pwrrail(gpu);
> + return ret;
> }
>
> int msm_gpu_pm_suspend(struct msm_gpu *gpu)
prev parent reply other threads:[~2026-11-26 19:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 3:47 Haoxiang Li
2026-11-26 19:48 ` Akhil P Oommen [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=b95594e1-fb17-4058-abaa-e889eb6e952c@oss.qualcomm.com \
--to=akhilpo@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=haoxiang_li2024@163.com \
--cc=jesszhan0024@gmail.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=robin.clark@oss.qualcomm.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
/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®