From: Chris Wilson Subject: Re: [PATCH 4/5] drm: WARN when removing unallocated node Date: Sat, 10 Aug 2013 09:48:38 +0100 Message-ID: <20130810084838.GE3561@cantiga.alporthouse.com> References: <1376111536-12461-1-git-send-email-benjamin.widawsky@intel.com> <1376111536-12461-4-git-send-email-benjamin.widawsky@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1376111536-12461-4-git-send-email-benjamin.widawsky@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: Dave Airlie , Intel GFX , Ben Widawsky , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Fri, Aug 09, 2013 at 10:12:15PM -0700, Ben Widawsky wrote: > 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 > 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 > CC: > Signed-off-by: Ben Widawsky On the other hand, if we end up with a proliferation of if (drm_mm_node_allocated(node)) drm_mm_remove_node(node) in the drivers, putting the guard into remove_node is preferrable. At the moment we only have the one error path in i915.ko where we need to double check so it is not much of a concern. Acked-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre