Skip to content

Commit

Permalink
Merge tag 'regmap-fix-v4.5-big-endian' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/linux/kernel/git/broonie/regmap

Pull regmap fix from Mark Brown:
 "A single revert back to v4.4 endianness handling.

  Commit 29bb45f ("regmap-mmio: Use native endianness for
  read/write") attempted to fix some long standing bugs in the MMIO
  implementation for big endian systems caused by duplicate byte
  swapping in both regmap and readl()/writel().  Sadly the fix makes
  things worse rather than better, so revert it for now"

* tag 'regmap-fix-v4.5-big-endian' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: mmio: Revert to v4.4 endianness handling
  • Loading branch information
Linus Torvalds committed Feb 8, 2016
2 parents 4ba6a2b + 320549a commit 92e6edd
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm6328.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
timer: timer@10000040 {
compatible = "syscon";
reg = <0x10000040 0x2c>;
little-endian;
};

reboot {
Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm7125.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
sun_top_ctrl: syscon@404000 {
compatible = "brcm,bcm7125-sun-top-ctrl", "syscon";
reg = <0x404000 0x60c>;
little-endian;
};

reboot {
Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm7346.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
sun_top_ctrl: syscon@404000 {
compatible = "brcm,bcm7346-sun-top-ctrl", "syscon";
reg = <0x404000 0x51c>;
little-endian;
};

reboot {
Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm7358.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
sun_top_ctrl: syscon@404000 {
compatible = "brcm,bcm7358-sun-top-ctrl", "syscon";
reg = <0x404000 0x51c>;
little-endian;
};

reboot {
Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm7360.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
sun_top_ctrl: syscon@404000 {
compatible = "brcm,bcm7360-sun-top-ctrl", "syscon";
reg = <0x404000 0x51c>;
little-endian;
};

reboot {
Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm7362.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
sun_top_ctrl: syscon@404000 {
compatible = "brcm,bcm7362-sun-top-ctrl", "syscon";
reg = <0x404000 0x51c>;
little-endian;
};

reboot {
Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm7420.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
sun_top_ctrl: syscon@404000 {
compatible = "brcm,bcm7420-sun-top-ctrl", "syscon";
reg = <0x404000 0x60c>;
little-endian;
};

reboot {
Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm7425.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
sun_top_ctrl: syscon@404000 {
compatible = "brcm,bcm7425-sun-top-ctrl", "syscon";
reg = <0x404000 0x51c>;
little-endian;
};

reboot {
Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/brcm/bcm7435.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
sun_top_ctrl: syscon@404000 {
compatible = "brcm,bcm7425-sun-top-ctrl", "syscon";
reg = <0x404000 0x51c>;
little-endian;
};

reboot {
Expand Down
16 changes: 8 additions & 8 deletions drivers/base/regmap/regmap-mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ static int regmap_mmio_gather_write(void *context,
while (val_size) {
switch (ctx->val_bytes) {
case 1:
__raw_writeb(*(u8 *)val, ctx->regs + offset);
writeb(*(u8 *)val, ctx->regs + offset);
break;
case 2:
__raw_writew(*(u16 *)val, ctx->regs + offset);
writew(*(u16 *)val, ctx->regs + offset);
break;
case 4:
__raw_writel(*(u32 *)val, ctx->regs + offset);
writel(*(u32 *)val, ctx->regs + offset);
break;
#ifdef CONFIG_64BIT
case 8:
__raw_writeq(*(u64 *)val, ctx->regs + offset);
writeq(*(u64 *)val, ctx->regs + offset);
break;
#endif
default:
Expand Down Expand Up @@ -193,17 +193,17 @@ static int regmap_mmio_read(void *context,
while (val_size) {
switch (ctx->val_bytes) {
case 1:
*(u8 *)val = __raw_readb(ctx->regs + offset);
*(u8 *)val = readb(ctx->regs + offset);
break;
case 2:
*(u16 *)val = __raw_readw(ctx->regs + offset);
*(u16 *)val = readw(ctx->regs + offset);
break;
case 4:
*(u32 *)val = __raw_readl(ctx->regs + offset);
*(u32 *)val = readl(ctx->regs + offset);
break;
#ifdef CONFIG_64BIT
case 8:
*(u64 *)val = __raw_readq(ctx->regs + offset);
*(u64 *)val = readq(ctx->regs + offset);
break;
#endif
default:
Expand Down

0 comments on commit 92e6edd

Please sign in to comment.