aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4529-drm-amd-powerplay-correct-swSMU-baco-reset-related-s.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4529-drm-amd-powerplay-correct-swSMU-baco-reset-related-s.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4529-drm-amd-powerplay-correct-swSMU-baco-reset-related-s.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4529-drm-amd-powerplay-correct-swSMU-baco-reset-related-s.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4529-drm-amd-powerplay-correct-swSMU-baco-reset-related-s.patch
new file mode 100644
index 00000000..1b08056d
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4529-drm-amd-powerplay-correct-swSMU-baco-reset-related-s.patch
@@ -0,0 +1,68 @@
+From 1e4f35f41e12e21e3787690d9ab6a52746c868f0 Mon Sep 17 00:00:00 2001
+From: Evan Quan <evan.quan@amd.com>
+Date: Mon, 18 Nov 2019 17:04:24 +0800
+Subject: [PATCH 4529/4736] drm/amd/powerplay: correct swSMU baco reset related
+ settings
+
+Added bif doorbell interrupt setting and applied different
+settings for BACO reset for RAS recovery.
+
+Change-Id: I823b2d478699d469ecc7746e2a8fb1110a4a146f
+Signed-off-by: Evan Quan <evan.quan@amd.com>
+Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 30 ++++++++++++++++++++---
+ 1 file changed, 27 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+index 928877f73dfd..71e2bbe25cf6 100644
+--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
++++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+@@ -1667,6 +1667,10 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
+ {
+
+ struct smu_baco_context *smu_baco = &smu->smu_baco;
++ struct amdgpu_device *adev = smu->adev;
++ struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
++ uint32_t bif_doorbell_intr_cntl;
++ uint32_t data;
+ int ret = 0;
+
+ if (smu_v11_0_baco_get_state(smu) == state)
+@@ -1674,10 +1678,30 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
+
+ mutex_lock(&smu_baco->mutex);
+
+- if (state == SMU_BACO_STATE_ENTER)
+- ret = smu_send_smc_msg_with_param(smu, SMU_MSG_EnterBaco, BACO_SEQ_BACO);
+- else
++ bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL);
++
++ if (state == SMU_BACO_STATE_ENTER) {
++ bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
++ BIF_DOORBELL_INT_CNTL,
++ DOORBELL_INTERRUPT_DISABLE, 1);
++ WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
++
++ if (!ras || !ras->supported) {
++ data = RREG32_SOC15(THM, 0, mmTHM_BACO_CNTL);
++ data |= 0x80000000;
++ WREG32_SOC15(THM, 0, mmTHM_BACO_CNTL, data);
++
++ ret = smu_send_smc_msg_with_param(smu, SMU_MSG_EnterBaco, 0);
++ } else {
++ ret = smu_send_smc_msg_with_param(smu, SMU_MSG_EnterBaco, 1);
++ }
++ } else {
+ ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
++ bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
++ BIF_DOORBELL_INT_CNTL,
++ DOORBELL_INTERRUPT_DISABLE, 0);
++ WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
++ }
+ if (ret)
+ goto out;
+
+--
+2.17.1
+