All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/2] drm/i915: Switch a couple of BUG_ONs in the cmdparser over to DRM_ERROR
Date: Mon, 27 Jul 2015 10:17:28 +0100	[thread overview]
Message-ID: <1437988648-3829-2-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1437988648-3829-1-git-send-email-chris@chris-wilson.co.uk>

No need to break module and system loading due to a programming bug.
Remove the BUG_ON and replace with a gentler DRM_ERROR_ON and error
return.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_cmd_parser.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index fd9abe6e0ab1..dcd096536119 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -738,11 +738,16 @@ int i915_cmd_parser_init_ring(struct intel_engine_cs *ring)
 	default:
 		DRM_ERROR("CMD: cmd_parser_init with unknown ring: %d\n",
 			  ring->id);
-		BUG();
+		return -ENODEV;
 	}
 
-	BUG_ON(!validate_cmds_sorted(ring, cmd_tables, cmd_table_count));
-	BUG_ON(!validate_regs_sorted(ring));
+	if (DRM_ERROR_ON(!validate_cmds_sorted(ring, cmd_tables, cmd_table_count),
+			 "command parser table is not sorted - required for bisetion searching\n"))
+		return -ENODEV;
+
+	if (DRM_ERROR_ON(!validate_regs_sorted(ring),
+			 "register lists are not sorted - required for bisection searching\n"))
+		return -ENODEV;
 
 	WARN_ON(!hash_empty(ring->cmd_hash));
 
-- 
2.4.6

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

  reply	other threads:[~2015-07-27  9:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27  9:17 [PATCH 1/2] drm: Add DRM_ERROR_ON replacement for WARN_ON Chris Wilson
2015-07-27  9:17 ` Chris Wilson [this message]
2015-07-28  8:46   ` [PATCH 2/2] drm/i915: Switch a couple of BUG_ONs in the cmdparser over to DRM_ERROR shuang.he

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437988648-3829-2-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.