Hello,

> -----Original Message-----
> From: Damon Ding <[email protected]>
> Sent: Wednesday, November 25, 2026 4:34 PM
> To: Жандарович Никита Игоревич <[email protected]>; Andrzej
> Hajda <[email protected]>; Neil Armstrong
> <[email protected]>; Robert Foss <[email protected]>
> Cc: Laurent Pinchart <[email protected]>; Jonas Karlman
> <[email protected]>; Jernej Skrabec <[email protected]>; Luca
> Ceresoli <[email protected]>; Maarten Lankhorst
> <[email protected]>; Maxime Ripard
> <[email protected]>; Thomas Zimmermann <[email protected]>;
> David Airlie <[email protected]>; Simona Vetter <[email protected]>; Dmitry
> Baryshkov <[email protected]>; Sandy Huang
> <[email protected]>; Heiko Stübner <[email protected]>; Andy Yan
> <[email protected]>; Alexandre Marquet <[email protected]>; Marek
> Szyprowski <[email protected]>; linux-
> [email protected]; [email protected]; dri-
> [email protected]; [email protected]; lvc-
> [email protected]
> Subject: Re: [PATCH 2/3] drm/rockchip: analogix_dp: Disable pclk if setting
> eDP mode fails
> 
> 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 <[email protected]>
> > ---
> >   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

Thank you for your recommendation, I'll include this change in the v2 series.

Best regards,
Nikita

Reply via email to