[PATCH] arm/orion: use set_bit and clear_bit in gpio implementation
Holger Brunck
holger.brunck at keymile.com
Wed Dec 7 10:59:07 EST 2011
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 at keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck at keymile.com>
>> cc: Lennert Buytenhek <kernel at wantstofly.org>
>> cc: Nicolas Pitre <nico at fluxnic.net>
>> cc: Russell King <linux at arm.linux.org.uk>
>> cc: Thomas Gleixner <tglx at 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
More information about the linux-arm-kernel
mailing list