Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Don't retry 7 times in amdgpu_atombios_dp_get_dpcd()

When this code was written, we didn't retry DP aux transactions on any
error, which required retrying important transactions like this in
individual drivers. Since that's no longer the case, retrying here is
not necessary. As well, we retry any aux transaction on any error 32
times. 7 * 32 = 224, which means this loop causes us to retry grabbing
the dpcd 224 times. This is definitely far more then we actually need to
do.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Lyude <cpaul@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lyude and committed by
Alex Deucher
14a2fb48 aff80295

+10 -11
+10 -11
drivers/gpu/drm/amd/amdgpu/atombios_dp.c
··· 338 338 { 339 339 struct amdgpu_connector_atom_dig *dig_connector = amdgpu_connector->con_priv; 340 340 u8 msg[DP_DPCD_SIZE]; 341 - int ret, i; 341 + int ret; 342 342 343 - for (i = 0; i < 7; i++) { 344 - ret = drm_dp_dpcd_read(&amdgpu_connector->ddc_bus->aux, DP_DPCD_REV, msg, 345 - DP_DPCD_SIZE); 346 - if (ret == DP_DPCD_SIZE) { 347 - memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE); 343 + ret = drm_dp_dpcd_read(&amdgpu_connector->ddc_bus->aux, DP_DPCD_REV, 344 + msg, DP_DPCD_SIZE); 345 + if (ret == DP_DPCD_SIZE) { 346 + memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE); 348 347 349 - DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(dig_connector->dpcd), 350 - dig_connector->dpcd); 348 + DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(dig_connector->dpcd), 349 + dig_connector->dpcd); 351 350 352 - amdgpu_atombios_dp_probe_oui(amdgpu_connector); 351 + amdgpu_atombios_dp_probe_oui(amdgpu_connector); 353 352 354 - return 0; 355 - } 353 + return 0; 356 354 } 355 + 357 356 dig_connector->dpcd[0] = 0; 358 357 return -EINVAL; 359 358 }