]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Retry AUX write when fail occurs
authorWayne Lin <Wayne.Lin@amd.com>
Tue, 18 Aug 2020 03:19:42 +0000 (11:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:12:22 +0000 (19:12 +0200)
[ Upstream commit ef67d792a2fc578319399f605fbec2f99ecc06ea ]

[Why]
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.

[How]
Check if AUX_WR success. If not, retry it.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

index 28a6c7b2ef4bba22ca4392429012d31e373fa8b3..2f858507ca7025596e74119a2017bd2f884d724b 100644 (file)
@@ -101,7 +101,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,
                                      &operation_result);
 
-       if (payload.write)
+       if (payload.write && result >= 0)
                result = msg->size;
 
        if (result < 0)