mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Problem with using spinlocks when kernel is compiled without smp-support
@ 2005-12-08 16:10 Dirk Henning Gerdes
  2005-12-08 16:17 ` Problem with using spinlocks when kernel is compiled withoutsmp-support linux-os (Dick Johnson)
  0 siblings, 1 reply; 3+ messages in thread
From: Dirk Henning Gerdes @ 2005-12-08 16:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

Hello Andrew!

I have the following problem on 2.6.15-rc5-mm1

When compiling a module using spinlocks I get the following
error-message, when SMP is disabled in my Kernel-config:




In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
include/asm/spinlock.h:21:1: warning: "__raw_spin_is_locked" redefined
In file included from include/linux/spinlock.h:90,
                 from include/linux/kobject.h:23,
                 from include/linux/device.h:16,
                 from include/linux/genhd.h:15,
                 from include/linux/blkdev.h:6,
                 from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:1:
include/linux/spinlock_up.h:61:1: warning: this is the location of the
previous definition
In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
include/asm/spinlock.h:51: error: syntax error before 'do'
include/asm/spinlock.h: In function '__raw_spin_lock_flags':
include/asm/spinlock.h:62: error: 'struct <anonymous>' has no member
named 'slock'
include/asm/spinlock.h:60: error: invalid lvalue in asm output 0
include/asm/spinlock.h: At top level:
include/asm/spinlock.h:65: error: syntax error before '{' token
include/asm/spinlock.h:89: error: syntax error before 'do'
In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
include/asm/spinlock.h:114:1: warning: "__raw_spin_unlock_wait"
redefined
In file included from include/linux/spinlock.h:90,
                 from include/linux/kobject.h:23,
                 from include/linux/device.h:16,
                 from include/linux/genhd.h:15,
                 from include/linux/blkdev.h:6,
                 from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:1:
include/linux/spinlock_up.h:71:1: warning: this is the location of the
previous definition
In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
include/asm/spinlock.h:142:1: warning: "__raw_read_can_lock" redefined
In file included from include/linux/spinlock.h:90,
                 from include/linux/kobject.h:23,
                 from include/linux/device.h:16,
                 from include/linux/genhd.h:15,
                 from include/linux/blkdev.h:6,
                 from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:1:
include/linux/spinlock_up.h:68:1: warning: this is the location of the
previous definition
In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
include/asm/spinlock.h:148:1: warning: "__raw_write_can_lock" redefined
In file included from include/linux/spinlock.h:90,
                 from include/linux/kobject.h:23,
                 from include/linux/device.h:16,
                 from include/linux/genhd.h:15,
                 from include/linux/blkdev.h:6,
                 from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:1:
include/linux/spinlock_up.h:69:1: warning: this is the location of the
previous definition
include/asm/spinlock.h: In function '__raw_read_unlock':
include/asm/spinlock.h:181: error: 'struct <anonymous>' has no member
named 'lock'
include/asm/spinlock.h:181: error: invalid lvalue in asm output 0
include/asm/spinlock.h: In function '__raw_write_unlock':
include/asm/spinlock.h:187: error: 'struct <anonymous>' has no member
named 'lock'
include/asm/spinlock.h:186: error: invalid lvalue in asm output 0



shouldn't it be possible to use spinlocks in my code even if I don't
support SMP for compatiblity ?


Dirk 


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

* Re: Problem with using spinlocks when kernel is compiled withoutsmp-support
  2005-12-08 16:10 Problem with using spinlocks when kernel is compiled without smp-support Dirk Henning Gerdes
@ 2005-12-08 16:17 ` linux-os (Dick Johnson)
  0 siblings, 0 replies; 3+ messages in thread
From: linux-os (Dick Johnson) @ 2005-12-08 16:17 UTC (permalink / raw)
  To: Dirk Henning Gerdes; +Cc: Andrew Morton, LKML


On Thu, 8 Dec 2005, Dirk Henning Gerdes wrote:

> Hello Andrew!
>
> I have the following problem on 2.6.15-rc5-mm1
>
> When compiling a module using spinlocks I get the following
> error-message, when SMP is disabled in my Kernel-config:
>
>
>
>
> In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
> include/asm/spinlock.h:21:1: warning: "__raw_spin_is_locked" redefined
> In file included from include/linux/spinlock.h:90,
>                 from include/linux/kobject.h:23,
>                 from include/linux/device.h:16,
>                 from include/linux/genhd.h:15,
>                 from include/linux/blkdev.h:6,
>                 from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:1:
> include/linux/spinlock_up.h:61:1: warning: this is the location of the
> previous definition
> In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
> include/asm/spinlock.h:51: error: syntax error before 'do'
> include/asm/spinlock.h: In function '__raw_spin_lock_flags':
> include/asm/spinlock.h:62: error: 'struct <anonymous>' has no member
> named 'slock'
> include/asm/spinlock.h:60: error: invalid lvalue in asm output 0
> include/asm/spinlock.h: At top level:
> include/asm/spinlock.h:65: error: syntax error before '{' token
> include/asm/spinlock.h:89: error: syntax error before 'do'
> In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
> include/asm/spinlock.h:114:1: warning: "__raw_spin_unlock_wait"
> redefined
> In file included from include/linux/spinlock.h:90,
>                 from include/linux/kobject.h:23,
>                 from include/linux/device.h:16,
>                 from include/linux/genhd.h:15,
>                 from include/linux/blkdev.h:6,
>                 from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:1:
> include/linux/spinlock_up.h:71:1: warning: this is the location of the
> previous definition
> In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
> include/asm/spinlock.h:142:1: warning: "__raw_read_can_lock" redefined
> In file included from include/linux/spinlock.h:90,
>                 from include/linux/kobject.h:23,
>                 from include/linux/device.h:16,
>                 from include/linux/genhd.h:15,
>                 from include/linux/blkdev.h:6,
>                 from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:1:
> include/linux/spinlock_up.h:68:1: warning: this is the location of the
> previous definition
> In file included from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:7:
> include/asm/spinlock.h:148:1: warning: "__raw_write_can_lock" redefined
> In file included from include/linux/spinlock.h:90,
>                 from include/linux/kobject.h:23,
>                 from include/linux/device.h:16,
>                 from include/linux/genhd.h:15,
>                 from include/linux/blkdev.h:6,
>                 from /home/dirk/Masterarbeit/mynoop/test/mynoop.c:1:
> include/linux/spinlock_up.h:69:1: warning: this is the location of the
> previous definition
> include/asm/spinlock.h: In function '__raw_read_unlock':
> include/asm/spinlock.h:181: error: 'struct <anonymous>' has no member
> named 'lock'
> include/asm/spinlock.h:181: error: invalid lvalue in asm output 0
> include/asm/spinlock.h: In function '__raw_write_unlock':
> include/asm/spinlock.h:187: error: 'struct <anonymous>' has no member
> named 'lock'
> include/asm/spinlock.h:186: error: invalid lvalue in asm output 0
>
>
>
> shouldn't it be possible to use spinlocks in my code even if I don't
> support SMP for compatiblity ?
>
>
> Dirk

Yes. And it used to be true. Certainly one should never use
cli() and sti() so all you have to protect critical sections
from interrupts are spin-locks. This has been broken for some
time so, I suggest you just enable SMP in your .config and
live with it for the time being.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips).
Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

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

* Re: Problem with using spinlocks when kernel is compiled without smp-support
       [not found] <5hwF1-kN-17@gated-at.bofh.it>
@ 2005-12-09  4:24 ` Robert Hancock
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Hancock @ 2005-12-09  4:24 UTC (permalink / raw)
  To: linux-kernel

Dirk Henning Gerdes wrote:
> Hello Andrew!
> 
> I have the following problem on 2.6.15-rc5-mm1
> 
> When compiling a module using spinlocks I get the following
> error-message, when SMP is disabled in my Kernel-config:

..

> shouldn't it be possible to use spinlocks in my code even if I don't
> support SMP for compatiblity ?

Yes, it is, something must be set up wrong in your compilation. In 
particular, are you trying to use old 2.4-style makefiles to build 
instead of one that calls the kernel's build system? If so, don't, it 
doesn't work..

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


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

end of thread, other threads:[~2005-12-09  4:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-08 16:10 Problem with using spinlocks when kernel is compiled without smp-support Dirk Henning Gerdes
2005-12-08 16:17 ` Problem with using spinlocks when kernel is compiled withoutsmp-support linux-os (Dick Johnson)
     [not found] <5hwF1-kN-17@gated-at.bofh.it>
2005-12-09  4:24 ` Problem with using spinlocks when kernel is compiled without smp-support Robert Hancock

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

all inboxes | Powered by JetHome®