Commit dde72a5d authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZtB-t5f4uXMrKgnV@intel.com
parents 9941b5bc 59d237c8
...@@ -450,7 +450,7 @@ static int xe_hwmon_pcode_write_i1(struct xe_gt *gt, u32 uval) ...@@ -450,7 +450,7 @@ static int xe_hwmon_pcode_write_i1(struct xe_gt *gt, u32 uval)
{ {
return xe_pcode_write(gt, PCODE_MBOX(PCODE_POWER_SETUP, return xe_pcode_write(gt, PCODE_MBOX(PCODE_POWER_SETUP,
POWER_SETUP_SUBCOMMAND_WRITE_I1, 0), POWER_SETUP_SUBCOMMAND_WRITE_I1, 0),
uval); (uval & POWER_SETUP_I1_DATA_MASK));
} }
static int xe_hwmon_power_curr_crit_read(struct xe_hwmon *hwmon, int channel, static int xe_hwmon_power_curr_crit_read(struct xe_hwmon *hwmon, int channel,
......
...@@ -3341,9 +3341,10 @@ int xe_vm_invalidate_vma(struct xe_vma *vma) ...@@ -3341,9 +3341,10 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
{ {
struct xe_device *xe = xe_vma_vm(vma)->xe; struct xe_device *xe = xe_vma_vm(vma)->xe;
struct xe_tile *tile; struct xe_tile *tile;
struct xe_gt_tlb_invalidation_fence fence[XE_MAX_TILES_PER_DEVICE]; struct xe_gt_tlb_invalidation_fence
u32 tile_needs_invalidate = 0; fence[XE_MAX_TILES_PER_DEVICE * XE_MAX_GT_PER_TILE];
u8 id; u8 id;
u32 fence_id = 0;
int ret = 0; int ret = 0;
xe_assert(xe, !xe_vma_is_null(vma)); xe_assert(xe, !xe_vma_is_null(vma));
...@@ -3371,26 +3372,36 @@ int xe_vm_invalidate_vma(struct xe_vma *vma) ...@@ -3371,26 +3372,36 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
if (xe_pt_zap_ptes(tile, vma)) { if (xe_pt_zap_ptes(tile, vma)) {
xe_device_wmb(xe); xe_device_wmb(xe);
xe_gt_tlb_invalidation_fence_init(tile->primary_gt, xe_gt_tlb_invalidation_fence_init(tile->primary_gt,
&fence[id], true); &fence[fence_id],
true);
/*
* FIXME: We potentially need to invalidate multiple
* GTs within the tile
*/
ret = xe_gt_tlb_invalidation_vma(tile->primary_gt, ret = xe_gt_tlb_invalidation_vma(tile->primary_gt,
&fence[id], vma); &fence[fence_id], vma);
if (ret < 0) { if (ret < 0) {
xe_gt_tlb_invalidation_fence_fini(&fence[id]); xe_gt_tlb_invalidation_fence_fini(&fence[fence_id]);
goto wait; goto wait;
} }
++fence_id;
tile_needs_invalidate |= BIT(id); if (!tile->media_gt)
continue;
xe_gt_tlb_invalidation_fence_init(tile->media_gt,
&fence[fence_id],
true);
ret = xe_gt_tlb_invalidation_vma(tile->media_gt,
&fence[fence_id], vma);
if (ret < 0) {
xe_gt_tlb_invalidation_fence_fini(&fence[fence_id]);
goto wait;
}
++fence_id;
} }
} }
wait: wait:
for_each_tile(tile, xe, id) for (id = 0; id < fence_id; ++id)
if (tile_needs_invalidate & BIT(id))
xe_gt_tlb_invalidation_fence_wait(&fence[id]); xe_gt_tlb_invalidation_fence_wait(&fence[id]);
vma->tile_invalidated = vma->tile_mask; vma->tile_invalidated = vma->tile_mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment