From: Ilya Bakoulin <ilya.bakou...@amd.com>

[Why]
Retrying on receiving a NACK can result in long overall EDID read times
in some cases.

[How]
Retry only on DEFER and return immediately on NACK.

Reviewed-by: Aric Cyr <aric....@amd.com>
Acked-by: Brian Chang <brian.ch...@amd.com>
Signed-off-by: Ilya Bakoulin <ilya.bakou...@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c 
b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
index 919c2c2ba84b..32782ef9ef77 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
@@ -814,12 +814,6 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
                                                                
"dce_aux_transfer_with_retries: AUX_RET_SUCCESS: 
AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER");
 
                                retry_on_defer = true;
-                               fallthrough;
-                       case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
-                               if (*payload->reply == 
AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK)
-                                       
DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
-                                                               
LOG_FLAG_I2cAux_DceAux,
-                                                               
"dce_aux_transfer_with_retries: AUX_RET_SUCCESS: 
AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK");
 
                                if (aux_defer_retries >= AUX_MIN_DEFER_RETRIES
                                                && defer_time_in_ms >= 
AUX_MAX_DEFER_TIMEOUT_MS) {
@@ -848,7 +842,11 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
                                        }
                                }
                                break;
-
+                       case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
+                               
DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
+                                                       LOG_FLAG_I2cAux_DceAux,
+                                                       
"dce_aux_transfer_with_retries: FAILURE: 
AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK");
+                               goto fail;
                        case AUX_TRANSACTION_REPLY_I2C_DEFER:
                                
DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
                                                        LOG_FLAG_I2cAux_DceAux,
-- 
2.25.1

Reply via email to