Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm-xe-fixes-2024-08-29' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes

- Invalidate media_gt TLBs (Brost)
- Fix HWMON i1 power setup write command (Karthik)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZtB-t5f4uXMrKgnV@intel.com

+25 -14
+1 -1
drivers/gpu/drm/xe/xe_hwmon.c
··· 450 450 { 451 451 return xe_pcode_write(gt, PCODE_MBOX(PCODE_POWER_SETUP, 452 452 POWER_SETUP_SUBCOMMAND_WRITE_I1, 0), 453 - uval); 453 + (uval & POWER_SETUP_I1_DATA_MASK)); 454 454 } 455 455 456 456 static int xe_hwmon_power_curr_crit_read(struct xe_hwmon *hwmon, int channel,
+24 -13
drivers/gpu/drm/xe/xe_vm.c
··· 3341 3341 { 3342 3342 struct xe_device *xe = xe_vma_vm(vma)->xe; 3343 3343 struct xe_tile *tile; 3344 - struct xe_gt_tlb_invalidation_fence fence[XE_MAX_TILES_PER_DEVICE]; 3345 - u32 tile_needs_invalidate = 0; 3344 + struct xe_gt_tlb_invalidation_fence 3345 + fence[XE_MAX_TILES_PER_DEVICE * XE_MAX_GT_PER_TILE]; 3346 3346 u8 id; 3347 + u32 fence_id = 0; 3347 3348 int ret = 0; 3348 3349 3349 3350 xe_assert(xe, !xe_vma_is_null(vma)); ··· 3372 3371 if (xe_pt_zap_ptes(tile, vma)) { 3373 3372 xe_device_wmb(xe); 3374 3373 xe_gt_tlb_invalidation_fence_init(tile->primary_gt, 3375 - &fence[id], true); 3374 + &fence[fence_id], 3375 + true); 3376 3376 3377 - /* 3378 - * FIXME: We potentially need to invalidate multiple 3379 - * GTs within the tile 3380 - */ 3381 3377 ret = xe_gt_tlb_invalidation_vma(tile->primary_gt, 3382 - &fence[id], vma); 3378 + &fence[fence_id], vma); 3383 3379 if (ret < 0) { 3384 - xe_gt_tlb_invalidation_fence_fini(&fence[id]); 3380 + xe_gt_tlb_invalidation_fence_fini(&fence[fence_id]); 3385 3381 goto wait; 3386 3382 } 3383 + ++fence_id; 3387 3384 3388 - tile_needs_invalidate |= BIT(id); 3385 + if (!tile->media_gt) 3386 + continue; 3387 + 3388 + xe_gt_tlb_invalidation_fence_init(tile->media_gt, 3389 + &fence[fence_id], 3390 + true); 3391 + 3392 + ret = xe_gt_tlb_invalidation_vma(tile->media_gt, 3393 + &fence[fence_id], vma); 3394 + if (ret < 0) { 3395 + xe_gt_tlb_invalidation_fence_fini(&fence[fence_id]); 3396 + goto wait; 3397 + } 3398 + ++fence_id; 3389 3399 } 3390 3400 } 3391 3401 3392 3402 wait: 3393 - for_each_tile(tile, xe, id) 3394 - if (tile_needs_invalidate & BIT(id)) 3395 - xe_gt_tlb_invalidation_fence_wait(&fence[id]); 3403 + for (id = 0; id < fence_id; ++id) 3404 + xe_gt_tlb_invalidation_fence_wait(&fence[id]); 3396 3405 3397 3406 vma->tile_invalidated = vma->tile_mask; 3398 3407