arch: define CPU_BIG_ENDIAN for all fixed big endian archs
authorBabu Moger <[email protected]>
Fri, 8 Sep 2017 23:14:22 +0000 (16:14 -0700)
committerLinus Torvalds <[email protected]>
Sat, 9 Sep 2017 01:26:48 +0000 (18:26 -0700)
Patch series "Define CPU_BIG_ENDIAN or warn for inconsistencies", v3.

While working on enabling queued rwlock on SPARC, found this following
code in include/asm-generic/qrwlock.h which uses CONFIG_CPU_BIG_ENDIAN to
clear a byte.

static inline u8 *__qrwlock_write_byte(struct qrwlock *lock)
 {
return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
 }

Problem is many of the fixed big endian architectures don't define
CPU_BIG_ENDIAN and clears the wrong byte.

Define CPU_BIG_ENDIAN for all the fixed big endian architecture to fix it.

Also found few more references of this config parameter in
drivers/of/base.c
drivers/of/fdt.c
drivers/tty/serial/earlycon.c
drivers/tty/serial/serial_core.c
Be aware that this may cause regressions if someone has worked-around
problems in the above code already. Remove the work-around.

Here is our original discussion
https://lkml.org/lkml/2017/5/24/620

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Babu Moger <[email protected]>
Suggested-by: Arnd Bergmann <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Acked-by: David S. Miller <[email protected]>
Acked-by: Stafford Horne <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: Jonas Bonn <[email protected]>
Cc: Stefan Kristiansson <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Michael Ellerman <[email protected]> (powerpc)
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/frv/Kconfig
arch/h8300/Kconfig
arch/m68k/Kconfig
arch/openrisc/Kconfig
arch/parisc/Kconfig
arch/sparc/Kconfig

index eefd9a4ed156753b6f07cb41cd0cb97ca0f99a48..1cce8243449e03da1855e39c180e9a459bb3ccc7 100644 (file)
@@ -17,6 +17,9 @@ config FRV
        select HAVE_DEBUG_STACKOVERFLOW
        select ARCH_NO_COHERENT_DMA_MMAP
 
+config CPU_BIG_ENDIAN
+       def_bool y
+
 config ZONE_DMA
        bool
        default y
index 6e3d36f37a02f146424c4ba0b87ae8ab153a0a1c..3089f7fe2abdb2aafa7bb613c45319720ea77a4f 100644 (file)
@@ -23,6 +23,9 @@ config H8300
        select HAVE_ARCH_HASH
        select CPU_NO_EFFICIENT_FFS
 
+config CPU_BIG_ENDIAN
+       def_bool y
+
 config RWSEM_GENERIC_SPINLOCK
        def_bool y
 
index 5abb548f0e7075320e339671bbb4cbae65a8d2cd..353d90487c2b9e74bb56e3b35205ae74901b6325 100644 (file)
@@ -24,6 +24,9 @@ config M68K
        select OLD_SIGSUSPEND3
        select OLD_SIGACTION
 
+config CPU_BIG_ENDIAN
+       def_bool y
+
 config RWSEM_GENERIC_SPINLOCK
        bool
        default y
index 1e95920b07377417415c8622201d8e04bfd1f1a7..a0f2e4a323c1d543b46f8de29c90ab3d90519b72 100644 (file)
@@ -29,6 +29,9 @@ config OPENRISC
        select CPU_NO_EFFICIENT_FFS if !OPENRISC_HAVE_INST_FF1
        select NO_BOOTMEM
 
+config CPU_BIG_ENDIAN
+       def_bool y
+
 config MMU
        def_bool y
 
index 13648519bd415e938368d9b6b8ae55e65fce2ff5..ba7b7ddc38442dab7e9b0679bba03478bf20096c 100644 (file)
@@ -59,6 +59,9 @@ config PARISC
 config CPU_BIG_ENDIAN
        def_bool y
 
+config CPU_BIG_ENDIAN
+       def_bool y
+
 config MMU
        def_bool y
 
index a4a626199c47e1afce31559a028df4cda331f619..0be3828752e5bc9ddf33ba74c9e5b9efd03691e4 100644 (file)
@@ -97,6 +97,9 @@ config ARCH_PROC_KCORE_TEXT
 config CPU_BIG_ENDIAN
        def_bool y
 
+config CPU_BIG_ENDIAN
+       def_bool y
+
 config ARCH_ATU
        bool
        default y if SPARC64