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

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/gt: Serialize TLB invalidates with GT resets

Avoid trying to invalidate the TLB in the middle of performing an
engine reset, as this may result in the reset timing out. Currently,
the TLB invalidate is only serialised by its own mutex, forgoing the
uncore lock, but we can take the uncore->lock as well to serialise
the mmio access, thereby serialising with the GDRST.

Tested on a NUC5i7RYB, BIOS RYBDWi35.86A.0380.2019.0517.1530 with
i915 selftest/hangcheck.

Cc: stable@vger.kernel.org # v4.4 and upper
Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
Reported-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Tested-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1e59a7c45dd919a530256b9ac721ac6ea86c0677.1657639152.git.mchehab@kernel.org
(cherry picked from commit 33da97894758737895e90c909f16786052680ef4)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

authored by

Chris Wilson and committed by
Rodrigo Vivi
a1c5a7bf b24dcf1d

+14 -1
+14 -1
drivers/gpu/drm/i915/gt/intel_gt.c
··· 1209 1209 mutex_lock(&gt->tlb_invalidate_lock); 1210 1210 intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL); 1211 1211 1212 + spin_lock_irq(&uncore->lock); /* serialise invalidate with GT reset */ 1213 + 1214 + for_each_engine(engine, gt, id) { 1215 + struct reg_and_bit rb; 1216 + 1217 + rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num); 1218 + if (!i915_mmio_reg_offset(rb.reg)) 1219 + continue; 1220 + 1221 + intel_uncore_write_fw(uncore, rb.reg, rb.bit); 1222 + } 1223 + 1224 + spin_unlock_irq(&uncore->lock); 1225 + 1212 1226 for_each_engine(engine, gt, id) { 1213 1227 /* 1214 1228 * HW architecture suggest typical invalidation time at 40us, ··· 1237 1223 if (!i915_mmio_reg_offset(rb.reg)) 1238 1224 continue; 1239 1225 1240 - intel_uncore_write_fw(uncore, rb.reg, rb.bit); 1241 1226 if (__intel_wait_for_register_fw(uncore, 1242 1227 rb.reg, rb.bit, 0, 1243 1228 timeout_us, timeout_ms,