From: Ben Widawsky <benjamin.widawsky@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Dave Airlie <airlied@redhat.com>, Ben Widawsky <ben@bwidawsk.net>,
dri-devel@lists.freedesktop.org,
Ben Widawsky <benjamin.widawsky@intel.com>
Subject: [PATCH 3/4] drm: WARN when removing unallocated node
Date: Tue, 13 Aug 2013 18:09:08 -0700 [thread overview]
Message-ID: <1376442549-5087-3-git-send-email-benjamin.widawsky@intel.com> (raw)
In-Reply-To: <1376442549-5087-1-git-send-email-benjamin.widawsky@intel.com>
The conditional is usually a recoverable driver bug, and so WARNing, and
preventing the drm_mm code from doing potential damage (BUG) is
desirable.
This issue was hit and fixed twice while developing the i915 multiple
address space code. The first fix is the patch just before this, and is
hit on an not frequently occuring error path. Another was fixed during
patch iteration, so it's hard to see from the patch:
commit c6cfb325677ea6305fb19acf3a4d14ea267f923e
Author: Ben Widawsky <ben@bwidawsk.net>
Date: Fri Jul 5 14:41:06 2013 -0700
drm/i915: Embed drm_mm_node in i915 gem obj
>From the intel-gfx mailing list, we discussed this:
References: <20130705191235.GA3057@bwidawsk.net>
Cc: Dave Airlie <airlied@redhat.com>
CC: <dri-devel@lists.freedesktop.org>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
drivers/gpu/drm/drm_mm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index aded1e1..af93cc5 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -254,6 +254,9 @@ void drm_mm_remove_node(struct drm_mm_node *node)
struct drm_mm *mm = node->mm;
struct drm_mm_node *prev_node;
+ if (WARN_ON(!node->allocated))
+ return;
+
BUG_ON(node->scanned_block || node->scanned_prev_free
|| node->scanned_next_free);
--
1.8.3.4
next prev parent reply other threads:[~2013-08-14 1:09 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 1:09 [PATCH 1/4] [v2] drm/i915: Remove node only when allocated Ben Widawsky
2013-08-14 1:09 ` [PATCH 2/4] [v3] drm/i915: cleanup map&fence in bind Ben Widawsky
2013-08-14 8:18 ` Daniel Vetter
2013-08-14 17:27 ` Ben Widawsky
2013-08-14 18:08 ` Daniel Vetter
2013-08-14 1:09 ` Ben Widawsky [this message]
2013-08-14 8:52 ` [Intel-gfx] [PATCH 3/4] drm: WARN when removing unallocated node Daniel Vetter
2013-08-14 1:09 ` [PATCH 4/4] [v4] drm/i915: Convert execbuf code to use vmas Ben Widawsky
2013-08-14 1:11 ` Ben Widawsky
2013-08-14 7:58 ` Chris Wilson
[not found] ` <20130814224358.GA21854@nuc-i3427.alporthouse.com>
2013-08-14 23:22 ` Ben Widawsky
2013-08-14 9:38 ` Split up execbuf vma conversion Daniel Vetter
2013-08-14 9:38 ` [PATCH 1/4] drm/i915: s/obj->exec_list/obj->obj_exec_link Daniel Vetter
2013-08-14 9:42 ` Daniel Vetter
2013-08-14 9:38 ` [PATCH 2/4] drm/i915: Switch eviction code to use vmas Daniel Vetter
2013-08-14 9:38 ` [PATCH 3/4] drm/i915: prepare bind_to_vm for preallocated vma Daniel Vetter
2013-08-14 9:38 ` [PATCH 4/4] drm/i915: Convert execbuf code to use vmas Daniel Vetter
2013-08-14 9:59 ` [PATCH] drm/i915: inline vma_create into lookup_or_create_vma Daniel Vetter
2013-08-14 11:49 ` Chris Wilson
2013-08-14 12:08 ` Daniel Vetter
2013-08-14 12:14 ` Daniel Vetter
2013-08-14 16:47 ` Daniel Vetter
2013-08-14 17:35 ` Ben Widawsky
2013-08-14 11:54 ` [PATCH 4/4] drm/i915: Convert execbuf code to use vmas Chris Wilson
2013-08-14 8:06 ` [PATCH 1/4] [v2] drm/i915: Remove node only when allocated Daniel Vetter
2013-08-14 8:15 ` Daniel Vetter
2013-08-15 14:05 ` Daniel Vetter
2013-08-15 21:42 ` Ben Widawsky
2013-08-14 8:19 ` Chris Wilson
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=1376442549-5087-3-git-send-email-benjamin.widawsky@intel.com \
--to=benjamin.widawsky@intel.com \
--cc=airlied@redhat.com \
--cc=ben@bwidawsk.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox