]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ARC: [BE] readl()/writel() to work in Big Endian CPU configuration
authorLada Trimasova <ltrimas@synopsys.com>
Wed, 9 Mar 2016 17:21:04 +0000 (20:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:08:56 +0000 (09:08 -0700)
commitf640dae8943ecbcc9ee6710aec89bba594512336
tree25ca576d7ebfe49cd36fab719c2b4eea421180e7
parent1f841628aca5d4133ad2aba0e2f279c8ab65b9d8
ARC: [BE] readl()/writel() to work in Big Endian CPU configuration

commit f778cc65717687a3d3f26dd21bef62cd059f1b8b upstream.

read{l,w}() write{l,w}() primitives should use le{16,32}_to_cpu() and
cpu_to_le{16,32}() respectively to ensure device registers are read
correctly in Big Endian CPU configuration.

Per Arnd Bergmann
| Most drivers using readl() or readl_relaxed() expect those to perform byte
| swaps on big-endian architectures, as the registers tend to be fixed endian

This was needed for getting UART to work correctly on a Big Endian ARC.

The ARC accessors originally were fine, and the bug got introduced
inadventently by commit b8a033023994 ("ARCv2: barriers")

Fixes: b8a033023994 ("ARCv2: barriers")
Link: http://lkml.kernel.org/r/201603100845.30602.arnd@arndb.de
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lada Trimasova <ltrimas@synopsys.com>
[vgupta: beefed up changelog, added Fixes/stable tags]
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arc/include/asm/io.h