lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 26 Jan 2016 15:16:15 -0800
From:	Florian Fainelli <f.fainelli@...il.com>
To:	Mark Brown <broonie@...nel.org>,
	Ralf Baechle <ralf@...ux-mips.org>,
	Kevin Cernekee <cernekee@...il.com>
CC:	linux-kernel@...r.kernel.org, linux-mips@...ux-mips.org,
	Johannes Berg <johannes@...solutions.net>,
	Simon Arlott <simon@...e.lp0.eu>, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH RFC 2/2] MIPS: dt: Explicitly specify native endian behaviour
 for syscon

On 26/01/16 14:46, Mark Brown wrote:
> On many MIPS systems the endianness of IP blocks is kept the same as
> that of the CPU by the hardware.  This includes the system controllers
> on these systems which are controlled via syscon which uses the regmap
> API which used readl() and writel() to interact with the hardware,
> meaning that all writes are converted to little endian when writing to
> the hardware.  This caused a bad interaction with the regmap core in big
> endian mode since it was not aware of the byte swapping and so ended up
> performing little endian writes.
> 
> Unfortunately when this issue was noticed it was addressed by updating
> the DT for the affected devices to specify them as little endian.  This
> happened to work since it resulted in two endianness swaps which
> cancelled each other out and gave little endian behaviour but meant that
> the DT was clearly not accurately describing the hardware.
> 
> The intention of commit 29bb45f25ff305 (regmap-mmio: Use native
> endianness for read/write) was to fix this by making regmap default to
> native endianness but this breaks most other MMIO users where the
> hardware has a fixed endianness and the implementation uses the __raw
> accessors which are not intended to be used outside of architecture
> code.  Instead use the newly added native-endian DT property to say
> exactly what we want for these systems.
> 
> Fixes: 29bb45f25ff305 (regmap-mmio: Use native endianness for read/write)
> Reported-by: Johannes Berg <johannes@...solutions.net>
> Signed-off-by: Mark Brown <broonie@...nel.org>
> ---
> 
> Posted for review only, this will interact with some other patches
> fixing the implementation of regmap-mmio and will probably need to be
> merged along with them.
> 
>  arch/mips/boot/dts/brcm/bcm6328.dtsi | 1 +

v4.5-rc1 now contains an arch/mips/boot/dts/brcm/bcm6368.dtsi which
copied the 6328.dtsi and therefore needs this hunk to be added to your
patch series:

diff --git a/arch/mips/boot/dts/brcm/bcm6368.dtsi
b/arch/mips/boot/dts/brcm/bcm6368.dtsi
index 9c8d3fe28b31..1f6b9b5cddb4 100644
--- a/arch/mips/boot/dts/brcm/bcm6368.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm6368.dtsi
@@ -54,7 +54,7 @@
                periph_cntl: syscon@...00000 {
                        compatible = "syscon";
                        reg = <0x10000000 0x14>;
-                       little-endian;
+                       native-endian;
                };

                reboot: syscon-reboot@...00008 {
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ