diff mbox series

[v3,7/7] drm/bridge: ti-sn65dsi86: Add mystery delay to enable()

Message ID 20180813213058.184821-8-sean@poorly.run (mailing list archive)
State New, archived
Headers show
Series drm/bridge: ti-sn65dsi86: Fix bridge for non always-on regulators | expand

Commit Message

Sean Paul Aug. 13, 2018, 9:30 p.m. UTC
From: Sean Paul <seanpaul@chromium.org>

This patch adds a 70ms mystery delay to the bridge driver in enable.
By experimentation, it seems like it can go anywhere up until we
initiate semi-auto link training. If we don't have the delay, link
training fails.

I tried to root cause this as best I could, but neither the datasheet
for the panel nor the bridge mention a delay of this magnitude in their
timing requirements. So for now, add the mystery delay until someone
figures out a better fix.

Changes in v3:
- Added to the set

Cc: Sandeep Panda <spanda@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Sandeep Panda Aug. 14, 2018, 11:29 a.m. UTC | #1
On 2018-08-14 03:00, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> This patch adds a 70ms mystery delay to the bridge driver in enable.
> By experimentation, it seems like it can go anywhere up until we
> initiate semi-auto link training. If we don't have the delay, link
> training fails.
> 
> I tried to root cause this as best I could, but neither the datasheet
> for the panel nor the bridge mention a delay of this magnitude in their
> timing requirements. So for now, add the mystery delay until someone
> figures out a better fix.
> 
> Changes in v3:
> - Added to the set
> 
> Cc: Sandeep Panda <spanda@codeaurora.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> index d3e27e52ea759..f8a931cf3665e 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge 
> *bridge)
>  	unsigned int val;
>  	int ret;
> 
> +	/*
> +	 * FIXME:
> +	 * This 70ms was found necessary by experimentation. If it's not
> +	 * present, link training fails. It seems like it can go anywhere 
> from
> +	 * pre_enable() up to semi-auto link training initiation below.
> +	 *
> +	 * Neither the datasheet for the bridge nor the panel tested mention 
> a
> +	 * delay of this magnitude in the timing requirements. So for now, 
> add
> +	 * the mystery delay until someone figures out a better fix.
> +	 */

Is this newly found issue? Specific to any board config?

> +	msleep(70);
> +
>  	/* DSI_A lane config */
>  	val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
>  	regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,
Sean Paul Aug. 14, 2018, 2 p.m. UTC | #2
On Tue, Aug 14, 2018 at 04:59:31PM +0530, spanda@codeaurora.org wrote:
> On 2018-08-14 03:00, Sean Paul wrote:
> > From: Sean Paul <seanpaul@chromium.org>
> > 
> > This patch adds a 70ms mystery delay to the bridge driver in enable.
> > By experimentation, it seems like it can go anywhere up until we
> > initiate semi-auto link training. If we don't have the delay, link
> > training fails.
> > 
> > I tried to root cause this as best I could, but neither the datasheet
> > for the panel nor the bridge mention a delay of this magnitude in their
> > timing requirements. So for now, add the mystery delay until someone
> > figures out a better fix.
> > 
> > Changes in v3:
> > - Added to the set
> > 
> > Cc: Sandeep Panda <spanda@codeaurora.org>
> > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> > ---
> >  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > index d3e27e52ea759..f8a931cf3665e 100644
> > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge
> > *bridge)
> >  	unsigned int val;
> >  	int ret;
> > 
> > +	/*
> > +	 * FIXME:
> > +	 * This 70ms was found necessary by experimentation. If it's not
> > +	 * present, link training fails. It seems like it can go anywhere from
> > +	 * pre_enable() up to semi-auto link training initiation below.
> > +	 *
> > +	 * Neither the datasheet for the bridge nor the panel tested mention a
> > +	 * delay of this magnitude in the timing requirements. So for now, add
> > +	 * the mystery delay until someone figures out a better fix.
> > +	 */
> 
> Is this newly found issue? Specific to any board config?

It's specific to cheza. This was found with swboyd changed the panel regulator
from always-on/boot-on to toggle.

I've pushed the tag "mtp-testing-0813" to dpu-staging so you can play around
with it. Without this delay, link training fails.

Sean

> 
> > +	msleep(70);
> > +
> >  	/* DSI_A lane config */
> >  	val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
> >  	regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,
Sean Paul Aug. 14, 2018, 2:01 p.m. UTC | #3
On Tue, Aug 14, 2018 at 10:00:33AM -0400, Sean Paul wrote:
> On Tue, Aug 14, 2018 at 04:59:31PM +0530, spanda@codeaurora.org wrote:
> > On 2018-08-14 03:00, Sean Paul wrote:
> > > From: Sean Paul <seanpaul@chromium.org>
> > > 
> > > This patch adds a 70ms mystery delay to the bridge driver in enable.
> > > By experimentation, it seems like it can go anywhere up until we
> > > initiate semi-auto link training. If we don't have the delay, link
> > > training fails.
> > > 
> > > I tried to root cause this as best I could, but neither the datasheet
> > > for the panel nor the bridge mention a delay of this magnitude in their
> > > timing requirements. So for now, add the mystery delay until someone
> > > figures out a better fix.
> > > 
> > > Changes in v3:
> > > - Added to the set
> > > 
> > > Cc: Sandeep Panda <spanda@codeaurora.org>
> > > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> > > ---
> > >  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > > b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > > index d3e27e52ea759..f8a931cf3665e 100644
> > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > > @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge
> > > *bridge)
> > >  	unsigned int val;
> > >  	int ret;
> > > 
> > > +	/*
> > > +	 * FIXME:
> > > +	 * This 70ms was found necessary by experimentation. If it's not
> > > +	 * present, link training fails. It seems like it can go anywhere from
> > > +	 * pre_enable() up to semi-auto link training initiation below.
> > > +	 *
> > > +	 * Neither the datasheet for the bridge nor the panel tested mention a
> > > +	 * delay of this magnitude in the timing requirements. So for now, add
> > > +	 * the mystery delay until someone figures out a better fix.
> > > +	 */
> > 
> > Is this newly found issue? Specific to any board config?
> 
> It's specific to cheza. 

Well, I suppose I shouldn't say that since I've not tried the bridge on another
board. I should say, it reproduces on cheza.

Sean

> This was found with swboyd changed the panel regulator
> from always-on/boot-on to toggle.
> 
> I've pushed the tag "mtp-testing-0813" to dpu-staging so you can play around
> with it. Without this delay, link training fails.
> 
> Sean
> 
> > 
> > > +	msleep(70);
> > > +
> > >  	/* DSI_A lane config */
> > >  	val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
> > >  	regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,
> 
> -- 
> Sean Paul, Software Engineer, Google / Chromium OS
Sean Paul Aug. 23, 2018, 2:25 p.m. UTC | #4
On Tue, Aug 14, 2018 at 10:01:45AM -0400, Sean Paul wrote:
> On Tue, Aug 14, 2018 at 10:00:33AM -0400, Sean Paul wrote:
> > On Tue, Aug 14, 2018 at 04:59:31PM +0530, spanda@codeaurora.org wrote:
> > > On 2018-08-14 03:00, Sean Paul wrote:
> > > > From: Sean Paul <seanpaul@chromium.org>
> > > > 
> > > > This patch adds a 70ms mystery delay to the bridge driver in enable.
> > > > By experimentation, it seems like it can go anywhere up until we
> > > > initiate semi-auto link training. If we don't have the delay, link
> > > > training fails.
> > > > 
> > > > I tried to root cause this as best I could, but neither the datasheet
> > > > for the panel nor the bridge mention a delay of this magnitude in their
> > > > timing requirements. So for now, add the mystery delay until someone
> > > > figures out a better fix.
> > > > 
> > > > Changes in v3:
> > > > - Added to the set
> > > > 
> > > > Cc: Sandeep Panda <spanda@codeaurora.org>
> > > > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> > > > ---
> > > >  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
> > > >  1 file changed, 12 insertions(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > > > b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > > > index d3e27e52ea759..f8a931cf3665e 100644
> > > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > > > @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge
> > > > *bridge)
> > > >  	unsigned int val;
> > > >  	int ret;
> > > > 
> > > > +	/*
> > > > +	 * FIXME:
> > > > +	 * This 70ms was found necessary by experimentation. If it's not
> > > > +	 * present, link training fails. It seems like it can go anywhere from
> > > > +	 * pre_enable() up to semi-auto link training initiation below.
> > > > +	 *
> > > > +	 * Neither the datasheet for the bridge nor the panel tested mention a
> > > > +	 * delay of this magnitude in the timing requirements. So for now, add
> > > > +	 * the mystery delay until someone figures out a better fix.
> > > > +	 */
> > > 
> > > Is this newly found issue? Specific to any board config?
> > 
> > It's specific to cheza. 
> 
> Well, I suppose I shouldn't say that since I've not tried the bridge on another
> board. I should say, it reproduces on cheza.

Ping. Sandeep: any more feedback?

Sean

> 
> Sean
> 
> > This was found with swboyd changed the panel regulator
> > from always-on/boot-on to toggle.
> > 
> > I've pushed the tag "mtp-testing-0813" to dpu-staging so you can play around
> > with it. Without this delay, link training fails.
> > 
> > Sean
> > 
> > > 
> > > > +	msleep(70);
> > > > +
> > > >  	/* DSI_A lane config */
> > > >  	val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
> > > >  	regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,
> > 
> > -- 
> > Sean Paul, Software Engineer, Google / Chromium OS
> 
> -- 
> Sean Paul, Software Engineer, Google / Chromium OS
Sandeep Panda Aug. 26, 2018, 5:44 a.m. UTC | #5
On 2018-08-23 19:55, Sean Paul wrote:
> On Tue, Aug 14, 2018 at 10:01:45AM -0400, Sean Paul wrote:
>> On Tue, Aug 14, 2018 at 10:00:33AM -0400, Sean Paul wrote:
>> > On Tue, Aug 14, 2018 at 04:59:31PM +0530, spanda@codeaurora.org wrote:
>> > > On 2018-08-14 03:00, Sean Paul wrote:
>> > > > From: Sean Paul <seanpaul@chromium.org>
>> > > >
>> > > > This patch adds a 70ms mystery delay to the bridge driver in enable.
>> > > > By experimentation, it seems like it can go anywhere up until we
>> > > > initiate semi-auto link training. If we don't have the delay, link
>> > > > training fails.
>> > > >
>> > > > I tried to root cause this as best I could, but neither the datasheet
>> > > > for the panel nor the bridge mention a delay of this magnitude in their
>> > > > timing requirements. So for now, add the mystery delay until someone
>> > > > figures out a better fix.
>> > > >
>> > > > Changes in v3:
>> > > > - Added to the set
>> > > >
>> > > > Cc: Sandeep Panda <spanda@codeaurora.org>
>> > > > Signed-off-by: Sean Paul <seanpaul@chromium.org>
>> > > > ---
>> > > >  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
>> > > >  1 file changed, 12 insertions(+)
>> > > >
>> > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
>> > > > b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
>> > > > index d3e27e52ea759..f8a931cf3665e 100644
>> > > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
>> > > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
>> > > > @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge
>> > > > *bridge)
>> > > >  	unsigned int val;
>> > > >  	int ret;
>> > > >
>> > > > +	/*
>> > > > +	 * FIXME:
>> > > > +	 * This 70ms was found necessary by experimentation. If it's not
>> > > > +	 * present, link training fails. It seems like it can go anywhere from
>> > > > +	 * pre_enable() up to semi-auto link training initiation below.
>> > > > +	 *
>> > > > +	 * Neither the datasheet for the bridge nor the panel tested mention a
>> > > > +	 * delay of this magnitude in the timing requirements. So for now, add
>> > > > +	 * the mystery delay until someone figures out a better fix.
>> > > > +	 */
>> > >
>> > > Is this newly found issue? Specific to any board config?
>> >
>> > It's specific to cheza.
>> 
>> Well, I suppose I shouldn't say that since I've not tried the bridge 
>> on another
>> board. I should say, it reproduces on cheza.
> 
> Ping. Sandeep: any more feedback?
> 
> Sean
> 
>> 
>> Sean
>> 
>> > This was found with swboyd changed the panel regulator
>> > from always-on/boot-on to toggle.
>> >
>> > I've pushed the tag "mtp-testing-0813" to dpu-staging so you can play around
>> > with it. Without this delay, link training fails.
>> >
>> > Sean
>> >
>> > >
>> > > > +	msleep(70);
>> > > > +
>> > > >  	/* DSI_A lane config */
>> > > >  	val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
>> > > >  	regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,
>> >
>> > --
>> > Sean Paul, Software Engineer, Google / Chromium OS
>> 
>> --
>> Sean Paul, Software Engineer, Google / Chromium OS

No more comments from my side.

Sandeep
Sean Paul Aug. 26, 2018, 11:37 a.m. UTC | #6
On Sun, Aug 26, 2018, 1:44 AM <spanda@codeaurora.org> wrote:

> On 2018-08-23 19:55, Sean Paul wrote:
> > On Tue, Aug 14, 2018 at 10:01:45AM -0400, Sean Paul wrote:
> >> On Tue, Aug 14, 2018 at 10:00:33AM -0400, Sean Paul wrote:
> >> > On Tue, Aug 14, 2018 at 04:59:31PM +0530, spanda@codeaurora.org
> wrote:
> >> > > On 2018-08-14 03:00, Sean Paul wrote:
> >> > > > From: Sean Paul <seanpaul@chromium.org>
> >> > > >
> >> > > > This patch adds a 70ms mystery delay to the bridge driver in
> enable.
> >> > > > By experimentation, it seems like it can go anywhere up until we
> >> > > > initiate semi-auto link training. If we don't have the delay, link
> >> > > > training fails.
> >> > > >
> >> > > > I tried to root cause this as best I could, but neither the
> datasheet
> >> > > > for the panel nor the bridge mention a delay of this magnitude in
> their
> >> > > > timing requirements. So for now, add the mystery delay until
> someone
> >> > > > figures out a better fix.
> >> > > >
> >> > > > Changes in v3:
> >> > > > - Added to the set
> >> > > >
> >> > > > Cc: Sandeep Panda <spanda@codeaurora.org>
> >> > > > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> >> > > > ---
> >> > > >  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
> >> > > >  1 file changed, 12 insertions(+)
> >> > > >
> >> > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> >> > > > b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> >> > > > index d3e27e52ea759..f8a931cf3665e 100644
> >> > > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> >> > > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> >> > > > @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct
> drm_bridge
> >> > > > *bridge)
> >> > > >        unsigned int val;
> >> > > >        int ret;
> >> > > >
> >> > > > +      /*
> >> > > > +       * FIXME:
> >> > > > +       * This 70ms was found necessary by experimentation. If
> it's not
> >> > > > +       * present, link training fails. It seems like it can go
> anywhere from
> >> > > > +       * pre_enable() up to semi-auto link training initiation
> below.
> >> > > > +       *
> >> > > > +       * Neither the datasheet for the bridge nor the panel
> tested mention a
> >> > > > +       * delay of this magnitude in the timing requirements. So
> for now, add
> >> > > > +       * the mystery delay until someone figures out a better
> fix.
> >> > > > +       */
> >> > >
> >> > > Is this newly found issue? Specific to any board config?
> >> >
> >> > It's specific to cheza.
> >>
> >> Well, I suppose I shouldn't say that since I've not tried the bridge
> >> on another
> >> board. I should say, it reproduces on cheza.
> >
> > Ping. Sandeep: any more feedback?
> >
> > Sean
> >
> >>
> >> Sean
> >>
> >> > This was found with swboyd changed the panel regulator
> >> > from always-on/boot-on to toggle.
> >> >
> >> > I've pushed the tag "mtp-testing-0813" to dpu-staging so you can play
> around
> >> > with it. Without this delay, link training fails.
> >> >
> >> > Sean
> >> >
> >> > >
> >> > > > +      msleep(70);
> >> > > > +
> >> > > >        /* DSI_A lane config */
> >> > > >        val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
> >> > > >        regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,
> >> >
> >> > --
> >> > Sean Paul, Software Engineer, Google / Chromium OS
> >>
> >> --
> >> Sean Paul, Software Engineer, Google / Chromium OS
>
> No more comments from my side.
>

So, should I find another reviewer?

Sean


> Sandeep
>
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Aug 26, 2018, 1:44 AM  &lt;<a href="mailto:spanda@codeaurora.org" target="_blank" rel="noreferrer">spanda@codeaurora.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2018-08-23 19:55, Sean Paul wrote:<br>
&gt; On Tue, Aug 14, 2018 at 10:01:45AM -0400, Sean Paul wrote:<br>
&gt;&gt; On Tue, Aug 14, 2018 at 10:00:33AM -0400, Sean Paul wrote:<br>
&gt;&gt; &gt; On Tue, Aug 14, 2018 at 04:59:31PM +0530, <a href="mailto:spanda@codeaurora.org" rel="noreferrer noreferrer" target="_blank">spanda@codeaurora.org</a> wrote:<br>
&gt;&gt; &gt; &gt; On 2018-08-14 03:00, Sean Paul wrote:<br>
&gt;&gt; &gt; &gt; &gt; From: Sean Paul &lt;<a href="mailto:seanpaul@chromium.org" rel="noreferrer noreferrer" target="_blank">seanpaul@chromium.org</a>&gt;<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; This patch adds a 70ms mystery delay to the bridge driver in enable.<br>
&gt;&gt; &gt; &gt; &gt; By experimentation, it seems like it can go anywhere up until we<br>
&gt;&gt; &gt; &gt; &gt; initiate semi-auto link training. If we don&#39;t have the delay, link<br>
&gt;&gt; &gt; &gt; &gt; training fails.<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; I tried to root cause this as best I could, but neither the datasheet<br>
&gt;&gt; &gt; &gt; &gt; for the panel nor the bridge mention a delay of this magnitude in their<br>
&gt;&gt; &gt; &gt; &gt; timing requirements. So for now, add the mystery delay until someone<br>
&gt;&gt; &gt; &gt; &gt; figures out a better fix.<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; Changes in v3:<br>
&gt;&gt; &gt; &gt; &gt; - Added to the set<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; Cc: Sandeep Panda &lt;<a href="mailto:spanda@codeaurora.org" rel="noreferrer noreferrer" target="_blank">spanda@codeaurora.org</a>&gt;<br>
&gt;&gt; &gt; &gt; &gt; Signed-off-by: Sean Paul &lt;<a href="mailto:seanpaul@chromium.org" rel="noreferrer noreferrer" target="_blank">seanpaul@chromium.org</a>&gt;<br>
&gt;&gt; &gt; &gt; &gt; ---<br>
&gt;&gt; &gt; &gt; &gt;  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++<br>
&gt;&gt; &gt; &gt; &gt;  1 file changed, 12 insertions(+)<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c<br>
&gt;&gt; &gt; &gt; &gt; b/drivers/gpu/drm/bridge/ti-sn65dsi86.c<br>
&gt;&gt; &gt; &gt; &gt; index d3e27e52ea759..f8a931cf3665e 100644<br>
&gt;&gt; &gt; &gt; &gt; --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c<br>
&gt;&gt; &gt; &gt; &gt; +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c<br>
&gt;&gt; &gt; &gt; &gt; @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge<br>
&gt;&gt; &gt; &gt; &gt; *bridge)<br>
&gt;&gt; &gt; &gt; &gt;        unsigned int val;<br>
&gt;&gt; &gt; &gt; &gt;        int ret;<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; +      /*<br>
&gt;&gt; &gt; &gt; &gt; +       * FIXME:<br>
&gt;&gt; &gt; &gt; &gt; +       * This 70ms was found necessary by experimentation. If it&#39;s not<br>
&gt;&gt; &gt; &gt; &gt; +       * present, link training fails. It seems like it can go anywhere from<br>
&gt;&gt; &gt; &gt; &gt; +       * pre_enable() up to semi-auto link training initiation below.<br>
&gt;&gt; &gt; &gt; &gt; +       *<br>
&gt;&gt; &gt; &gt; &gt; +       * Neither the datasheet for the bridge nor the panel tested mention a<br>
&gt;&gt; &gt; &gt; &gt; +       * delay of this magnitude in the timing requirements. So for now, add<br>
&gt;&gt; &gt; &gt; &gt; +       * the mystery delay until someone figures out a better fix.<br>
&gt;&gt; &gt; &gt; &gt; +       */<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Is this newly found issue? Specific to any board config?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; It&#39;s specific to cheza.<br>
&gt;&gt; <br>
&gt;&gt; Well, I suppose I shouldn&#39;t say that since I&#39;ve not tried the bridge <br>
&gt;&gt; on another<br>
&gt;&gt; board. I should say, it reproduces on cheza.<br>
&gt; <br>
&gt; Ping. Sandeep: any more feedback?<br>
&gt; <br>
&gt; Sean<br>
&gt; <br>
&gt;&gt; <br>
&gt;&gt; Sean<br>
&gt;&gt; <br>
&gt;&gt; &gt; This was found with swboyd changed the panel regulator<br>
&gt;&gt; &gt; from always-on/boot-on to toggle.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I&#39;ve pushed the tag &quot;mtp-testing-0813&quot; to dpu-staging so you can play around<br>
&gt;&gt; &gt; with it. Without this delay, link training fails.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Sean<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; +      msleep(70);<br>
&gt;&gt; &gt; &gt; &gt; +<br>
&gt;&gt; &gt; &gt; &gt;        /* DSI_A lane config */<br>
&gt;&gt; &gt; &gt; &gt;        val = CHA_DSI_LANES(4 - pdata-&gt;dsi-&gt;lanes);<br>
&gt;&gt; &gt; &gt; &gt;        regmap_update_bits(pdata-&gt;regmap, SN_DSI_LANES_REG,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Sean Paul, Software Engineer, Google / Chromium OS<br>
&gt;&gt; <br>
&gt;&gt; --<br>
&gt;&gt; Sean Paul, Software Engineer, Google / Chromium OS<br>
<br>
No more comments from my side.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">So, should I find another reviewer? </div><div dir="auto"><br></div><div dir="auto">Sean</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Sandeep<br>
</blockquote></div></div></div>
Sandeep Panda Aug. 27, 2018, 2:10 a.m. UTC | #7
On 2018-08-14 03:00, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> This patch adds a 70ms mystery delay to the bridge driver in enable.
> By experimentation, it seems like it can go anywhere up until we
> initiate semi-auto link training. If we don't have the delay, link
> training fails.
> 
> I tried to root cause this as best I could, but neither the datasheet
> for the panel nor the bridge mention a delay of this magnitude in their
> timing requirements. So for now, add the mystery delay until someone
> figures out a better fix.
> 
> Changes in v3:
> - Added to the set
> 
> Cc: Sandeep Panda <spanda@codeaurora.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> index d3e27e52ea759..f8a931cf3665e 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge 
> *bridge)
>  	unsigned int val;
>  	int ret;
> 
> +	/*
> +	 * FIXME:
> +	 * This 70ms was found necessary by experimentation. If it's not
> +	 * present, link training fails. It seems like it can go anywhere 
> from
> +	 * pre_enable() up to semi-auto link training initiation below.
> +	 *
> +	 * Neither the datasheet for the bridge nor the panel tested mention 
> a
> +	 * delay of this magnitude in the timing requirements. So for now, 
> add
> +	 * the mystery delay until someone figures out a better fix.
> +	 */
> +	msleep(70);
> +
>  	/* DSI_A lane config */
>  	val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
>  	regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,

Reviewed-by: Sandeep Panda <spanda@codeaurora.org>
Sean Paul Aug. 27, 2018, 3:28 p.m. UTC | #8
On Mon, Aug 27, 2018 at 07:40:05AM +0530, spanda@codeaurora.org wrote:
> On 2018-08-14 03:00, Sean Paul wrote:
> > From: Sean Paul <seanpaul@chromium.org>
> > 
> > This patch adds a 70ms mystery delay to the bridge driver in enable.
> > By experimentation, it seems like it can go anywhere up until we
> > initiate semi-auto link training. If we don't have the delay, link
> > training fails.
> > 
> > I tried to root cause this as best I could, but neither the datasheet
> > for the panel nor the bridge mention a delay of this magnitude in their
> > timing requirements. So for now, add the mystery delay until someone
> > figures out a better fix.
> > 
> > Changes in v3:
> > - Added to the set
> > 
> > Cc: Sandeep Panda <spanda@codeaurora.org>
> > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> > ---
> >  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > index d3e27e52ea759..f8a931cf3665e 100644
> > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> > @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge
> > *bridge)
> >  	unsigned int val;
> >  	int ret;
> > 
> > +	/*
> > +	 * FIXME:
> > +	 * This 70ms was found necessary by experimentation. If it's not
> > +	 * present, link training fails. It seems like it can go anywhere from
> > +	 * pre_enable() up to semi-auto link training initiation below.
> > +	 *
> > +	 * Neither the datasheet for the bridge nor the panel tested mention a
> > +	 * delay of this magnitude in the timing requirements. So for now, add
> > +	 * the mystery delay until someone figures out a better fix.
> > +	 */
> > +	msleep(70);
> > +
> >  	/* DSI_A lane config */
> >  	val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
> >  	regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,
> 
> Reviewed-by: Sandeep Panda <spanda@codeaurora.org>

Pushed to -misc-next, thanks for your reviews.

Sean
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index d3e27e52ea759..f8a931cf3665e 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -458,6 +458,18 @@  static void ti_sn_bridge_enable(struct drm_bridge *bridge)
 	unsigned int val;
 	int ret;
 
+	/*
+	 * FIXME:
+	 * This 70ms was found necessary by experimentation. If it's not
+	 * present, link training fails. It seems like it can go anywhere from
+	 * pre_enable() up to semi-auto link training initiation below.
+	 *
+	 * Neither the datasheet for the bridge nor the panel tested mention a
+	 * delay of this magnitude in the timing requirements. So for now, add
+	 * the mystery delay until someone figures out a better fix.
+	 */
+	msleep(70);
+
 	/* DSI_A lane config */
 	val = CHA_DSI_LANES(4 - pdata->dsi->lanes);
 	regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,