[PATCH] lockdep: warn about lockdep disabling after kernel taint,fix

From: Ingo Molnar
Date: Tue Apr 14 2009 - 05:16:20 EST



* Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:

> Hi all,
>
> Today's linux-next build (sparc defconfig) failed like this:
>
> In file included from kernel/panic.c:12:
> include/linux/debug_locks.h: In function '__debug_locks_off':
> include/linux/debug_locks.h:15: error: implicit declaration of function 'xchg'
>
> Caused by commit 9eeba6138cefc0435695463ddadb0d95e0a6bcd2 ("lockdep: warn
> about lockdep disabling after kernel taint"). xchg is defined in
> asm/system.h on sparc. It looks like asm/atomic.h on 64bit sparc includes
> asm/system.h, but not on 32bit.
>
> Dave, arch/sparc/include/asm/atomic_32.h should really include
> asm/system.h since xchg is used in there.
>
> I have applied the following patch for today.

I dont think Sparc is at fault here - system.h is where we
historically provided xchg() from. Then as atomic.h was introduced
and extended, some architectures (x86 amongst them) gradually
migrated their definition of xchg() into atomic.h and related helper
headers. (while still making it available for system.h)

This opened up the path for someone eventually only including
asm/atomic.h from generic code and breaking the architectures that
only provide it via system.h. So i've queued up the fix below - this
should address the problem on Sparc and s390.

So moving it to atomic.h does make sense - but that's no excuse for
breaking the build. Sorry about this!

Ingo

------------->