aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4711-drm-amd-display-Increase-the-number-of-retries-after.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4711-drm-amd-display-Increase-the-number-of-retries-after.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4711-drm-amd-display-Increase-the-number-of-retries-after.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4711-drm-amd-display-Increase-the-number-of-retries-after.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4711-drm-amd-display-Increase-the-number-of-retries-after.patch
new file mode 100644
index 00000000..baa1bce5
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4711-drm-amd-display-Increase-the-number-of-retries-after.patch
@@ -0,0 +1,84 @@
+From 84f4c6b08f0e37320574201bfa16302a000cecdc Mon Sep 17 00:00:00 2001
+From: George Shen <george.shen@amd.com>
+Date: Fri, 15 Nov 2019 18:56:57 -0500
+Subject: [PATCH 4711/4736] drm/amd/display: Increase the number of retries
+ after AUX DEFER
+
+[Why]
+When a timeout occurs after a DEFER, some devices require more retries
+than in the case of a regular timeout.
+
+[How]
+In a timeout occurrence, check whether a DEFER has occurred before the
+timeout and retry MAX_DEFER_RETRIES retries times instead of
+MAX_TIMEOUT_RETRIES.
+
+Signed-off-by: George Shen <george.shen@amd.com>
+Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
+Acked-by: Abdoulaye Berthe <Abdoulaye.Berthe@amd.com>
+Acked-by: Leo Li <sunpeng.li@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 32 ++++++++++++++------
+ 1 file changed, 22 insertions(+), 10 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 0b9d8c5b9323..5bf6068da717 100644
+--- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
++++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
+@@ -608,6 +608,8 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
+ uint8_t reply;
+ bool payload_reply = true;
+ enum aux_channel_operation_result operation_result;
++ bool retry_on_defer = false;
++
+ int aux_ack_retries = 0,
+ aux_defer_retries = 0,
+ aux_i2c_defer_retries = 0,
+@@ -638,8 +640,9 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
+ break;
+
+ case AUX_TRANSACTION_REPLY_AUX_DEFER:
+- case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
+ case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
++ retry_on_defer = true;
++ case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
+ if (++aux_defer_retries >= AUX_MAX_DEFER_RETRIES) {
+ goto fail;
+ } else {
+@@ -672,15 +675,24 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
+ break;
+
+ case AUX_CHANNEL_OPERATION_FAILED_TIMEOUT:
+- if (++aux_timeout_retries >= AUX_MAX_TIMEOUT_RETRIES)
+- goto fail;
+- else {
+- /*
+- * DP 1.4, 2.8.2: AUX Transaction Response/Reply Timeouts
+- * According to the DP spec there should be 3 retries total
+- * with a 400us wait inbetween each. Hardware already waits
+- * for 550us therefore no wait is required here.
+- */
++ // Check whether a DEFER had occurred before the timeout.
++ // If so, treat timeout as a DEFER.
++ if (retry_on_defer) {
++ if (++aux_defer_retries >= AUX_MAX_DEFER_RETRIES)
++ goto fail;
++ else if (payload->defer_delay > 0)
++ msleep(payload->defer_delay);
++ } else {
++ if (++aux_timeout_retries >= AUX_MAX_TIMEOUT_RETRIES)
++ goto fail;
++ else {
++ /*
++ * DP 1.4, 2.8.2: AUX Transaction Response/Reply Timeouts
++ * According to the DP spec there should be 3 retries total
++ * with a 400us wait inbetween each. Hardware already waits
++ * for 550us therefore no wait is required here.
++ */
++ }
+ }
+ break;
+
+--
+2.17.1
+