[Intel-gfx] [PATCH] drm/i915: Promote invalid buffer alignment.

Kenneth Graunke kenneth at whitecape.org
Mon Dec 7 00:31:04 CET 2009


On Sunday 06 December 2009 00:15:05 Chris Wilson wrote:
> On Sat, 5 Dec 2009 23:57:07 -0800, Kenneth Graunke <kenneth at whitecape.org> 
wrote:
> > I'm really uncomfortable with this suggestion.  For one, BUG_ON causes a
> > kernel panic, killing the whole system.  This seems rather extreme...even
> > with completely dead graphics, it's useful to keep the system alive so
> > one can at least ssh in and shut down cleanly.
> 
> The suggestion was to move the EINVAL checking to the kernel-userspace
> boundary in the ioctls, and then to BUG_ON if we ever saw an invalid
> alignment -- which would indeed be a kernel programming error.

Ah, I see what you mean now...thanks for the clarification.  That does seem 
like a good idea.

> BUG_ON does not in itself cause a panic, and in the likely cases here you
> will still be able to ssh in and inspect the system.
> -ickle

Really?  Looking at include/asm-generic/bug.h, I see:
#ifndef HAVE_ARCH_BUG
#define BUG() do { \
    printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
    panic("BUG!"); \
} while (0)
#endif

#ifndef HAVE_ARCH_BUG_ON
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
#endif

That looks like a panic to me...

--Kenneth



More information about the Intel-gfx mailing list