aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikola Cornij <[email protected]>2021-04-30 19:34:29 -0400
committerAlex Deucher <[email protected]>2021-05-10 18:06:44 -0400
commitb86e7eef91ef11972f3f8971c438c174180a5943 (patch)
tree2601ae9a7181b9dd23e546718f1a2fd562296279
parentdf0a271cc794639ef537f21c4c56893e40972523 (diff)
drm/amd/display: Avoid gpio conflict on MST branch
[Why] Similar to SST branch, gpio conflict also needs to be avoided on MST. Without doing so, there is a chance that gpio conflict will occur if multiple gpio interrupts arrive simultaneously. [How] By mutex locking/unlocking &aconnector->hpd_lock, we won't get gpio conflict when handling hpd. Signed-off-by: Zhan Liu <[email protected]> Signed-off-by: Nikola Cornij <[email protected]> Reviewed-by: Bhawanpreet Lakha <[email protected]> Acked-by: Zhan Liu <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 225a92ebb1af..15070bff27fa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2708,8 +2708,7 @@ static void handle_hpd_rx_irq(void *param)
* conflict, after implement i2c helper, this mutex should be
* retired.
*/
- if (dc_link->type != dc_connection_mst_branch)
- mutex_lock(&aconnector->hpd_lock);
+ mutex_lock(&aconnector->hpd_lock);
read_hpd_rx_irq_data(dc_link, &hpd_irq_data);
@@ -2778,10 +2777,10 @@ out:
}
#endif
- if (dc_link->type != dc_connection_mst_branch) {
+ if (dc_link->type != dc_connection_mst_branch)
drm_dp_cec_irq(&aconnector->dm_dp_aux.aux);
- mutex_unlock(&aconnector->hpd_lock);
- }
+
+ mutex_unlock(&aconnector->hpd_lock);
}
static void register_hpd_handlers(struct amdgpu_device *adev)