aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0951-drm-amdgpu-Improves-robustness-of-SOC15_WAIT_ON_RREG.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0951-drm-amdgpu-Improves-robustness-of-SOC15_WAIT_ON_RREG.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0951-drm-amdgpu-Improves-robustness-of-SOC15_WAIT_ON_RREG.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0951-drm-amdgpu-Improves-robustness-of-SOC15_WAIT_ON_RREG.patch b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0951-drm-amdgpu-Improves-robustness-of-SOC15_WAIT_ON_RREG.patch
new file mode 100644
index 00000000..eb744997
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0951-drm-amdgpu-Improves-robustness-of-SOC15_WAIT_ON_RREG.patch
@@ -0,0 +1,45 @@
+From 2eeba4d7e13afc73b9fc32c0f6285783645627ca Mon Sep 17 00:00:00 2001
+From: James Zhu <James.Zhu@amd.com>
+Date: Mon, 17 Dec 2018 08:35:05 -0500
+Subject: [PATCH 0951/2940] drm/amdgpu:Improves robustness of
+ SOC15_WAIT_ON_RREG
+
+If register value is updating, reset timeout counter.
+It improves robustness of SOC15_WAIT_ON_RREG.
+
+Signed-off-by: James Zhu <James.Zhu@amd.com>
+Reviewed-by: Leo Liu <leo.liu@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/soc15_common.h | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/soc15_common.h b/drivers/gpu/drm/amd/amdgpu/soc15_common.h
+index 958b10a57073..49c262540940 100644
+--- a/drivers/gpu/drm/amd/amdgpu/soc15_common.h
++++ b/drivers/gpu/drm/amd/amdgpu/soc15_common.h
+@@ -49,14 +49,19 @@
+
+ #define SOC15_WAIT_ON_RREG(ip, inst, reg, expected_value, mask, ret) \
+ do { \
++ uint32_t old_ = 0; \
+ uint32_t tmp_ = RREG32(adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg); \
+ uint32_t loop = adev->usec_timeout; \
+ while ((tmp_ & (mask)) != (expected_value)) { \
+- udelay(2); \
++ if (old_ != tmp_) { \
++ loop = adev->usec_timeout; \
++ old_ = tmp_; \
++ } else \
++ udelay(1); \
+ tmp_ = RREG32(adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg); \
+ loop--; \
+ if (!loop) { \
+- DRM_ERROR("Register(%d) [%s] failed to reach value 0x%08x != 0x%08x\n", \
++ DRM_WARN("Register(%d) [%s] failed to reach value 0x%08x != 0x%08x\n", \
+ inst, #reg, (unsigned)expected_value, (unsigned)(tmp_ & (mask))); \
+ ret = -ETIMEDOUT; \
+ break; \
+--
+2.17.1
+