From: Kui Wen Date: Tue, 19 Jan 2021 13:31:03 +0000 (+0000) Subject: drm/i915: Fix the sgt.pfn sanity check X-Git-Tag: v5.15~1634^2~16^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23b2afc6eef83bfcf05c04f386c34f6242766f52;p=platform%2Fkernel%2Flinux-starfive.git drm/i915: Fix the sgt.pfn sanity check For the device local-memory case, sgt.pfn will always be equal to zero, since we instead use sgt.dma. Also, for device local-memory it is perfectly valid for it to start from zero anyway, so no need to add a new check for that either. Signed-off-by: Kui Wen Signed-off-by: Matthew Auld Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20210119133106.66294-1-matthew.auld@intel.com --- diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c index 43039dc..666808c 100644 --- a/drivers/gpu/drm/i915/i915_mm.c +++ b/drivers/gpu/drm/i915/i915_mm.c @@ -62,7 +62,7 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data) { struct remap_pfn *r = data; - if (GEM_WARN_ON(!r->sgt.pfn)) + if (GEM_WARN_ON(!r->sgt.sgp)) return -EINVAL; /* Special PTE are not associated with any struct page */