From: Roland Dreier <rdreier@cisco.com>
To: "Pravin Nanaware" <p.nanaware@nihilent.com>
Cc: "John Hubbard" <john.hubbard@gmail.com>,
"LKML" <linux-kernel@vger.kernel.org>
Subject: Re: Bitops source problem
Date: Wed, 16 Jan 2008 22:44:35 -0800 [thread overview]
Message-ID: <adamyr5x86k.fsf@cisco.com> (raw)
In-Reply-To: <1145971D427D7F43B0DBDAE22221C4B502CCE22D@nipns00a210.FPS.NIHILENT.COM> (Pravin Nanaware's message of "Thu, 17 Jan 2008 12:08:19 +0530")
> Then, I think there is a problem with the function written below which is meant to be atomic.
>
> static __inline__ void change_bit(int nr, volatile void * addr)
> {
> __asm__ __volatile__(
> "btcl %1,%0"
> :"=m" (ADDR)
> :"Ir" (nr));
> }
If that is indeed the source of your change_bit function then there is
a problem. However in my kernel tree there is a LOCK_PREFIX in the
definition of the atomic version. I don't have your exact source tree
handy, but on a local RHEL4 system, the LOCK_PREFIX is still there:
static inline void change_bit(int nr, volatile unsigned long * addr)
{
__asm__ __volatile__( LOCK_PREFIX
"btcl %1,%0"
:"=m" (ADDR)
:"Ir" (nr));
}
- R.
next prev parent reply other threads:[~2008-01-17 6:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 6:38 Bitops source problem Pravin Nanaware
2008-01-17 6:44 ` Roland Dreier [this message]
2008-01-17 6:59 ` KOSAKI Motohiro
-- strict thread matches above, loose matches on Subject: below --
2008-01-18 4:40 Pravin Nanaware
2008-01-17 8:11 Pravin Nanaware
2008-01-17 19:32 ` Roland Dreier
2008-01-17 5:09 Pravin Nanaware
2008-01-17 5:47 ` John Hubbard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adamyr5x86k.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=john.hubbard@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=p.nanaware@nihilent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox