drm/amdgpu: Use the default reset when loading or reloading the driver
authorjsg <jsg@openbsd.org>
Mon, 19 Jun 2023 00:32:04 +0000 (00:32 +0000)
committerjsg <jsg@openbsd.org>
Mon, 19 Jun 2023 00:32:04 +0000 (00:32 +0000)
From lyndonli
88a042d599c3f253ea8a9aa1906833c144525af4 in linux-6.1.y/6.1.33
4eea7fb980dc44545a32eec92e2662053b34cd9d in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c

index aff64c9..b892676 100644 (file)
@@ -3591,6 +3591,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        int r, i;
        bool px = false;
        u32 max_MBps;
+       int tmp;
 
        adev->shutdown = false;
        adev->flags = flags;
@@ -3818,7 +3819,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
                                }
                        }
                } else {
+                       tmp = amdgpu_reset_method;
+                       /* It should do a default reset when loading or reloading the driver,
+                        * regardless of the module parameter reset_method.
+                        */
+                       amdgpu_reset_method = AMD_RESET_METHOD_NONE;
                        r = amdgpu_asic_reset(adev);
+                       amdgpu_reset_method = tmp;
                        if (r) {
                                dev_err(adev->dev, "asic reset on init failed\n");
                                goto failed;