diff mbox

drm/i915: remove redundant warnings

Message ID 20161202105838.21274-1-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew Auld Dec. 2, 2016, 10:58 a.m. UTC
If we've gotten this far then we must have already checked if the
vma can fit into the vm when we inserted the mm node, and in turn
must have also checked for the overflow.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Chris Wilson Dec. 2, 2016, 11:24 a.m. UTC | #1
On Fri, Dec 02, 2016 at 10:58:38AM +0000, Matthew Auld wrote:
> If we've gotten this far then we must have already checked if the
> vma can fit into the vm when we inserted the mm node, and in turn
> must have also checked for the overflow.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>

The sanitychecks are a reasonable idea, since the result can be
catastrophic - but they are rather piecemeal and not desired in
production (just CI, and we want some really abusive test cases, of
which we already have a small selection).

I'd rather see these become GEM_BUG_ON (or GEM_WARN_ON) and more
complete coverage of the callbacks. i915_vma_bind() would give complete
coverage with minimal testing.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 02fb063302bf..a3c17a04b883 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1304,15 +1304,6 @@  static int gen8_alloc_va_range_3lvl(struct i915_address_space *vm,
 	uint32_t pdpes = I915_PDPES_PER_PDP(dev_priv);
 	int ret;
 
-	/* Wrap is never okay since we can only represent 48b, and we don't
-	 * actually use the other side of the canonical address space.
-	 */
-	if (WARN_ON(start + length < start))
-		return -ENODEV;
-
-	if (WARN_ON(start + length > vm->total))
-		return -ENODEV;
-
 	ret = alloc_gen8_temp_bitmaps(&new_page_dirs, &new_page_tables, pdpes);
 	if (ret)
 		return ret;