We are seeing "DMAR faults [reason 7, next page table ptr is invalid]"
on TGL while running suspend stress test. Refer to 'commit 84361529ee85
("drm/i915: Sleep around performing iommu unmaps on Tigerlake")'.
Driver check needs_idle_maps() in i915_gmch_probe() but it applicable
for gen5 and earlier generations. Add needs_idle_maps() in gen8_gmch_probe()
then it will benifit gen8 and later platform.Cc: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Ville Syrjala <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Cooper Chiou <[email protected]> Cc: Huang Derek <[email protected]> Signed-off-by: Lee Shawn C <[email protected]> --- drivers/gpu/drm/i915/gt/intel_ggtt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c index de3ac58fceec..9510da0ae6b5 100644 --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c @@ -911,6 +911,12 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt) ggtt->vm.alloc_pt_dma = alloc_pt_dma; + if (needs_idle_maps(i915)) { + drm_notice(&i915->drm, + "Flushing DMA requests before IOMMU unmaps; performance may be degraded\n"); + ggtt->do_idle_maps = true; + } + ggtt->vm.total = (size / sizeof(gen8_pte_t)) * I915_GTT_PAGE_SIZE; ggtt->vm.cleanup = gen6_gmch_remove; ggtt->vm.insert_page = gen8_ggtt_insert_page; -- 2.17.1
