drm/xe: Fix BUG_ON during bind with prefetch
authorBrian Welty <brian.welty@intel.com>
Thu, 13 Jul 2023 01:25:21 +0000 (18:25 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:36:23 +0000 (11:36 -0500)
It was missed that print_op needs to include DRM_GPUVA_OP_PREFETCH.

Else we hit the impossible BUG_ON:
[  886.371040] ------------[ cut here ]------------
[  886.371047] kernel BUG at drivers/gpu/drm/xe/xe_vm.c:2234!
[  886.371216] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[  886.371229] CPU: 1 PID: 3132 Comm: xe_exec_fault_m
[  886.371257] RIP: 0010:vm_bind_ioctl_ops_create+0x45f/0x470 [xe]
...
[  886.371517] Call Trace:
[  886.371525]  <TASK>
[  886.371531]  ? __die_body+0x1a/0x60
[  886.371546]  ? die+0x38/0x60
[  886.371557]  ? do_trap+0x10a/0x120
[  886.371568]  ? vm_bind_ioctl_ops_create+0x45f/0x470 [xe]

v2: add debug print for PREFETCH in print_op

Fixes: b06d47be7c83 ("drm/xe: Port Xe to GPUVA")
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Brian Welty <brian.welty@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_vm.c

index 297b7977ed87d8f6b4afcbd0978d00c49afe3b7d..ee67b4fd7320c74b47467eff97541cadb09bdeba 100644 (file)
@@ -2227,6 +2227,11 @@ static void print_op(struct xe_device *xe, struct drm_gpuva_op *op)
                       (ULL)xe_vma_start(vma), (ULL)xe_vma_size(vma),
                       op->unmap.keep ? 1 : 0);
                break;
+       case DRM_GPUVA_OP_PREFETCH:
+               vma = gpuva_to_vma(op->prefetch.va);
+               vm_dbg(&xe->drm, "PREFETCH: addr=0x%016llx, range=0x%016llx",
+                      (ULL)xe_vma_start(vma), (ULL)xe_vma_size(vma));
+               break;
        default:
                XE_BUG_ON("NOT POSSIBLE");
        }