Commit 54eb4ed6 authored by xinhui pan's avatar xinhui pan Committed by Alex Deucher

drm/amdgpu: Fix NULL pointer when ta is missing

Ta is optional, so check if ta firmware is loaded or not.
Signed-off-by: default avatarxinhui pan <xinhui.pan@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2f3940e9
...@@ -707,10 +707,13 @@ static int psp_hw_start(struct psp_context *psp) ...@@ -707,10 +707,13 @@ static int psp_hw_start(struct psp_context *psp)
"XGMI: Failed to initialize XGMI session\n"); "XGMI: Failed to initialize XGMI session\n");
} }
if (psp->adev->psp.ta_fw) {
ret = psp_ras_initialize(psp); ret = psp_ras_initialize(psp);
if (ret) if (ret)
dev_err(psp->adev->dev, dev_err(psp->adev->dev,
"RAS: Failed to initialize RAS\n"); "RAS: Failed to initialize RAS\n");
}
return 0; return 0;
} }
...@@ -963,6 +966,7 @@ static int psp_hw_fini(void *handle) ...@@ -963,6 +966,7 @@ static int psp_hw_fini(void *handle)
psp->xgmi_context.initialized == 1) psp->xgmi_context.initialized == 1)
psp_xgmi_terminate(psp); psp_xgmi_terminate(psp);
if (psp->adev->psp.ta_fw)
psp_ras_terminate(psp); psp_ras_terminate(psp);
psp_ring_destroy(psp, PSP_RING_TYPE__KM); psp_ring_destroy(psp, PSP_RING_TYPE__KM);
...@@ -998,11 +1002,13 @@ static int psp_suspend(void *handle) ...@@ -998,11 +1002,13 @@ static int psp_suspend(void *handle)
} }
} }
if (psp->adev->psp.ta_fw) {
ret = psp_ras_terminate(psp); ret = psp_ras_terminate(psp);
if (ret) { if (ret) {
DRM_ERROR("Failed to terminate ras ta\n"); DRM_ERROR("Failed to terminate ras ta\n");
return ret; return ret;
} }
}
ret = psp_ring_stop(psp, PSP_RING_TYPE__KM); ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment