aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2018-11-01 01:02:01 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-01-14 15:04:57 -0500
commit95e8e59ec49f7ca5c8d3f531c1d396961b5b961b (patch)
tree916a39b00b91303e2fe7beddbff2dd867fa75ae1 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parent9281f12cabb09059ae60603e14cc9cd98b02febb (diff)
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=108754 Reviewed-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 1a558dc41ba6..8a61764e64cf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2550,6 +2550,17 @@ int amdgpu_device_init(struct amdgpu_device *adev,
2550 /* detect if we are with an SRIOV vbios */ 2550 /* detect if we are with an SRIOV vbios */
2551 amdgpu_device_detect_sriov_bios(adev); 2551 amdgpu_device_detect_sriov_bios(adev);
2552 2552
2553 /* check if we need to reset the asic
2554 * E.g., driver was not cleanly unloaded previously, etc.
2555 */
2556 if (amdgpu_asic_need_reset_on_init(adev)) {
2557 r = amdgpu_asic_reset(adev);
2558 if (r) {
2559 dev_err(adev->dev, "asic reset on init failed\n");
2560 goto failed;
2561 }
2562 }
2563
2553 /* Post card if necessary */ 2564 /* Post card if necessary */
2554 if (amdgpu_device_need_post(adev)) { 2565 if (amdgpu_device_need_post(adev)) {
2555 if (!adev->bios) { 2566 if (!adev->bios) {