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

drm/i915/error: Fix object page offset within a region

io_mapping_map_wc() expects the offset to be relative to the iomapping
base address. Currently we just pass in the physical address for the
page which only works if the region.start starts at zero.

Signed-off-by: CQ Tang <cq.tang@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210119133106.66294-2-matthew.auld@intel.com

authored by

CQ Tang and committed by
Chris Wilson
c9749836 23b2afc6

+3 -1
+3 -1
drivers/gpu/drm/i915/i915_gpu_error.c
··· 1051 1051 for_each_sgt_daddr(dma, iter, vma->pages) { 1052 1052 void __iomem *s; 1053 1053 1054 - s = io_mapping_map_wc(&mem->iomap, dma, PAGE_SIZE); 1054 + s = io_mapping_map_wc(&mem->iomap, 1055 + dma - mem->region.start, 1056 + PAGE_SIZE); 1055 1057 ret = compress_page(compress, 1056 1058 (void __force *)s, dst, 1057 1059 true);