diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1860-drm-amdgpu-Rearm-IRQ-in-Vega10-SR-IOV-if-IRQ-lost.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1860-drm-amdgpu-Rearm-IRQ-in-Vega10-SR-IOV-if-IRQ-lost.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1860-drm-amdgpu-Rearm-IRQ-in-Vega10-SR-IOV-if-IRQ-lost.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1860-drm-amdgpu-Rearm-IRQ-in-Vega10-SR-IOV-if-IRQ-lost.patch new file mode 100644 index 00000000..fff7445f --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1860-drm-amdgpu-Rearm-IRQ-in-Vega10-SR-IOV-if-IRQ-lost.patch @@ -0,0 +1,82 @@ +From 5ac3603bc0d1351418307d4247d7609a685ebf1f Mon Sep 17 00:00:00 2001 +From: Trigger Huang <Trigger.Huang@amd.com> +Date: Tue, 30 Apr 2019 22:38:51 +0800 +Subject: [PATCH 1860/2940] drm/amdgpu: Rearm IRQ in Vega10 SR-IOV if IRQ lost +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In Multi-VFs stress test, sometimes we see IRQ lost when running +benchmark, just rearm it. + +Signed-off-by: Trigger Huang <Trigger.Huang@amd.com> +Acked-by: Christian König <christian.koenig@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 37 +++++++++++++++++++++++++- + 1 file changed, 36 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c +index 1b2f69a9a24e..8d89ab7f0ae8 100644 +--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c ++++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c +@@ -31,7 +31,7 @@ + #include "soc15_common.h" + #include "vega10_ih.h" + +- ++#define MAX_REARM_RETRY 10 + + static void vega10_ih_set_interrupt_funcs(struct amdgpu_device *adev); + +@@ -381,6 +381,38 @@ static void vega10_ih_decode_iv(struct amdgpu_device *adev, + ih->rptr += 32; + } + ++/** ++ * vega10_ih_irq_rearm - rearm IRQ if lost ++ * ++ * @adev: amdgpu_device pointer ++ * ++ */ ++static void vega10_ih_irq_rearm(struct amdgpu_device *adev, ++ struct amdgpu_ih_ring *ih) ++{ ++ uint32_t reg_rptr = 0; ++ uint32_t v = 0; ++ uint32_t i = 0; ++ ++ if (ih == &adev->irq.ih) ++ reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR); ++ else if (ih == &adev->irq.ih1) ++ reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR_RING1); ++ else if (ih == &adev->irq.ih2) ++ reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR_RING2); ++ else ++ return; ++ ++ /* Rearm IRQ / re-wwrite doorbell if doorbell write is lost */ ++ for (i = 0; i < MAX_REARM_RETRY; i++) { ++ v = RREG32_NO_KIQ(reg_rptr); ++ if ((v < ih->ring_size) && (v != ih->rptr)) ++ WDOORBELL32(ih->doorbell_index, ih->rptr); ++ else ++ break; ++ } ++} ++ + /** + * vega10_ih_set_rptr - set the IH ring buffer rptr + * +@@ -395,6 +427,9 @@ static void vega10_ih_set_rptr(struct amdgpu_device *adev, + /* XXX check if swapping is necessary on BE */ + *ih->rptr_cpu = ih->rptr; + WDOORBELL32(ih->doorbell_index, ih->rptr); ++ ++ if (amdgpu_sriov_vf(adev)) ++ vega10_ih_irq_rearm(adev, ih); + } else if (ih == &adev->irq.ih) { + WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR, ih->rptr); + } else if (ih == &adev->irq.ih1) { +-- +2.17.1 + |