Skip to content

Commit fe0ce0d

Browse files
committed
Merge tag 'drm-xe-fixes-2024-08-08' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
- Fix off-by-one when processing RTP rules (Lucas) - Use dma_fence_chain_free in chain fence unused as a sync (Brost) - Fix PL1 disable flow in xe_hwmon_power_max_write (Karthik) - Take ref to VM in delayed dump snapshot (Brost) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/ZrUGgVrgTJ_vF2PS@intel.com
2 parents a507e75 + 642dfc9 commit fe0ce0d

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

drivers/gpu/drm/xe/xe_hwmon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ static int xe_hwmon_power_max_write(struct xe_hwmon *hwmon, int channel, long va
203203
reg_val = xe_mmio_rmw32(hwmon->gt, rapl_limit, PKG_PWR_LIM_1_EN, 0);
204204
reg_val = xe_mmio_read32(hwmon->gt, rapl_limit);
205205
if (reg_val & PKG_PWR_LIM_1_EN) {
206+
drm_warn(&gt_to_xe(hwmon->gt)->drm, "PL1 disable is not supported!\n");
206207
ret = -EOPNOTSUPP;
207-
goto unlock;
208208
}
209+
goto unlock;
209210
}
210211

211212
/* Computation in 64-bits to avoid overflow. Round to nearest. */

drivers/gpu/drm/xe/xe_lrc.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,9 @@ struct xe_lrc_snapshot *xe_lrc_snapshot_capture(struct xe_lrc *lrc)
16341634
if (!snapshot)
16351635
return NULL;
16361636

1637+
if (lrc->bo && lrc->bo->vm)
1638+
xe_vm_get(lrc->bo->vm);
1639+
16371640
snapshot->context_desc = xe_lrc_ggtt_addr(lrc);
16381641
snapshot->indirect_context_desc = xe_lrc_indirect_ring_ggtt_addr(lrc);
16391642
snapshot->head = xe_lrc_ring_head(lrc);
@@ -1653,12 +1656,14 @@ struct xe_lrc_snapshot *xe_lrc_snapshot_capture(struct xe_lrc *lrc)
16531656
void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot)
16541657
{
16551658
struct xe_bo *bo;
1659+
struct xe_vm *vm;
16561660
struct iosys_map src;
16571661

16581662
if (!snapshot)
16591663
return;
16601664

16611665
bo = snapshot->lrc_bo;
1666+
vm = bo->vm;
16621667
snapshot->lrc_bo = NULL;
16631668

16641669
snapshot->lrc_snapshot = kvmalloc(snapshot->lrc_size, GFP_KERNEL);
@@ -1678,6 +1683,8 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot)
16781683
xe_bo_unlock(bo);
16791684
put_bo:
16801685
xe_bo_put(bo);
1686+
if (vm)
1687+
xe_vm_put(vm);
16811688
}
16821689

16831690
void xe_lrc_snapshot_print(struct xe_lrc_snapshot *snapshot, struct drm_printer *p)
@@ -1727,8 +1734,14 @@ void xe_lrc_snapshot_free(struct xe_lrc_snapshot *snapshot)
17271734
return;
17281735

17291736
kvfree(snapshot->lrc_snapshot);
1730-
if (snapshot->lrc_bo)
1737+
if (snapshot->lrc_bo) {
1738+
struct xe_vm *vm;
1739+
1740+
vm = snapshot->lrc_bo->vm;
17311741
xe_bo_put(snapshot->lrc_bo);
1742+
if (vm)
1743+
xe_vm_put(vm);
1744+
}
17321745
kfree(snapshot);
17331746
}
17341747

drivers/gpu/drm/xe/xe_rtp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static void rtp_mark_active(struct xe_device *xe,
231231
if (first == last)
232232
bitmap_set(ctx->active_entries, first, 1);
233233
else
234-
bitmap_set(ctx->active_entries, first, last - first + 2);
234+
bitmap_set(ctx->active_entries, first, last - first + 1);
235235
}
236236

237237
/**

drivers/gpu/drm/xe/xe_sync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ void xe_sync_entry_cleanup(struct xe_sync_entry *sync)
263263
if (sync->fence)
264264
dma_fence_put(sync->fence);
265265
if (sync->chain_fence)
266-
dma_fence_put(&sync->chain_fence->base);
266+
dma_fence_chain_free(sync->chain_fence);
267267
if (sync->ufence)
268268
user_fence_put(sync->ufence);
269269
}

0 commit comments

Comments
 (0)