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

drm/radeon: Don't retry 7 times in radeon_dp_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
84cefe18 19697539

+10 -11
+10 -11
drivers/gpu/drm/radeon/atombios_dp.c
··· 389 389 { 390 390 struct radeon_connector_atom_dig *dig_connector = radeon_connector->con_priv; 391 391 u8 msg[DP_DPCD_SIZE]; 392 - int ret, i; 392 + int ret; 393 393 394 - for (i = 0; i < 7; i++) { 395 - ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg, 396 - DP_DPCD_SIZE); 397 - if (ret == DP_DPCD_SIZE) { 398 - memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE); 394 + ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg, 395 + DP_DPCD_SIZE); 396 + if (ret == DP_DPCD_SIZE) { 397 + memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE); 399 398 400 - DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(dig_connector->dpcd), 401 - dig_connector->dpcd); 399 + DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(dig_connector->dpcd), 400 + dig_connector->dpcd); 402 401 403 - radeon_dp_probe_oui(radeon_connector); 402 + radeon_dp_probe_oui(radeon_connector); 404 403 405 - return true; 406 - } 404 + return true; 407 405 } 406 + 408 407 dig_connector->dpcd[0] = 0; 409 408 return false; 410 409 }