summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxinhui pan <xinhui.pan@amd.com>2019-03-11 12:17:14 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 15:36:51 -0500
commit54eb4ed6072bd7c11a0cc1f9433967fceabaa560 (patch)
tree40b54394878ab061512eaea8fbf9ac90632db320
parent2f3940e992431f3fb58a57c5679e95ccb7c0cc9f (diff)
downloadlinux-54eb4ed6072bd7c11a0cc1f9433967fceabaa560.tar.bz2
drm/amdgpu: Fix NULL pointer when ta is missing
Ta is optional, so check if ta firmware is loaded or not. Signed-off-by: xinhui pan <xinhui.pan@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 7e3e1d588d74..32388b5218e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -707,10 +707,13 @@ static int psp_hw_start(struct psp_context *psp)
"XGMI: Failed to initialize XGMI session\n");
}
- ret = psp_ras_initialize(psp);
- if (ret)
- dev_err(psp->adev->dev,
- "RAS: Failed to initialize RAS\n");
+
+ if (psp->adev->psp.ta_fw) {
+ ret = psp_ras_initialize(psp);
+ if (ret)
+ dev_err(psp->adev->dev,
+ "RAS: Failed to initialize RAS\n");
+ }
return 0;
}
@@ -963,7 +966,8 @@ static int psp_hw_fini(void *handle)
psp->xgmi_context.initialized == 1)
psp_xgmi_terminate(psp);
- psp_ras_terminate(psp);
+ if (psp->adev->psp.ta_fw)
+ psp_ras_terminate(psp);
psp_ring_destroy(psp, PSP_RING_TYPE__KM);
@@ -998,10 +1002,12 @@ static int psp_suspend(void *handle)
}
}
- ret = psp_ras_terminate(psp);
- if (ret) {
- DRM_ERROR("Failed to terminate ras ta\n");
- return ret;
+ if (psp->adev->psp.ta_fw) {
+ ret = psp_ras_terminate(psp);
+ if (ret) {
+ DRM_ERROR("Failed to terminate ras ta\n");
+ return ret;
+ }
}
ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);