Commit 6ec8a47c authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-intel-fixes-2025-11-06' of...

Merge tag 'drm-intel-fixes-2025-11-06' of https://gitlab.freedesktop.org/drm/i915/kernel

 into drm-fixes

- Avoid lock inversion when pinning to GGTT on CHV/BXT+VTD (Janusz)
- Fix conversion between clock ticks and nanoseconds (Umesh)

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

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/aQyxT1D8IW-xcDbM@intel.com
parents faf66a71 7d44ad6b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ static u64 div_u64_roundup(u64 nom, u32 den)

u64 intel_gt_clock_interval_to_ns(const struct intel_gt *gt, u64 count)
{
	return div_u64_roundup(count * NSEC_PER_SEC, gt->clock_frequency);
	return mul_u64_u32_div(count, NSEC_PER_SEC, gt->clock_frequency);
}

u64 intel_gt_pm_interval_to_ns(const struct intel_gt *gt, u64 count)
@@ -215,7 +215,7 @@ u64 intel_gt_pm_interval_to_ns(const struct intel_gt *gt, u64 count)

u64 intel_gt_ns_to_clock_interval(const struct intel_gt *gt, u64 ns)
{
	return div_u64_roundup(gt->clock_frequency * ns, NSEC_PER_SEC);
	return mul_u64_u32_div(ns, gt->clock_frequency, NSEC_PER_SEC);
}

u64 intel_gt_ns_to_pm_interval(const struct intel_gt *gt, u64 ns)
+14 −2
Original line number Diff line number Diff line
@@ -1595,8 +1595,20 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,
err_vma_res:
	i915_vma_resource_free(vma_res);
err_fence:
	if (work)
	if (work) {
		/*
		 * When pinning VMA to GGTT on CHV or BXT with VTD enabled,
		 * commit VMA binding asynchronously to avoid risk of lock
		 * inversion among reservation_ww locks held here and
		 * cpu_hotplug_lock acquired from stop_machine(), which we
		 * wrap around GGTT updates when running in those environments.
		 */
		if (i915_vma_is_ggtt(vma) &&
		    intel_vm_no_concurrent_access_wa(vma->vm->i915))
			dma_fence_work_commit(&work->base);
		else
			dma_fence_work_commit_imm(&work->base);
	}
err_rpm:
	intel_runtime_pm_put(&vma->vm->i915->runtime_pm, wakeref);