Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1662712

[PATCH v2 0/2] Define CPU_BIG_ENDIAN or warn for inconsistencies

From Babu Moger <babu.moger@oracle.com>
Newsgroups linux.kernel
Subject [PATCH v2 0/2] Define CPU_BIG_ENDIAN or warn for inconsistencies
Date 2017-06-09 21:50 +0200
Message-ID <tQy4W-5Fa-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Found this problem while enabling queued rwlock on SPARC.
The parameter CONFIG_CPU_BIG_ENDIAN is used to clear the
specific byte in qrwlock structure. Without this parameter,
we clear the wrong byte.
Here is the code in include/asm-generic/qrwlock.h

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

Also found few more references of this parameter in
drivers/of/base.c
drivers/of/fdt.c
drivers/tty/serial/earlycon.c
drivers/tty/serial/serial_core.c

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

Based on the discussion, it was decided to add CONFIG_CPU_BIG_ENDIAN
for all the fixed big endian architecture(frv, h8300, m68k, openrisc,
parisc and sparc). And warn if there are inconsistencies in this definition.

v1 -> v2:
 Updated the commit messages and acks.

Babu Moger (2):
  arch: Define CPU_BIG_ENDIAN for all fixed big endian archs
  include: warn for inconsistent endian config definition

 arch/frv/Kconfig                        |    3 +++
 arch/h8300/Kconfig                      |    3 +++
 arch/m68k/Kconfig                       |    3 +++
 arch/openrisc/Kconfig                   |    3 +++
 arch/parisc/Kconfig                     |    3 +++
 arch/sparc/Kconfig                      |    3 +++
 include/linux/byteorder/big_endian.h    |    4 ++++
 include/linux/byteorder/little_endian.h |    4 ++++
 8 files changed, 26 insertions(+), 0 deletions(-)

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] Define CPU_BIG_ENDIAN or warn for inconsistencies Babu Moger <babu.moger@oracle.com> - 2017-06-09 21:50 +0200
  [PATCH v2 1/2] arch: Define CPU_BIG_ENDIAN for all fixed big endian archs Babu Moger <babu.moger@oracle.com> - 2017-06-09 22:00 +0200
    Re: [PATCH v2 1/2] arch: Define CPU_BIG_ENDIAN for all fixed big  endian archs Stafford Horne <shorne@gmail.com> - 2017-06-10 10:30 +0200
  [PATCH v2 2/2] include: warn for inconsistent endian config definition Babu Moger <babu.moger@oracle.com> - 2017-06-09 22:00 +0200

csiph-web