Skip to content

Commit 7d44243

Browse files
Hawking Zhangalexdeucher
authored andcommitted
drm/amdgpu: Fix the return for gpu mode1_reset
amdgpu_device_mode1_reset will return gpu mode1_reset succeed (ret = 0) as long as wait_for_bootloader call succeed, regardless of the status reported by smu or psp firmware. This results to driver continue executing recovery even smu or psp fail to perform mode1 reset. Signed-off-by: Hawking Zhang <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent a9366b9 commit 7d44243

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4701,12 +4701,12 @@ int amdgpu_device_mode1_reset(struct amdgpu_device *adev)
47014701
}
47024702

47034703
if (ret)
4704-
dev_err(adev->dev, "GPU mode1 reset failed\n");
4704+
goto mode1_reset_failed;
47054705

47064706
amdgpu_device_load_pci_state(adev->pdev);
47074707
ret = amdgpu_psp_wait_for_bootloader(adev);
47084708
if (ret)
4709-
return ret;
4709+
goto mode1_reset_failed;
47104710

47114711
/* wait for asic to come out of reset */
47124712
for (i = 0; i < adev->usec_timeout; i++) {
@@ -4717,8 +4717,17 @@ int amdgpu_device_mode1_reset(struct amdgpu_device *adev)
47174717
udelay(1);
47184718
}
47194719

4720+
if (i >= adev->usec_timeout) {
4721+
ret = -ETIMEDOUT;
4722+
goto mode1_reset_failed;
4723+
}
4724+
47204725
amdgpu_atombios_scratch_regs_engine_hung(adev, false);
47214726

4727+
return 0;
4728+
4729+
mode1_reset_failed:
4730+
dev_err(adev->dev, "GPU mode1 reset failed\n");
47224731
return ret;
47234732
}
47244733

0 commit comments

Comments
 (0)