linux-next: origin tree build failure
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.
Signature · 12 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/ From: Stephen Rothwell <[email protected]> Date: Tue, 14 Apr 2009 14:27:09 +1000 Subject: [PATCH] sparc: asm/atomic.h on 32bit should include asm/system.h for xchg Signed-off-by: Stephen Rothwell <[email protected]> --- arch/sparc/include/asm/atomic_32.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/sparc/include/asm/atomic_32.h +2 -0
@@ -15,6 +15,8 @@#ifdef __KERNEL__ +#include <asm/system.h> +#define ATOMIC_INIT (i) { (i) }extern int __atomic_add_return (int ,atomic_t *);
Signature · 1 line
1.6.2.1
David Miller
maintainerFrom: Stephen Rothwell <[email protected]>
Date: Tue, 14 Apr 2009 14:43:17 +1000
Quoted 2 lines
Dave,
arch/sparc/include/asm/atomic_32.hshould really includeasm/system.hsince xchg is used in there.
That's true.
But atomic.h is not the proper place to obtain xchg() from, which is asm/system.h, and that's what debug_locks.h needs to include if it needs to use xchg().
This is why the s390 build broke in precisely the same way.
Quoted 6 lines · On Tue, 14 Apr 2009 01:57:27 -0700 (PDT) David Miller <[email protected]>…
From: Stephen Rothwell <[email protected]>
Date: Tue, 14 Apr 2009 14:43:17 +1000Quoted 2 lines
Dave,
arch/sparc/include/asm/atomic_32.hshould really includeasm/system.hsince xchg is used in there.
Quoted 7 lines
That's true.
But
atomic.his not the proper place to obtainxchg()from, which isasm/system.h, and that's whatdebug_locks.hneeds to include if it needs to usexchg().This is why the s390 build broke in precisely the same way.
Due to header include dependencies we can't include asm/system.h from asm/atomic.h. So David's solution seems to be the right way. How about this:
Subject: [PATCH] Fix xchg build breakage on s390.
From: Heiko Carstens <[email protected]>
In file included from kernel/panic.c:11:include/linux/debug_locks.h: In function '__debug_locks_off':include/linux/debug_locks.h:15: error: implicit declaration of function 'xchg'
Caused by 9eeba6138cefc0435695463ddadb0d95e0a6bcd2 "lockdep: warn about lockdep disabling after kernel taint"
---
include/linux/debug_locks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/debug_locks.h +1 -1
@@ -2,7 +2,7 @@#define __LINUX_DEBUG_LOCKING_H#include <linux/kernel.h> -#include <asm/atomic.h> +#include <asm/system.h> struct task_struct ;
David Miller
maintainerFrom: Stephen Rothwell <[email protected]>
Date: Tue, 14 Apr 2009 14:43:17 +1000
Quoted 3 lines
sparc:
asm/atomic.hon 32bit should includeasm/system.hfor xchgSigned-off-by Stephen Rothwell <[email protected]>
Just in case it wasn't clear, I'm applying this :)
Hi Dave,
Quoted 9 lines · On Tue, 14 Apr 2009 02:08:18 -0700 (PDT) David Miller <[email protected]>…
From: Stephen Rothwell <[email protected]>
Date: Tue, 14 Apr 2009 14:43:17 +1000Quoted 3 lines
sparc:
asm/atomic.hon 32bit should includeasm/system.hfor xchgSigned-off-by Stephen Rothwell <[email protected]>Just in case it wasn't clear, I'm applying this :)
Ah, ok, thanks :-)
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
PATCH 1/1 lockdep: warn about lockdep disabling after kernel taint, fix
In reply to Stephen RothwellQuoted 13 lines · Stephen Rothwell
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 inasm/system.hon sparc. It looks likeasm/atomic.hon 64bit sparc includesasm/system.h, but not on 32bit.
Quoted 4 lines
Dave,
arch/sparc/include/asm/atomic_32.hshould really includeasm/system.hsince 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
------------->
Quoted 1 line
From
f99a7c31f427f8f783c7b1379755f91b59acaf72Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Tue, 14 Apr 2009 11:03:12 +0200
Subject: [PATCH] lockdep: warn about lockdep disabling after kernel taint, fix
Impact: build fix
Stephen Rothwell reported that the Sparc build broke:
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'
due to:
9eeba61: lockdep: warn about lockdep disabling after kernel taint
There is some inconsistency between architectures about where exactly xchg() is defined. Most have it in system.h but also in atomic.h (which is arguably the more logical point for it). Some, such as Sparc only have it in asm/system.h and not available via asm/atomic.h.
Use the widest set of headers in debug_locks.h and also include asm/system.h.
--- include/linux/debug_locks.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/debug_locks.h +1 -0
@@ -3,6 +3,7 @@#include <linux/kernel.h> #include <asm/atomic.h> +#include <asm/system.h> struct task_struct ;
Re: [PATCH] lockdep: warn about lockdep disabling after kernel taint, fix
Quoted 33 lines · On Tue, 14 Apr 2009 11:15:38 +0200 Ingo Molnar <[email protected]> wrote:
Subject: [PATCH] lockdep: warn about lockdep disabling after kernel taint, fix
Impact: build fix
Stephen Rothwell reported that the Sparc build broke:
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'due to:
9eeba61: lockdep: warn about lockdep disabling after kernel taint
There is some inconsistency between architectures about where exactly
xchg()is defined. Most have it insystem.hbut also inatomic.h(which is arguably the more logical point for it). Some, such as Sparc only have it inasm/system.hand not available viaasm/atomic.h.Use the widest set of headers in
debug_locks.hand also includeasm/system.h.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Ingo Molnar <[email protected]>--- include/linux/debug_locks.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)include/linux/debug_locks.h +0
-0
include/linux/debug_locks.h line 6
Quoted 4 lines
include/linux/debug_locks.h +1
-0@@ -3,6 +3,7 @@#include <linux/kernel.h> #include <asm/atomic.h> +#include <asm/system.h>
Ah, ok. Please ignore my other mail from a few seconds ago ;) This fixes the s390 build break. Thanks!
Re: [PATCH] lockdep: warn about lockdep disabling after kernel taint, fix
In reply to Ingo MolnarHi Ingo,
Quoted 5 lines · On Tue, 14 Apr 2009 11:15:38 +0200 Ingo Molnar <[email protected]> wrote:
This opened up the path for someone eventually only including
asm/atomic.hfrom generic code and breaking the architectures that only provide it viasystem.h. So i've queued up the fix below - this should address the problem on Sparc and s390.
Thanks.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
[tip:core/urgent] lockdep: warn about lockdep disabling after kernel taint, fix
In reply to Stephen RothwellCommit-ID: 27b19565fe4ca5b0e9d2ae98ce4b81ca728bf445 Gitweb: http://git.kernel.org/tip/27b19565fe4ca5b0e9d2ae98ce4b81ca728bf445 Author: Ingo Molnar <[email protected]> AuthorDate: Tue, 14 Apr 2009 11:03:12 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 14 Apr 2009 11:11:52 +0200
lockdep: warn about lockdep disabling after kernel taint, fix
Impact: build fix for Sparc and s390
Stephen Rothwell reported that the Sparc build broke:
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'
due to:
9eeba61: lockdep: warn about lockdep disabling after kernel taint
There is some inconsistency between architectures about where exactly xchg() is defined.
The traditional place is in system.h but the more logical point for it is in atomic.h - where most architectures (especially new ones) have it defined. These architecture also still offer it via system.h.
Some, such as Sparc or s390 only have it in asm/system.h and not available via asm/atomic.h at all.
Use the widest set of headers in debug_locks.h and also include asm/system.h.
LKML-Reference: <[email protected]>
--- include/linux/debug_locks.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/debug_locks.h +1 -0
@@ -3,6 +3,7 @@#include <linux/kernel.h> #include <asm/atomic.h> +#include <asm/system.h> struct task_struct ;
Re: [tip:core/urgent] lockdep: warn about lockdep disabling after kernel taint, fix
Quoted 50 lines · tip-bot for Ingo Molnar
Commit-ID: 27b19565fe4ca5b0e9d2ae98ce4b81ca728bf445 Gitweb: http://git.kernel.org/tip/27b19565fe4ca5b0e9d2ae98ce4b81ca728bf445 Author: Ingo Molnar <[email protected]> AuthorDate: Tue, 14 Apr 2009 11:03:12 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 14 Apr 2009 11:11:52 +0200lockdep: warn about lockdep disabling after kernel taint, fix
Impact: build fix for Sparc and s390
Stephen Rothwell reported that the Sparc build broke:
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'due to:
9eeba61: lockdep: warn about lockdep disabling after kernel taint
There is some inconsistency between architectures about where exactly
xchg()is defined.The traditional place is in
system.hbut the more logical point for it is inatomic.h- where most architectures (especially new ones) have it defined. These architecture also still offer it viasystem.h.Some, such as Sparc or s390 only have it in
asm/system.hand not available viaasm/atomic.hat all.Use the widest set of headers in
debug_locks.hand also includeasm/system.h.Reported-by Stephen Rothwell <[email protected]>Cc Frederic Weisbecker <[email protected]>Cc "David S. Miller" <[email protected]>Cc Linus Torvalds <[email protected]>LKML-Reference: <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>--- include/linux/debug_locks.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)include/linux/debug_locks.h +0
-0
include/linux/debug_locks.h line 9
Quoted 7 lines
include/linux/debug_locks.h +1
-0@@ -3,6 +3,7 @@#include <linux/kernel.h> #include <asm/atomic.h> +#include <asm/system.h> struct task_struct ;
I'm sorry about this build breakage...
I've grep'ed the definitions of xchg() for this pach and indeed remember that some architectures defined it in asm/atomic.h and others in asm/system.h
And I've also seen some of them including system.h from atomic.h so I thought it was safe but.. heh...