]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amdgpu: refine fault cache updates
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 26 Jul 2023 21:09:40 +0000 (17:09 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Oct 2023 21:49:51 +0000 (17:49 -0400)
Don't update the fault cache if status is 0.  In the multiple
fault case, subsequent faults will return a 0 status which is
useless for userspace and replaces the useful fault status, so
only update if status is non-0.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 4058ed49e5a6a4eef7824bfbe57d17e1cbd2b853..afc19341334ffacc281ba020081a9535f5b07bd7 100644 (file)
@@ -2753,7 +2753,12 @@ void amdgpu_vm_update_fault_cache(struct amdgpu_device *adev,
        xa_lock_irqsave(&adev->vm_manager.pasids, flags);
 
        vm = xa_load(&adev->vm_manager.pasids, pasid);
-       if (vm) {
+       /* Don't update the fault cache if status is 0.  In the multiple
+        * fault case, subsequent faults will return a 0 status which is
+        * useless for userspace and replaces the useful fault status, so
+        * only update if status is non-0.
+        */
+       if (vm && status) {
                vm->fault_info.addr = addr;
                vm->fault_info.status = status;
                if (AMDGPU_IS_GFXHUB(vmhub)) {