From: holger.brunck@keymile.com (Holger Brunck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm/orion: use set_bit and clear_bit in gpio implementation
Date: Wed, 07 Dec 2011 16:59:07 +0100 [thread overview]
Message-ID: <4EDF8D4B.3020806@keymile.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1112071031470.2907@xanadu.home>
On 12/07/2011 04:46 PM, Nicolas Pitre wrote:
> On Wed, 7 Dec 2011, Holger Brunck wrote:
>
>> set_bit and clear_bit are already atomic operations. So use this
>> functions to set or unset gpio configurations. This makes the
>> additional spinlock unneeded.
>>
>> Signed-off-by: Stefan Bigler <stefan.bigler@keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> cc: Lennert Buytenhek <kernel@wantstofly.org>
>> cc: Nicolas Pitre <nico@fluxnic.net>
>> cc: Russell King <linux@arm.linux.org.uk>
>> cc: Thomas Gleixner <tglx@linutronix.de>
>
> NAK.
>
> Although this ends up equivalent in practice at the moment, the IO space
> accessed through readl() and writel() is conceptually a different thing
> than normal memory where the atomic set/clear bit functions are used.
> There is no guarantee that the value passed to readl()/writel() will
> always match the virtual address where the access is performed.
>
> Furthermore, there is no guarantee made by the atomic bit manipulation
> routines about the actual access to memory. At one point those used to
> be implemented with byte accesses not word accesses, and there is
> nothing preventing the implementation from changing in similar ways in
> the future that might have unwanted effects with IO memory.
>
> And if using an ARMv6+ core as found in the Marvell Dove or MV78xx0 SOCs
> which this patch also affects then the atomic bitops are implemented in
> terms of the load/store exclusive instructions which are architecturally
> not defined when applied to IO space.
>
Ok, thanks for the explanation.
Best regards
Holger Brunck
prev parent reply other threads:[~2011-12-07 15:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-07 14:34 [PATCH] arm/orion: use set_bit and clear_bit in gpio implementation Holger Brunck
2011-12-07 14:36 ` Lennert Buytenhek
2011-12-07 15:46 ` Nicolas Pitre
2011-12-07 15:59 ` Holger Brunck [this message]
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=4EDF8D4B.3020806@keymile.com \
--to=holger.brunck@keymile.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.