dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Chen-Yu Tsai <wens@kernel.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>,
	Samuel Holland <samuel@sholland.org>,
	Jiawen Liu <1298662399@qq.com>
Cc: dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/sun4i: frontend: handle runtime resume failures
Date: Mon, 30 Nov 2026 19:16:10 +0100	[thread overview]
Message-ID: <o7QP7Z6sRwW0iBK9CTni_g@gmail.com> (raw)
In-Reply-To: <tencent_FE8075BF4F9599F5D94535907EBA2C4E6708@qq.com>

Dne nedelja, 29. november 2026 ob 13:58:00 Srednjeevropski standardni čas je Jiawen Liu napisal(a):
> sun4i_frontend_runtime_resume() ignores failures from all three clock
> enables. It can then touch the frontend registers and report a successful
> resume without establishing the clocks required by the hardware. A reset
> failure also returns without releasing clocks enabled during that resume.
> 
> Check each clock enable in order, unwind only the clocks already enabled,
> and use the same unwind path for reset failure.
> 
> Fixes: dd0421f47505 ("drm/sun4i: Add a driver for the display frontend")
> Signed-off-by: Jiawen Liu <1298662399@qq.com>

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Unrelated to the patch content: this series isn't threaded on lore.
Your 2/2 has In-Reply-To pointing to the X-OQ-MSGID of this patch, so
it looks like QQ mail rewrites Message-ID on the way out and breaks the
chain git send-email generates. For v2, consider sending through the
b4 web submission endpoint (b4 send) or another SMTP provider, and
please include a cover letter.

Best regards,
Jernej

> ---
>  drivers/gpu/drm/sun4i/sun4i_frontend.c | 24 ++++++++++++++++++++----
>  1 file changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c
> index 7dc0a09bb3c54..13cad3a498b36 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c
> @@ -647,14 +647,22 @@ static int sun4i_frontend_runtime_resume(struct device *dev)
>  
>  	clk_set_rate(frontend->mod_clk, 300000000);
>  
> -	clk_prepare_enable(frontend->bus_clk);
> -	clk_prepare_enable(frontend->mod_clk);
> -	clk_prepare_enable(frontend->ram_clk);
> +	ret = clk_prepare_enable(frontend->bus_clk);
> +	if (ret)
> +		return ret;
> +
> +	ret = clk_prepare_enable(frontend->mod_clk);
> +	if (ret)
> +		goto err_bus;
> +
> +	ret = clk_prepare_enable(frontend->ram_clk);
> +	if (ret)
> +		goto err_mod;
>  
>  	ret = reset_control_reset(frontend->reset);
>  	if (ret) {
>  		dev_err(dev, "Couldn't reset our device\n");
> -		return ret;
> +		goto err_ram;
>  	}
>  
>  	regmap_update_bits(frontend->regs, SUN4I_FRONTEND_EN_REG,
> @@ -664,6 +672,14 @@ static int sun4i_frontend_runtime_resume(struct device *dev)
>  	sun4i_frontend_scaler_init(frontend);
>  
>  	return 0;
> +
> +err_ram:
> +	clk_disable_unprepare(frontend->ram_clk);
> +err_mod:
> +	clk_disable_unprepare(frontend->mod_clk);
> +err_bus:
> +	clk_disable_unprepare(frontend->bus_clk);
> +	return ret;
>  }
>  
>  static int sun4i_frontend_runtime_suspend(struct device *dev)
> 





      reply	other threads:[~2026-11-30 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 12:58 [PATCH 1/2] drm/sun4i: frontend: handle runtime resume failures Jiawen Liu
2026-11-30 18:16 ` Jernej Škrabec [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=o7QP7Z6sRwW0iBK9CTni_g@gmail.com \
    --to=jernej.skrabec@gmail.com \
    --cc=1298662399@qq.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=samuel@sholland.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=wens@kernel.org \
    /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