]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix DMA mapped scatterlist walks
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 6 Oct 2020 09:25:07 +0000 (10:25 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 6 Oct 2020 11:49:07 +0000 (12:49 +0100)
commitd1b6f48fb1b9eb905f8886bdd7c953e040e156b5
tree88f40523da4eed82e95f7ec9730c39402751a960
parent6f6f9c87512b09a2c4d690e46cf544a12d173afc
drm/i915: Fix DMA mapped scatterlist walks

When walking DMA mapped scatterlists sg_dma_len has to be used since it
can be different (coalesced) from the backing store entry.

This also means we have to end the walk when encountering a zero length
DMA entry and cannot rely on the normal sg list end marker.

Both issues were there in theory for some time but were hidden by the fact
Intel IOMMU driver was never coalescing entries. As there are ongoing
efforts to change this we need to start handling it.

v2:
 * Use unsigned int for local storing sg_dma_len. (Logan)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
References: 0c1e373a23ca ("drm/i915: Introduce & use new lightweight SGL iterators")
References: 28e4193ce801 ("drm/i915: Micro-optimise gen6_ppgtt_insert_entries()")
Reported-by: Tom Murphy <murphyt7@tcd.ie>
Suggested-by: Tom Murphy <murphyt7@tcd.ie> # __sgt_iter
Suggested-by: Logan Gunthorpe <logang@deltatee.com> # __sgt_iter
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201006092508.1064287-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/gt/gen6_ppgtt.c
drivers/gpu/drm/i915/gt/gen8_ppgtt.c
drivers/gpu/drm/i915/gt/intel_gtt.h
drivers/gpu/drm/i915/i915_scatterlist.h