diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4313-drm-amdgpu-bypass-some-cleanup-work-after-err_event_.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4313-drm-amdgpu-bypass-some-cleanup-work-after-err_event_.patch | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4313-drm-amdgpu-bypass-some-cleanup-work-after-err_event_.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4313-drm-amdgpu-bypass-some-cleanup-work-after-err_event_.patch new file mode 100644 index 00000000..5d876186 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4313-drm-amdgpu-bypass-some-cleanup-work-after-err_event_.patch @@ -0,0 +1,106 @@ +From 0fc7d72e51896c4a2fbfb0bcf7f83a6fa4a50a3c Mon Sep 17 00:00:00 2001 +From: Le Ma <le.ma@amd.com> +Date: Fri, 25 Oct 2019 17:48:52 +0800 +Subject: [PATCH 4313/4736] drm/amdgpu: bypass some cleanup work after + err_event_athub + +PSP lost connection when err_event_athub occurs. These cleanup work can be +skipped in BACO reset. + +Change-Id: If54a3735edd6ccbb58d40a5f8833392981f8ce37 +Signed-off-by: Le Ma <le.ma@amd.com> +Reviewed-by: Hawking Zhang <hawking.zhang@amd.com> +Signed-off-by: Rahul Kumar <rahul.kumar1@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++ + drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 7 +++++++ + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 20 +++++++++++--------- + drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 6 ++++-- + 4 files changed, 28 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +index 7d134976492a..8e35ebdf4e10 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +@@ -2270,6 +2270,12 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) + /* displays are handled in phase1 */ + if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_DCE) + continue; ++ /* PSP lost connection when err_event_athub occurs */ ++ if (amdgpu_ras_intr_triggered() && ++ adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP) { ++ adev->ip_blocks[i].status.hw = false; ++ continue; ++ } + /* XXX handle errors */ + r = adev->ip_blocks[i].version->funcs->suspend(adev); + /* XXX handle errors */ +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +index f289a84363c4..4aa21bc1e0b9 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +@@ -167,6 +167,13 @@ psp_cmd_submit_buf(struct psp_context *psp, + while (*((unsigned int *)psp->fence_buf) != index) { + if (--timeout == 0) + break; ++ /* ++ * Shouldn't wait for timeout when err_event_athub occurs, ++ * because gpu reset thread triggered and lock resource should ++ * be released for psp resume sequence. ++ */ ++ if (amdgpu_ras_intr_triggered()) ++ break; + msleep(1); + amdgpu_asic_invalidate_hdp(psp->adev, NULL); + } +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +index ebc3e15eca8b..afc3ee47d1b2 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +@@ -556,15 +556,17 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, + if (!(!!enable ^ !!amdgpu_ras_is_feature_enabled(adev, head))) + return 0; + +- ret = psp_ras_enable_features(&adev->psp, &info, enable); +- if (ret) { +- DRM_ERROR("RAS ERROR: %s %s feature failed ret %d\n", +- enable ? "enable":"disable", +- ras_block_str(head->block), +- ret); +- if (ret == TA_RAS_STATUS__RESET_NEEDED) +- return -EAGAIN; +- return -EINVAL; ++ if (!amdgpu_ras_intr_triggered()) { ++ ret = psp_ras_enable_features(&adev->psp, &info, enable); ++ if (ret) { ++ DRM_ERROR("RAS ERROR: %s %s feature failed ret %d\n", ++ enable ? "enable":"disable", ++ ras_block_str(head->block), ++ ret); ++ if (ret == TA_RAS_STATUS__RESET_NEEDED) ++ return -EAGAIN; ++ return -EINVAL; ++ } + } + + /* setup the obj */ +diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +index 2f03bf533d41..013c1eb990f0 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +@@ -3739,8 +3739,10 @@ static int gfx_v9_0_hw_fini(void *handle) + amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0); + amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0); + +- /* disable KCQ to avoid CPC touch memory not valid anymore */ +- gfx_v9_0_kcq_disable(adev); ++ /* DF freeze and kcq disable will fail */ ++ if (!amdgpu_ras_intr_triggered()) ++ /* disable KCQ to avoid CPC touch memory not valid anymore */ ++ gfx_v9_0_kcq_disable(adev); + + if (amdgpu_sriov_vf(adev)) { + gfx_v9_0_cp_gfx_enable(adev, false); +-- +2.17.1 + |