[PATCH] drm/i915: Check reserve_memtype for failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When we allocate the GTT page-directory on !llc, we try to mark those
pages as using WC (via PAT). This may fail, so check and propagate the
error.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 6a036c068684..eebeb9a91631 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -409,7 +409,10 @@ static struct page *vm_alloc_page(struct i915_address_space *vm, gfp_t gfp)
 	if (unlikely(!pvec->nr))
 		return NULL;
 
-	set_pages_array_wc(pvec->pages, pvec->nr);
+	if (unlikely(set_pages_array_wc(pvec->pages, pvec->nr))) {
+		__pagevec_release(pvec);
+		return NULL;
+	}
 
 	return pvec->pages[--pvec->nr];
 }
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux