Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Damon Ding <damon.ding@rock-chips.com>
To: Nikita Zhandarovich <n.zhandarovich@fintech.ru>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>
Cc: "Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"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>,
	"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
	"Sandy Huang" <hjc@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>, "Andy Yan" <andyshrk@163.com>,
	"Alexandre Marquet" <tb@a-marquet.fr>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	lvc-project@linuxtesting.org
Subject: Re: [PATCH 2/3] drm/rockchip: analogix_dp: Disable pclk if setting eDP mode fails
Date: Wed, 25 Nov 2026 21:33:37 +0800	[thread overview]
Message-ID: <cb5cc4d5-150a-4215-a894-3b9c66db06fd@rock-chips.com> (raw)
In-Reply-To: <20261125114319.1089186-3-n.zhandarovich@fintech.ru>

Hi Nikita,

On 11/25/2026 7:43 PM, Nikita Zhandarovich wrote:
> The eDP-mode register write via rockchip_grf_field_write() call can
> fail after pclk has been enabled. To prevent this, disable pclk before
> returning that error so the platform power_on callback, in turn,
> releases the clock reference it acquired on failure.
> 
> Fixes: 729f8eefdcad ("drm/rockchip: analogix_dp: Add support for RK3588")
> Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
> ---
>   drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index 3a80600eece1..a9056303a987 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -145,8 +145,10 @@ static int rockchip_dp_poweron(struct analogix_dp_plat_data *plat_data)
>   	}
>   
>   	ret = rockchip_grf_field_write(dp->grf, &dp->data->edp_mode, 1);
> -	if (ret != 0)
> +	if (ret != 0) {
>   		DRM_DEV_ERROR(dp->dev, "failed to set edp mode %d\n", ret);
> +		clk_disable_unprepare(dp->pclk);
> +	}
>   
>   	return ret;
>   }

For the earlier rockchip_dp_pre_init(), I think a goto-based error path
might be cleaner.

Best regards,
Damon



  reply	other threads:[~2026-11-25 13:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 11:43 [PATCH 0/3] drm: analogix_dp: Handle runtime resume failures Nikita Zhandarovich
2026-11-25 11:43 ` [PATCH 1/3] drm/bridge: analogix_dp: Check runtime resume before accessing hardware Nikita Zhandarovich
2026-11-25 11:43 ` [PATCH 2/3] drm/rockchip: analogix_dp: Disable pclk if setting eDP mode fails Nikita Zhandarovich
2026-11-25 13:33   ` Damon Ding [this message]
2026-11-25 13:35     ` Жандарович Никита Игоревич
2026-11-25 11:43 ` [PATCH 3/3] drm/bridge: analogix_dp: Propagate errors from runtime resume Nikita Zhandarovich

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=cb5cc4d5-150a-4215-a894-3b9c66db06fd@rock-chips.com \
    --to=damon.ding@rock-chips.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=andyshrk@163.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=lvc-project@linuxtesting.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=n.zhandarovich@fintech.ru \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tb@a-marquet.fr \
    --cc=tzimmermann@suse.de \
    /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