Skip to content

Commit dbc05ae

Browse files
committed
drm/dp_mst: Fix drm_dp_send_dpcd_write() return code
drm_dp_mst_wait_tx_reply() returns > 1 if time elapsed in wait_event_timeout() before check_txmsg_state(mgr, txmsg) evaluated to true. However, we make the mistake of returning this time from drm_dp_send_dpcd_write() on success instead of returning the number of bytes written - causing spontaneous failures during link probing: [drm:drm_dp_send_link_address [drm_kms_helper]] *ERROR* GUID check on 10:01 failed: 3975 Yikes! So, fix this by returning the number of bytes written on success instead. Signed-off-by: Lyude Paul <[email protected]> Fixes: cb89754 ("drm/dp_mst: Fix W=1 warnings") Cc: Benjamin Gaignard <[email protected]> Cc: Sean Paul <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a5bff92 commit dbc05ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/drm_dp_mst_topology.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3442,8 +3442,12 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr,
34423442
drm_dp_queue_down_tx(mgr, txmsg);
34433443

34443444
ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
3445-
if (ret > 0 && txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK)
3446-
ret = -EIO;
3445+
if (ret > 0) {
3446+
if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK)
3447+
ret = -EIO;
3448+
else
3449+
ret = size;
3450+
}
34473451

34483452
kfree(txmsg);
34493453
fail_put:

0 commit comments

Comments
 (0)