From 4c97a0c8fee302fe64feed21e6f7ed25e3e651b8 Mon Sep 17 00:00:00 2001 From: Babu Moger Date: Fri, 8 Sep 2017 16:14:22 -0700 Subject: arch: define CPU_BIG_ENDIAN for all fixed big endian archs 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/1499358861-179979-2-git-send-email-babu.moger@oracle.com Signed-off-by: Babu Moger Suggested-by: Arnd Bergmann Acked-by: Geert Uytterhoeven Acked-by: David S. Miller Acked-by: Stafford Horne Cc: Yoshinori Sato Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Alexander Viro Cc: Michal Simek Cc: Michael Ellerman (powerpc) Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Max Filippov Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/openrisc/Kconfig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/openrisc/Kconfig') diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index 1e95920b0737..a0f2e4a323c1 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -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 -- cgit v1.2.3