From patchwork Tue Apr 19 20:46:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 718841 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3JJrBHv007384 for ; Tue, 19 Apr 2011 19:53:31 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 449FF9EF4C for ; Tue, 19 Apr 2011 12:53:11 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ww0-f43.google.com (mail-ww0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C8149EB7C for ; Tue, 19 Apr 2011 12:51:57 -0700 (PDT) Received: by wwb17 with SMTP id 17so57104wwb.12 for ; Tue, 19 Apr 2011 12:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=Gvgu9d9F5aT4O7Bs/TREw1W6dOxlj4jAJcegtKDkd9E=; b=WHMadLLGIt+g6nTBLiCec6rOa4sIo4dHS0Rzvl2L7q+h/YkUEyMoSgZ/6yN7vWkgPw Xyh54aQWnRPp6hQhczS4Wm8n9ArTFKywGjEp/7FmtXuS0ZGzSWGcowlCn25A2fkk+dGF Te0R8BVO8GDAbiDND5iQ2H+LIbKoM6mAxxbiA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=GZLZ8zdaKmtkH1GOOqqSXu1TA+ydA/+84CDPIvVRu+l0sLMqApCcqR5bW8dL+4opcU bnUV/h/xFTxRTYGSi/UEXDQpPga2jlAn5hopL1O0EAvytLBMHs0WEnFM2ZZzIuXRPaGk Stthyb6oSaWkXEUmCEtnzC5LrjQyULEWF11n8= Received: by 10.216.61.197 with SMTP id w47mr109892wec.37.1303242715321; Tue, 19 Apr 2011 12:51:55 -0700 (PDT) Received: from localhost.localdomain (cable-static-216-94.intergga.ch [87.102.216.94]) by mx.google.com with ESMTPS id u9sm138493wbg.34.2011.04.19.12.51.53 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Apr 2011 12:51:54 -0700 (PDT) From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Apr 2011 22:46:00 +0200 Message-Id: <1303245964-3022-2-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1303245964-3022-1-git-send-email-daniel.vetter@ffwll.ch> References: <1303245964-3022-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 1/5] drm/i915: downgrade non-lethal BUG_ONs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Apr 2011 19:53:31 +0000 (UTC) If it's a simple gem accounting error that won't lead to immediate harm (like a NULL-deref) or is a simple violation of a required invariant that the caller should always check/ensure, downgrade the BUG_ON to a WARN_ON and hope the system survives long enough to grab the dmesg. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_gem.c | 6 +++--- drivers/gpu/drm/i915/i915_gem_evict.c | 4 ++-- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index ae40272..1ef0b91 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1748,7 +1748,7 @@ i915_gem_object_move_to_flushing(struct drm_i915_gem_object *obj) struct drm_device *dev = obj->base.dev; drm_i915_private_t *dev_priv = dev->dev_private; - BUG_ON(!obj->active); + WARN_ON(!obj->active); list_move_tail(&obj->mm_list, &dev_priv->mm.flushing_list); i915_gem_object_move_off_active(obj); @@ -1765,8 +1765,8 @@ i915_gem_object_move_to_inactive(struct drm_i915_gem_object *obj) else list_move_tail(&obj->mm_list, &dev_priv->mm.inactive_list); - BUG_ON(!list_empty(&obj->gpu_write_list)); - BUG_ON(!obj->active); + WARN_ON(!list_empty(&obj->gpu_write_list)); + WARN_ON(!obj->active); obj->ring = NULL; i915_gem_object_move_off_active(obj); diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c index da05a26..db62fae 100644 --- a/drivers/gpu/drm/i915/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/i915_gem_evict.c @@ -136,7 +136,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, exec_list); ret = drm_mm_scan_remove_block(obj->gtt_space); - BUG_ON(ret); + WARN_ON(ret); list_del_init(&obj->exec_list); drm_gem_object_unreference(&obj->base); @@ -199,7 +199,7 @@ i915_gem_evict_everything(struct drm_device *dev, bool purgeable_only) if (ret) return ret; - BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); + WARN_ON(!list_empty(&dev_priv->mm.flushing_list)); return i915_gem_evict_inactive(dev, purgeable_only); } diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 316603e..8cac87c 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1093,7 +1093,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, &objects, eb, exec, args->buffer_count); - BUG_ON(!mutex_is_locked(&dev->struct_mutex)); + WARN_ON(!mutex_is_locked(&dev->struct_mutex)); } if (ret) goto err; @@ -1122,7 +1122,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, if (ret) goto err; - BUG_ON(ring->sync_seqno[i]); + WARN_ON(ring->sync_seqno[i]); } }