Re: [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable

From: Laurent Pinchart
Date: Thu Sep 21 2023 - 13:12:08 EST


The subject line is missing the driver name.

On Thu, Sep 21, 2023 at 03:09:10PM +0300, Jani Nikula wrote:
> On Thu, 21 Sep 2023, Xin Ji <xji@xxxxxxxxxxxxxxxx> wrote:
> > For the none-interrupt design(sink device is panel, polling HPD

s/none-interrupt/no-interrupt/ ?

s/design/design /

> > status when chip power on), anx7625 FW has more than 200ms HPD
> > de-bounce time in FW, for the safety to get HPD status, driver
> > better to wait 200ms before HPD detection after OS resume back.
> >
> > Signed-off-by: Xin Ji <xji@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/gpu/drm/bridge/analogix/anx7625.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > index 51abe42c639e..833d6d50a03d 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > @@ -1464,6 +1464,9 @@ static int _anx7625_hpd_polling(struct anx7625_data *ctx,
> > if (ctx->pdata.intp_irq)
> > return 0;
> >
> > + /* Delay 200ms for FW HPD de-bounce */
> > + usleep_range(200000, 201000);
>
> If you need to sleep for 200 ms, maybe use msleep instead?

fsleep() could be a nice replacement.

> > +
> > ret = readx_poll_timeout(anx7625_read_hpd_status_p0,
> > ctx, val,
> > ((val & HPD_STATUS) || (val < 0)),

--
Regards,

Laurent Pinchart