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>
This commit is contained in:
parent
2f3940e992
commit
54eb4ed607
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = psp_ras_initialize(psp);
|
|
||||||
if (ret)
|
if (psp->adev->psp.ta_fw) {
|
||||||
dev_err(psp->adev->dev,
|
ret = psp_ras_initialize(psp);
|
||||||
"RAS: Failed to initialize RAS\n");
|
if (ret)
|
||||||
|
dev_err(psp->adev->dev,
|
||||||
|
"RAS: Failed to initialize RAS\n");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -963,7 +966,8 @@ 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);
|
||||||
|
|
||||||
psp_ras_terminate(psp);
|
if (psp->adev->psp.ta_fw)
|
||||||
|
psp_ras_terminate(psp);
|
||||||
|
|
||||||
psp_ring_destroy(psp, PSP_RING_TYPE__KM);
|
psp_ring_destroy(psp, PSP_RING_TYPE__KM);
|
||||||
|
|
||||||
@ -998,10 +1002,12 @@ static int psp_suspend(void *handle)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = psp_ras_terminate(psp);
|
if (psp->adev->psp.ta_fw) {
|
||||||
if (ret) {
|
ret = psp_ras_terminate(psp);
|
||||||
DRM_ERROR("Failed to terminate ras ta\n");
|
if (ret) {
|
||||||
return ret;
|
DRM_ERROR("Failed to terminate ras ta\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
|
ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
|
||||||
|
Loading…
Reference in New Issue
Block a user