Commit 95e8e59e authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: check if we need to reset at init time (v2)

To deal with situations like kexec or GPU VM passthrough
where the device may have been used previously without a
proper GPU reset between.

v2: rebase

bug: https://bugs.freedesktop.org/show_bug.cgi?id=108585
bug: https://bugs.freedesktop.org/show_bug.cgi?id=108754Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9281f12c
...@@ -2550,6 +2550,17 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -2550,6 +2550,17 @@ int amdgpu_device_init(struct amdgpu_device *adev,
/* detect if we are with an SRIOV vbios */ /* detect if we are with an SRIOV vbios */
amdgpu_device_detect_sriov_bios(adev); amdgpu_device_detect_sriov_bios(adev);
/* check if we need to reset the asic
* E.g., driver was not cleanly unloaded previously, etc.
*/
if (amdgpu_asic_need_reset_on_init(adev)) {
r = amdgpu_asic_reset(adev);
if (r) {
dev_err(adev->dev, "asic reset on init failed\n");
goto failed;
}
}
/* Post card if necessary */ /* Post card if necessary */
if (amdgpu_device_need_post(adev)) { if (amdgpu_device_need_post(adev)) {
if (!adev->bios) { if (!adev->bios) {
......
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