From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751802AbdG0VLd (ORCPT ); Thu, 27 Jul 2017 17:11:33 -0400 Received: from mout.gmx.net ([212.227.17.22]:53382 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751775AbdG0VL3 (ORCPT ); Thu, 27 Jul 2017 17:11:29 -0400 Subject: Re: [PATCH v3 1/3] arch: Define CPU_BIG_ENDIAN for all fixed big endian archs To: Babu Moger , ysato@users.sourceforge.jp, geert@linux-m68k.org, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com, jejb@parisc-linux.org, viro@zeniv.linux.org.uk, monstr@monstr.eu Cc: mpe@ellerman.id.au, peterz@infradead.org, mingo@redhat.com, jcmvbkbc@gmail.com, linux-kernel@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, linux-m68k@vger.kernel.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org References: <1497305400-147425-1-git-send-email-babu.moger@oracle.com> <1497305400-147425-2-git-send-email-babu.moger@oracle.com> From: Helge Deller Message-ID: <8d0ac21c-5642-14f6-3820-815a1cc3c418@gmx.de> Date: Thu, 27 Jul 2017 23:10:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1497305400-147425-2-git-send-email-babu.moger@oracle.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:e6M+uTH/NKgakhh4r7vrbanSXIEt76nkVr/MgbSBywSrQMyrAJY m1sZvo6nPfzkdhmi9qecIAwmNCmxPnV5/l+fW6djwdAOt1HwdQl/gv81RoTU0t4h97zq1gj s9eAJui2rQ1woOTJnfVEnEWX4cbB2de1ckVOGidcSCuT/x4JnE+18hQ29ntbWmZMFeLBY/a bSZokUKSgBZJfbIGzjSUA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Fgd1GOzBo9g=:sfT4qtTlr91VwsQpmlU2M9 2BxY5CCT7g2q+OjmJuYu8FeWP/Ms9TtmdlogvfFf24FflmNGqXUTvFReT1/ieLiSh4q5oVxUQ QQmbpszFCamBej/h+oxP1mZJhXl3msngBp9Z49XQav7TW6PFTSyZJ7vt8uyi1VtIhDLPPJ2hD QuRBtA1vUubDHN8mjgLuwks2OL9JjYNtkXG0djeMOHY5U668yQcVjOiCgVAHwfMjLykr/6+0K cpVd3ehv5W7L9vH6ClYV5EB2W7Z4ZiaP/ZreyjFT53bqThxhC9jCJyS3JYiyZ0hKAlaRPKZgZ eoiEIFPdTOlJE1pZlVYNFXdpQ8u8Cjmlziy8dJLWGrRyQfUwfQ0NKY/a7mGDA10FSTqugVH+i lLykAQzz+2ODGUeqsLe9Jwq+XimyCiWYCedREIfD6b8ErnpD16TDe2HWmIyolzrgMip+fqSz9 qhZL62VF7eD487J+fOBi81WkpwF0gseQvMEUPKxBwcLyjMnuSBAuX99eoaO4Z/Q7Uh6Hy0hkX YyYTcb2PqeTNPBw/KxsjKcABbpMJbLYzT/xyKSoRaKCRugF12ucMbwXMHzvJf+ARDG90w+Vty /s0mLkdZyCv7zvkhddT7GnZ9KIw4ggHRdhRlFlSRO6QbwXjvGPUnTFRvyBoG2FqNXToHdiPpj Ue1F8tNT5FU60NDLjU0nk3JstRzE4nBfpNimuYceGlaOzY2oo1arCsF2CsUb8bkA8B1Ej29I5 5BUTuDgqP8sHdXj+jjC8yTfClpYDD5WKt5ZL1goUIrBWYDIYzWAUnVgWSNUrTi26n0rIwwkwH kSLfLIL1n5n1DGzXW5QIs/SIbImKMKUA/KfK7fnnaMlAR5Dqis= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13.06.2017 00:09, Babu Moger wrote: > 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 > > Signed-off-by: Babu Moger > Suggested-by: Arnd Bergmann > Acked-by: Geert Uytterhoeven > Acked-by: David S. Miller > Acked-by: Stafford Horne It seems for sparc it was already merged? Anyway, you may add Acked-by: Helge Deller # parisc Helge > --- > 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(+), 0 deletions(-) > > diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig > index eefd9a4..1cce824 100644 > --- a/arch/frv/Kconfig > +++ b/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 --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig > index 3ae8525..5380ac8 100644 > --- a/arch/h8300/Kconfig > +++ b/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 --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig > index d140206..029a58b 100644 > --- a/arch/m68k/Kconfig > +++ b/arch/m68k/Kconfig > @@ -23,6 +23,9 @@ config M68K > select OLD_SIGSUSPEND3 > select OLD_SIGACTION > > +config CPU_BIG_ENDIAN > + def_bool y > + > config RWSEM_GENERIC_SPINLOCK > bool > default y > diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig > index 1e95920..a0f2e4a 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 > > diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig > index 531da9e..dda1f55 100644 > --- a/arch/parisc/Kconfig > +++ b/arch/parisc/Kconfig > @@ -47,6 +47,9 @@ config PARISC > and later HP3000 series). The PA-RISC Linux project home page is > at . > > +config CPU_BIG_ENDIAN > + def_bool y > + > config MMU > def_bool y > > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > index 908f019..0d9dc49 100644 > --- a/arch/sparc/Kconfig > +++ b/arch/sparc/Kconfig > @@ -92,6 +92,9 @@ config ARCH_DEFCONFIG > config ARCH_PROC_KCORE_TEXT > def_bool y > > +config CPU_BIG_ENDIAN > + def_bool y > + > config ARCH_ATU > bool > default y if SPARC64 >