drm/amdgpu: post the ASIC after the reset done at init time
Subsystems (2)
PATCH 1/1 drm/amdgpu: post the ASIC after the reset done at init time
When the driver is reloaded, amdgpu_device_init() resets the ASIC but does not post it again, because BIOS scratch register 7 still reports ATOM_S7_ASIC_INIT_COMPLETE after the reset. psp_sw_init() can then read the PSP runtime database before the PSP is ready. SCPM is detected as disabled and the PPTable upload fails with "Failed to transfer pptable to SMC!".
how to fix:
Set has_hw_reset after a successful reset on init, so that amdgpu_device_need_post() returns true and amdgpu_device_asic_init() is called. The ASIC init returns only after the PSP is ready, so the PSP runtime database is valid when it is read.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
@@ -4105,6 +4105,9 @@ int amdgpu_device_init(struct amdgpu_device *adev, amdgpu_reset_method =AMD_RESET_METHOD_NONE ; r =amdgpu_asic_reset (adev); amdgpu_reset_method = tmp; +/* Post again so that the PSP is ready before it is used */ +if (!r) + adev->has_hw_reset = true; }if (r) {
Signature · 1 line
2.48.1
Quoted 8 lines · chong li
When the driver is reloaded,
amdgpu_device_init()resets the ASIC but does not post it again, because BIOS scratch register 7 still reportsATOM_S7_ASIC_INIT_COMPLETEafter the reset.psp_sw_init()can then read the PSP runtime database before the PSP is ready. SCPM is detected as disabled and the PPTable upload fails with "Failed to transfer pptable to SMC!".
Quoted 7 lines
how to fix:
Sethas_hw_resetafter a successful reset on init, so thatamdgpu_device_need_post()returns true andamdgpu_device_asic_init()is called. The ASIC init returns only after the PSP is ready, so the PSP runtime database is valid when it is read.Signed-off-by chong li <[email protected]>
Quoted 21 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3
-1@@ -4105,6 +4105,9 @@ int amdgpu_device_init(struct amdgpu_device *adev, amdgpu_reset_method =AMD_RESET_METHOD_NONE ; r =amdgpu_asic_reset (adev); amdgpu_reset_method = tmp; +/* Post again so that the PSP is ready before it is used */ +if (!r) + adev->has_hw_reset = true; }if (r) { --2.48.1