All of lore.kernel.org
 help / color / mirror / Atom feed
* Redo a modeset on link training failure
@ 2016-10-21  2:31 Manasi Navare
  2016-10-21  9:35 ` Ville Syrjälä
  0 siblings, 1 reply; 3+ messages in thread
From: Manasi Navare @ 2016-10-21  2:31 UTC (permalink / raw)
  To: intel-gfx

Hi Ville,

I have implemented the code that we discussed where if the link training
fails, it would validate the modes on the new constraints and call
an atomic helper like drm_atomic_helper_connector_modeset() to redo
a modeset for the same mode. The two patches for this implemnetation is
are:

http://paste.ubuntu.com/23357104/
http://paste.ubuntu.com/23357105/

With this I can successfully trigger the modeset and retrain the link
at lower link rate. But I am getting a warning during intel_audio_codec_enable()
in intel_enable_ddi() during the commit phase on SKL.
Following is the dmesg log:

http://paste.ubuntu.com/23357075/

After further looking at it, I see that this calls drm_select_eld() function
that throws a warning if the mode_config mutex and modeset locks are held.
If I remove those WARN_ONs from there, I can get rid of this warning and
everything works smoothly.

Do you know if those WARN_ONs are required because these locks would be grabbed
when we are in modeset.

Regards
Manasi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: Redo a modeset on link training failure
  2016-10-21  2:31 Redo a modeset on link training failure Manasi Navare
@ 2016-10-21  9:35 ` Ville Syrjälä
  2016-10-24  8:51   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2016-10-21  9:35 UTC (permalink / raw)
  To: Manasi Navare; +Cc: intel-gfx

On Thu, Oct 20, 2016 at 07:31:53PM -0700, Manasi Navare wrote:
> Hi Ville,
> 
> I have implemented the code that we discussed where if the link training
> fails, it would validate the modes on the new constraints and call
> an atomic helper like drm_atomic_helper_connector_modeset() to redo
> a modeset for the same mode. The two patches for this implemnetation is
> are:
> 
> http://paste.ubuntu.com/23357104/
> http://paste.ubuntu.com/23357105/
> 
> With this I can successfully trigger the modeset and retrain the link
> at lower link rate. But I am getting a warning during intel_audio_codec_enable()
> in intel_enable_ddi() during the commit phase on SKL.
> Following is the dmesg log:
> 
> http://paste.ubuntu.com/23357075/
> 
> After further looking at it, I see that this calls drm_select_eld() function
> that throws a warning if the mode_config mutex and modeset locks are held.

You get the warn when they're *not* held. And checking for the
mode_config.mutex here looks like a bug. We call that during a modeset,
so if we get there through the atomic ioctl as opposed to a legacy
setcrtc we will not be holding the mode_config.mutex.

Walking the connector list with just the connection mutex should be safe
in theory. Although last I looked it was still racy as hell, but as I
said, in theory.

We could probably drop the connector list walk from there entirely since
we should know exactly which connector's eld we want.

> If I remove those WARN_ONs from there, I can get rid of this warning and
> everything works smoothly.
> 
> Do you know if those WARN_ONs are required because these locks would be grabbed
> when we are in modeset.
> 
> Regards
> Manasi

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: Redo a modeset on link training failure
  2016-10-21  9:35 ` Ville Syrjälä
@ 2016-10-24  8:51   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2016-10-24  8:51 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

On Fri, Oct 21, 2016 at 12:35:44PM +0300, Ville Syrjälä wrote:
> On Thu, Oct 20, 2016 at 07:31:53PM -0700, Manasi Navare wrote:
> > Hi Ville,
> > 
> > I have implemented the code that we discussed where if the link training
> > fails, it would validate the modes on the new constraints and call
> > an atomic helper like drm_atomic_helper_connector_modeset() to redo
> > a modeset for the same mode. The two patches for this implemnetation is
> > are:
> > 
> > http://paste.ubuntu.com/23357104/
> > http://paste.ubuntu.com/23357105/
> > 
> > With this I can successfully trigger the modeset and retrain the link
> > at lower link rate. But I am getting a warning during intel_audio_codec_enable()
> > in intel_enable_ddi() during the commit phase on SKL.
> > Following is the dmesg log:
> > 
> > http://paste.ubuntu.com/23357075/
> > 
> > After further looking at it, I see that this calls drm_select_eld() function
> > that throws a warning if the mode_config mutex and modeset locks are held.
> 
> You get the warn when they're *not* held. And checking for the
> mode_config.mutex here looks like a bug. We call that during a modeset,
> so if we get there through the atomic ioctl as opposed to a legacy
> setcrtc we will not be holding the mode_config.mutex.
> 
> Walking the connector list with just the connection mutex should be safe
> in theory. Although last I looked it was still racy as hell, but as I
> said, in theory.
> 
> We could probably drop the connector list walk from there entirely since
> we should know exactly which connector's eld we want.

Yes, lets please avoid connector_list walks if we know what we're doing.
Which we really should here with link training.

Also spoiler on connector_list locking: It's probably going to be an
entirely new locking scheme for this one, independent of either
mode_config.mutex and mode_config.connection_mutex. Most likely invovling
some kind of rcu.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-10-24  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21  2:31 Redo a modeset on link training failure Manasi Navare
2016-10-21  9:35 ` Ville Syrjälä
2016-10-24  8:51   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.