diff options
| -rw-r--r-- | drivers/gpu/drm/drm_dp_mst_topology.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 9a5b68717ec8..379ab4555756 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c | |||
| @@ -733,10 +733,14 @@ static bool check_txmsg_state(struct drm_dp_mst_topology_mgr *mgr, | |||
| 733 | struct drm_dp_sideband_msg_tx *txmsg) | 733 | struct drm_dp_sideband_msg_tx *txmsg) |
| 734 | { | 734 | { |
| 735 | bool ret; | 735 | bool ret; |
| 736 | mutex_lock(&mgr->qlock); | 736 | |
| 737 | /* | ||
| 738 | * All updates to txmsg->state are protected by mgr->qlock, and the two | ||
| 739 | * cases we check here are terminal states. For those the barriers | ||
| 740 | * provided by the wake_up/wait_event pair are enough. | ||
| 741 | */ | ||
| 737 | ret = (txmsg->state == DRM_DP_SIDEBAND_TX_RX || | 742 | ret = (txmsg->state == DRM_DP_SIDEBAND_TX_RX || |
| 738 | txmsg->state == DRM_DP_SIDEBAND_TX_TIMEOUT); | 743 | txmsg->state == DRM_DP_SIDEBAND_TX_TIMEOUT); |
| 739 | mutex_unlock(&mgr->qlock); | ||
| 740 | return ret; | 744 | return ret; |
| 741 | } | 745 | } |
| 742 | 746 | ||
| @@ -1363,12 +1367,13 @@ static int process_single_tx_qlock(struct drm_dp_mst_topology_mgr *mgr, | |||
| 1363 | return 0; | 1367 | return 0; |
| 1364 | } | 1368 | } |
| 1365 | 1369 | ||
| 1366 | /* must be called holding qlock */ | ||
| 1367 | static void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr) | 1370 | static void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr) |
| 1368 | { | 1371 | { |
| 1369 | struct drm_dp_sideband_msg_tx *txmsg; | 1372 | struct drm_dp_sideband_msg_tx *txmsg; |
| 1370 | int ret; | 1373 | int ret; |
| 1371 | 1374 | ||
| 1375 | WARN_ON(!mutex_is_locked(&mgr->qlock)); | ||
| 1376 | |||
| 1372 | /* construct a chunk from the first msg in the tx_msg queue */ | 1377 | /* construct a chunk from the first msg in the tx_msg queue */ |
| 1373 | if (list_empty(&mgr->tx_msg_downq)) { | 1378 | if (list_empty(&mgr->tx_msg_downq)) { |
| 1374 | mgr->tx_down_in_progress = false; | 1379 | mgr->tx_down_in_progress = false; |
