Skip to content

Commit fd1a11e

Browse files
committed
Merge tag 'drm-intel-gt-next-2025-11-14' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
Driver Changes: Fixes/improvements/new stuff: - Avoid lock inversion when pinning to GGTT on CHV/BXT+VTD (Janusz Krzysztofik) - Use standard API for seqcount read in TLB invalidation [gt] (Andi Shyti) Miscellaneous: - Wait longer for threads in migrate selftest on CHV/BXT+VTD (Janusz Krzysztofik) - Wait for page_sizes_gtt in gtt selftest on CHV/BXT+VTD (Janusz Krzysztofik) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Tvrtko Ursulin <tursulin@igalia.com> Link: https://patch.msgid.link/aRdXOAKlTVX_b0en@linux
2 parents f88f357 + 3bcf789 commit fd1a11e

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

drivers/gpu/drm/i915/gt/intel_tlb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void intel_gt_fini_tlb(struct intel_gt *gt);
1818

1919
static inline u32 intel_gt_tlb_seqno(const struct intel_gt *gt)
2020
{
21-
return seqprop_sequence(&gt->tlb.seqno);
21+
return raw_read_seqcount(&gt->tlb.seqno);
2222
}
2323

2424
static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)

drivers/gpu/drm/i915/gt/selftest_migrate.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,14 @@ static int threaded_migrate(struct intel_migrate *migrate,
710710
thread[i].tsk = tsk;
711711
}
712712

713-
msleep(10 * n_cpus); /* start all threads before we kthread_stop() */
713+
/*
714+
* Start all threads before we kthread_stop().
715+
* In CHV / BXT+VTD environments, where VMA pinning is committed
716+
* asynchronously, empirically determined 100ms delay is needed
717+
* to avoid stopping threads that may still wait for completion of
718+
* intel_ggtt_bind_vma and fail with -ERESTARTSYS when interrupted.
719+
*/
720+
msleep((intel_vm_no_concurrent_access_wa(migrate->context->vm->i915) ? 100 : 10) * n_cpus);
714721

715722
for (i = 0; i < n_cpus; ++i) {
716723
struct task_struct *tsk = thread[i].tsk;

drivers/gpu/drm/i915/i915_vma.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,8 +1597,20 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,
15971597
err_vma_res:
15981598
i915_vma_resource_free(vma_res);
15991599
err_fence:
1600-
if (work)
1601-
dma_fence_work_commit_imm(&work->base);
1600+
if (work) {
1601+
/*
1602+
* When pinning VMA to GGTT on CHV or BXT with VTD enabled,
1603+
* commit VMA binding asynchronously to avoid risk of lock
1604+
* inversion among reservation_ww locks held here and
1605+
* cpu_hotplug_lock acquired from stop_machine(), which we
1606+
* wrap around GGTT updates when running in those environments.
1607+
*/
1608+
if (i915_vma_is_ggtt(vma) &&
1609+
intel_vm_no_concurrent_access_wa(vma->vm->i915))
1610+
dma_fence_work_commit(&work->base);
1611+
else
1612+
dma_fence_work_commit_imm(&work->base);
1613+
}
16021614
err_rpm:
16031615
intel_runtime_pm_put(&vma->vm->i915->runtime_pm, wakeref);
16041616

drivers/gpu/drm/i915/selftests/i915_gem_gtt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,10 @@ static int misaligned_case(struct i915_address_space *vm, struct intel_memory_re
11181118
goto err_put;
11191119
}
11201120

1121+
/* make sure page_sizes_gtt has been populated before use */
1122+
if (i915_is_ggtt(vm) && intel_vm_no_concurrent_access_wa(vm->i915))
1123+
i915_vma_wait_for_bind(vma);
1124+
11211125
expected_vma_size = round_up(size, 1 << (ffs(vma->resource->page_sizes_gtt) - 1));
11221126
expected_node_size = expected_vma_size;
11231127

0 commit comments

Comments
 (0)