Re: [PATCH v2 3/3] drm/msm/dp: check main link status before start aux read
From: Stephen Boyd
Date: Thu Apr 15 2021 - 18:47:04 EST
Quoting khsieh@xxxxxxxxxxxxxx (2021-04-15 15:02:40)
> On 2021-04-15 13:06, Stephen Boyd wrote:
> >
> > Is it really necessary to have this patch at all? I think there are
> > bigger problems with suspend/resume of the DP driver in relation to the
> > kthread stopping. I hope that the aux channel would start NAKing
> > transfers once the cable is disconnected too, so that we don't need to
> > do an extra check for each aux transfer.
>
> I am working on duplicate this problem, but it is not happen on me yet
> so far.
> From kernel dump, i can see it crash at dp_irq_hdp_handle() after
> suspended.
> dp_irq_hpd_handle and dp_pm_suspend() are serialized by event_mutex.
>
> After suspend, ahb clock is disabled.
> Hence next dp_catalog_link_is_connected() crash at acess dp ctrl
> registers.
>
>
> aux channel does not do NAKing immediately if unplugged. Therefore
> aux_transfer will wait until timeout (HZ/4).
> worst, drm_dp_dpcd_access() will retry 32 times before return dpcd
> read/write failed.
> This patch try to eliminate the time spinning on waiting for timeout 32
> times.
>
Would be useful to have that level of detail in the commit text.
Maybe when the cable is disconnected the DP phy should be shutdown and
some bit in the phy could effectively "cut off" the aux channel and then
NAKs would start coming through here in the DP controller I/O register
space?