]> www.infradead.org Git - nvme.git/commitdiff
drm/amdgpu: Set no_hw_access when VF request full GPU fails
authorYifan Zha <Yifan.Zha@amd.com>
Thu, 27 Jun 2024 07:06:23 +0000 (15:06 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jul 2024 20:46:56 +0000 (16:46 -0400)
[Why]
If VF request full GPU access and the request failed,
the VF driver can get stuck accessing registers for an extended period during
the unload of KMS.

[How]
Set no_hw_access flag when VF request for full GPU access fails
This prevents further hardware access attempts, avoiding the prolonged
stuck state.

Signed-off-by: Yifan Zha <Yifan.Zha@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

index ccb3d041c2b24937d16b802895c0f5fecb862ae3..111c380f929b597d65f32bc3f3a0cc62973a8dac 100644 (file)
@@ -86,8 +86,10 @@ int amdgpu_virt_request_full_gpu(struct amdgpu_device *adev, bool init)
 
        if (virt->ops && virt->ops->req_full_gpu) {
                r = virt->ops->req_full_gpu(adev, init);
-               if (r)
+               if (r) {
+                       adev->no_hw_access = true;
                        return r;
+               }
 
                adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME;
        }