Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Compilation fails with CONFIG_DEBUG_SPINLOCK
@ 2004-10-13  9:20 Thomas Petazzoni
  2004-10-18 10:03 ` Thomas Petazzoni
  2004-10-22 12:50 ` Ralf Baechle
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2004-10-13  9:20 UTC (permalink / raw)
  To: linux-mips; +Cc: mentre

Hello,

With the last CVS, if you check CONFIG_DEBUG_SPINLOCK, the compilation
fails :

arch/mips/kernel/built-in.o(.text+0x2e84): In function `probe_irq_on':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2e88): In function `probe_irq_on':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2e90): In function `probe_irq_on':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2e94): In function `probe_irq_on':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2ebc): In function `probe_irq_on':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2ec0): more undefined references
to `atomic_lock' follow
make: *** [.tmp_vmlinux1] Error 1

Some macros in include/asm/atomic.h uses a spinlock called
atomic_lock. An "extern" definition is made at the top of the file,
but the real spinlock is not defined anywhere.

I think this is trivial to fix, but I'm not sure what is the right
place to declare the spin lock and to initialize it.

Thomas
-- 
PETAZZONI Thomas - thomas.petazzoni@enix.org 
http://thomas.enix.org - Jabber: kos_tom@sourcecode.de
KOS: http://kos.enix.org/ - Lolut: http://lolut.utbm.info
Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E  1624 F653 CB30 98D3 F7A7

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Compilation fails with CONFIG_DEBUG_SPINLOCK
  2004-10-13  9:20 Compilation fails with CONFIG_DEBUG_SPINLOCK Thomas Petazzoni
@ 2004-10-18 10:03 ` Thomas Petazzoni
  2004-10-22 12:50 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2004-10-18 10:03 UTC (permalink / raw)
  To: linux-mips

Hello,

Any advices to fix this problem ?

Thanks,

Thomas

On Wed, Oct 13, 2004 at 11:20:57AM +0200, Thomas Petazzoni wrote :
> Hello,
> 
> With the last CVS, if you check CONFIG_DEBUG_SPINLOCK, the compilation
> fails :
> 
> arch/mips/kernel/built-in.o(.text+0x2e84): In function `probe_irq_on':
> : undefined reference to `atomic_lock'
> arch/mips/kernel/built-in.o(.text+0x2e88): In function `probe_irq_on':
> : undefined reference to `atomic_lock'
> arch/mips/kernel/built-in.o(.text+0x2e90): In function `probe_irq_on':
> : undefined reference to `atomic_lock'
> arch/mips/kernel/built-in.o(.text+0x2e94): In function `probe_irq_on':
> : undefined reference to `atomic_lock'
> arch/mips/kernel/built-in.o(.text+0x2ebc): In function `probe_irq_on':
> : undefined reference to `atomic_lock'
> arch/mips/kernel/built-in.o(.text+0x2ec0): more undefined references
> to `atomic_lock' follow
> make: *** [.tmp_vmlinux1] Error 1
> 
> Some macros in include/asm/atomic.h uses a spinlock called
> atomic_lock. An "extern" definition is made at the top of the file,
> but the real spinlock is not defined anywhere.
> 
> I think this is trivial to fix, but I'm not sure what is the right
> place to declare the spin lock and to initialize it.
> 
> Thomas
> -- 
> PETAZZONI Thomas - thomas.petazzoni@enix.org 
> http://thomas.enix.org - Jabber: kos_tom@sourcecode.de
> KOS: http://kos.enix.org/ - Lolut: http://lolut.utbm.info
> Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E  1624 F653 CB30 98D3 F7A7

-- 
PETAZZONI Thomas - thomas.petazzoni@enix.org 
http://thomas.enix.org - Jabber: kos_tom@sourcecode.de
KOS: http://kos.enix.org/ - Lolut: http://lolut.utbm.info
Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E  1624 F653 CB30 98D3 F7A7

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Compilation fails with CONFIG_DEBUG_SPINLOCK
  2004-10-13  9:20 Compilation fails with CONFIG_DEBUG_SPINLOCK Thomas Petazzoni
  2004-10-18 10:03 ` Thomas Petazzoni
@ 2004-10-22 12:50 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2004-10-22 12:50 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: linux-mips, mentre

On Wed, Oct 13, 2004 at 11:20:57AM +0200, Thomas Petazzoni wrote:

> I think this is trivial to fix, but I'm not sure what is the right
> place to declare the spin lock and to initialize it.

atomic_lock is intentionally undefined.  The code using it should ever
be referenced on uni-processor systems that don't have ll/sc and on those
the spinlock code happens to not reference the spinlock_t argument not
at all.  So iow if the compiled code actually references atomic_lock,
something is smelling.  In general the reason is not having an
include/asm-mips/mach-<foo>/cpu-feature-overrides.h file.  If this is
missing the kernel will fallback to runtime detection of cpu_has_llsc
which due to the performance sensitive nature of most atomic_t users is
a bad idea.  So this error is the bomb hidden in the code to alert
users ...

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-22 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-13  9:20 Compilation fails with CONFIG_DEBUG_SPINLOCK Thomas Petazzoni
2004-10-18 10:03 ` Thomas Petazzoni
2004-10-22 12:50 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox