]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:11:36 +0000 (11:11 +0200)
[ Upstream commit 33f23fc3155b13c4a96d94a0a22dc26db767440b ]

[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

index d9dc675b46aed54021132552b8c4b8befc7f31ef..22575422ca7ec12e7558d48032cbc29a5e1c5def 100644 (file)
@@ -137,8 +137,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;
        }