Skip to content

Commit ee7e980

Browse files
committed
drm/nouveau/kms/nv50-: Disable AUX bus for disconnected DP ports
GSP has its own state for keeping track of whether or not a given display connector is plugged in or not, and enforces this state on the driver. In particular, AUX transactions on a DisplayPort connector which GSP says is disconnected can never succeed - and can in some cases even cause unexpected timeouts, which can trickle up to cause other problems. A good example of this is runtime power management: where we can actually get stuck trying to resume the GPU if a userspace application like fwupd tries accessing a drm_aux_dev for a disconnected port. This was an issue I hit a few times with my Slimbook Executive 16 - where trying to offload something to the discrete GPU would wake it up, and then potentially cause it to timeout as fwupd tried to immediately access the dp_aux_dev nodes for nouveau. Likewise: we don't really have any cases I know of where we'd want to ignore this state and try an aux transaction anyway - and failing pointless aux transactions immediately can even speed things up. So - let's start enabling/disabling the aux bus in nouveau_dp_detect() to fix this. We enable the aux bus during connector probing, and leave it enabled if we discover something is actually on the connector. Otherwise, we just shut it off. This should fix some people's runtime PM issues (like myself), and also get rid of quite of a lot of GSP error spam in dmesg. Signed-off-by: Lyude Paul <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 9c8a10b)
1 parent 35f4f8c commit ee7e980

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/nouveau/nouveau_dp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ nouveau_dp_detect(struct nouveau_connector *nv_connector,
232232
dpcd[DP_DPCD_REV] != 0)
233233
return NOUVEAU_DP_SST;
234234

235+
// Ensure that the aux bus is enabled for probing
236+
drm_dp_dpcd_set_powered(&nv_connector->aux, true);
237+
235238
mutex_lock(&nv_encoder->dp.hpd_irq_lock);
236239
if (mstm) {
237240
/* If we're not ready to handle MST state changes yet, just
@@ -293,6 +296,13 @@ nouveau_dp_detect(struct nouveau_connector *nv_connector,
293296
if (mstm && !mstm->suspended && ret != NOUVEAU_DP_MST)
294297
nv50_mstm_remove(mstm);
295298

299+
/* GSP doesn't like when we try to do aux transactions on a port it considers disconnected,
300+
* and since we don't really have a usecase for that anyway - just disable the aux bus here
301+
* if we've decided the connector is disconnected
302+
*/
303+
if (ret == NOUVEAU_DP_NONE)
304+
drm_dp_dpcd_set_powered(&nv_connector->aux, false);
305+
296306
mutex_unlock(&nv_encoder->dp.hpd_irq_lock);
297307
return ret;
298308
}

0 commit comments

Comments
 (0)