public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable
@ 2023-09-21  9:14 Xin Ji
  2023-09-21 12:09 ` Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Xin Ji @ 2023-09-21  9:14 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter
  Cc: bliang, qwen, hsinyi, Xin Ji, dri-devel, linux-kernel

For the none-interrupt design(sink device is panel, polling HPD
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@analogixsemi.com>
---
 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);
+
 	ret = readx_poll_timeout(anx7625_read_hpd_status_p0,
 				 ctx, val,
 				 ((val & HPD_STATUS) || (val < 0)),
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable
  2023-09-21  9:14 [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable Xin Ji
@ 2023-09-21 12:09 ` Jani Nikula
  2023-09-21 12:13   ` Laurent Pinchart
  2023-09-22  7:00   ` Xin Ji
  0 siblings, 2 replies; 5+ messages in thread
From: Jani Nikula @ 2023-09-21 12:09 UTC (permalink / raw)
  To: Xin Ji, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec, David Airlie,
	Daniel Vetter
  Cc: qwen, linux-kernel, dri-devel, hsinyi, bliang, Xin Ji

On Thu, 21 Sep 2023, Xin Ji <xji@analogixsemi.com> wrote:
> For the none-interrupt design(sink device is panel, polling HPD
> 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@analogixsemi.com>
> ---
>  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?

BR,
Jani.

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

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable
  2023-09-21 12:09 ` Jani Nikula
@ 2023-09-21 12:13   ` Laurent Pinchart
  2023-09-22  6:57     ` Xin Ji
  2023-09-22  7:00   ` Xin Ji
  1 sibling, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2023-09-21 12:13 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Xin Ji, Andrzej Hajda, Neil Armstrong, Robert Foss, Jonas Karlman,
	Jernej Skrabec, David Airlie, Daniel Vetter, qwen, linux-kernel,
	dri-devel, hsinyi, bliang

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@analogixsemi.com> 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@analogixsemi.com>
> > ---
> >  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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable
  2023-09-21 12:13   ` Laurent Pinchart
@ 2023-09-22  6:57     ` Xin Ji
  0 siblings, 0 replies; 5+ messages in thread
From: Xin Ji @ 2023-09-22  6:57 UTC (permalink / raw)
  To: Laurent Pinchart, Jani Nikula
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Jonas Karlman,
	Jernej Skrabec, David Airlie, Daniel Vetter, Qilin Wen,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	hsinyi@chromium.org, Bernie Liang

Hi Laurent Pinchart, thanks for reviewing, I'll update the new patch, thanks!
Xin

> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: Thursday, September 21, 2023 8:13 PM
> To: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Xin Ji <xji@analogixsemi.com>; Andrzej Hajda <andrzej.hajda@intel.com>;
> Neil Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>;
> Jonas Karlman <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>;
> David Airlie <airlied@gmail.com>; Daniel Vetter <daniel@ffwll.ch>; Qilin Wen
> <qwen@analogixsemi.com>; linux-kernel@vger.kernel.org; dri-
> devel@lists.freedesktop.org; hsinyi@chromium.org; Bernie Liang
> <bliang@analogixsemi.com>
> Subject: Re: [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable
> 
> CAUTION: This email originated from outside of the organization. Please do not
> click links or open attachments unless you recognize the sender, and know the
> content is safe.
> 
> 
> 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@analogixsemi.com> wrote:
> > > For the none-interrupt design(sink device is panel, polling HPD
> 
> s/none-interrupt/no-interrupt/ ?
OK
> 
> s/design/design /
OK
> 
> > > 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@analogixsemi.com>
> > > ---
> > >  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.
OK
> 
> > > +
> > >     ret = readx_poll_timeout(anx7625_read_hpd_status_p0,
> > >                              ctx, val,
> > >                              ((val & HPD_STATUS) || (val < 0)),
> 
> --
> Regards,
> 
> Laurent Pinchart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable
  2023-09-21 12:09 ` Jani Nikula
  2023-09-21 12:13   ` Laurent Pinchart
@ 2023-09-22  7:00   ` Xin Ji
  1 sibling, 0 replies; 5+ messages in thread
From: Xin Ji @ 2023-09-22  7:00 UTC (permalink / raw)
  To: Jani Nikula, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec, David Airlie,
	Daniel Vetter
  Cc: Qilin Wen, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, hsinyi@chromium.org,
	Bernie Liang

Hi Jani Nikula, thanks for reviewing, I'll use msleep instead,  thanks!
Xin

> -----Original Message-----
> From: Jani Nikula <jani.nikula@linux.intel.com>
> Sent: Thursday, September 21, 2023 8:09 PM
> To: Xin Ji <xji@analogixsemi.com>; Andrzej Hajda <andrzej.hajda@intel.com>;
> Neil Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>;
> Laurent Pinchart <Laurent.pinchart@ideasonboard.com>; Jonas Karlman
> <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>; David Airlie
> <airlied@gmail.com>; Daniel Vetter <daniel@ffwll.ch>
> Cc: Qilin Wen <qwen@analogixsemi.com>; linux-kernel@vger.kernel.org; dri-
> devel@lists.freedesktop.org; hsinyi@chromium.org; Bernie Liang
> <bliang@analogixsemi.com>; Xin Ji <xji@analogixsemi.com>
> Subject: Re: [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable
> 
> On Thu, 21 Sep 2023, Xin Ji <xji@analogixsemi.com> wrote:
> > For the none-interrupt design(sink device is panel, polling HPD 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@analogixsemi.com>
> > ---
> >  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?
OK
> 
> BR,
> Jani.
> 
> > +
> >  	ret = readx_poll_timeout(anx7625_read_hpd_status_p0,
> >  				 ctx, val,
> >  				 ((val & HPD_STATUS) || (val < 0)),
> 
> --
> Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-22  7:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21  9:14 [PATCH] drm/bridge: Add 200ms delay to wait FW HPD status stable Xin Ji
2023-09-21 12:09 ` Jani Nikula
2023-09-21 12:13   ` Laurent Pinchart
2023-09-22  6:57     ` Xin Ji
2023-09-22  7:00   ` Xin Ji

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox