[PATCH 1/1] drm/amd/display: Retry AUX write when fail occurs

Aaron Ma aaron.ma at canonical.com
Fri Oct 23 07:07:23 UTC 2020

From: Wayne Lin <Wayne.Lin at amd.com>

BugLink: https://bugs.launchpad.net/bugs/1901135

In dm_dp_aux_transfer() now, we forget to handle AUX_WR fail cases. We
suppose every write wil get done successfully and hence some AUX
commands might not sent out indeed.

Check if AUX_WR success. If not, retry it.

Signed-off-by: Wayne Lin <Wayne.Lin at amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu at amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
(cherry picked from commit ef67d792a2fc578319399f605fbec2f99ecc06ea)
Signed-off-by: Aaron Ma <aaron.ma at canonical.com>
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index da73161043d5..1857d1127627 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -110,7 +110,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 	result = dc_link_aux_transfer_raw(TO_DM_AUX(aux)->ddc_service, &payload,
-	if (payload.write)
+	if (payload.write && result >= 0)
 		result = msg->size;
 	if (result < 0)

More information about the kernel-team mailing list