[patch 062/126] arch: define CPU_BIG_ENDIAN for all fixed big endian archs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Babu Moger <babu.moger@xxxxxxxxxx>
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@xxxxxxxxxx
Signed-off-by: Babu Moger <babu.moger@xxxxxxxxxx>
Suggested-by: Arnd Bergmann <arnd@xxxxxxxx>
Acked-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Acked-by: David S. Miller <davem@xxxxxxxxxxxxx>
Acked-by: Stafford Horne <shorne@xxxxxxxxx>
Cc: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>
Cc: Jonas Bonn <jonas@xxxxxxxxxxxx>
Cc: Stefan Kristiansson <stefan.kristiansson@xxxxxxxxxxxxx>
Cc: "James E.J. Bottomley" <jejb@xxxxxxxxxxxxxxxx>
Cc: Helge Deller <deller@xxxxxx>
Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Michal Simek <monstr@xxxxxxxxx>
Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> (powerpc)
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Max Filippov <jcmvbkbc@xxxxxxxxx>
Cc: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/frv/Kconfig      |    3 +++
 arch/h8300/Kconfig    |    3 +++
 arch/m68k/Kconfig     |    3 +++
 arch/openrisc/Kconfig |    3 +++
 arch/parisc/Kconfig   |    3 +++
 arch/sparc/Kconfig    |    3 +++
 6 files changed, 18 insertions(+)

diff -puN arch/frv/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs arch/frv/Kconfig
--- a/arch/frv/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs
+++ a/arch/frv/Kconfig
@@ -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
diff -puN arch/h8300/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs arch/h8300/Kconfig
--- a/arch/h8300/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs
+++ a/arch/h8300/Kconfig
@@ -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
 
diff -puN arch/m68k/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs arch/m68k/Kconfig
--- a/arch/m68k/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs
+++ a/arch/m68k/Kconfig
@@ -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
diff -puN arch/openrisc/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs arch/openrisc/Kconfig
--- a/arch/openrisc/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs
+++ a/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
 
diff -puN arch/parisc/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs arch/parisc/Kconfig
--- a/arch/parisc/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs
+++ a/arch/parisc/Kconfig
@@ -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
 
diff -puN arch/sparc/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs arch/sparc/Kconfig
--- a/arch/sparc/Kconfig~arch-define-cpu_big_endian-for-all-fixed-big-endian-archs
+++ a/arch/sparc/Kconfig
@@ -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
_
--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux