parisc: Remove 64bit access on 32bit machines
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 3 Sep 2022 22:45:25 +0000 (00:45 +0200)
committerArnd Bergmann <arnd@arndb.de>
Sat, 10 Sep 2022 07:55:55 +0000 (09:55 +0200)
commit77bfc8bdb5a1cdbcea21daccdf1686e1bfea3db6
tree12b2dffc8c73c6444a0b1a7ab8f8b60a6ae9c606
parent2c230431e1e809270178905974f57cf3878939f5
parisc: Remove 64bit access on 32bit machines

The parisc was using some readq/writeq accessors without special
considerations as to what will happen on 32bit CPUs if you do
this. Maybe we have been lucky that it "just worked" on 32bit
due to the compiler behaviour, or the code paths were never
executed.

Fix the two offending code sites like this:

arch/parisc/lib/iomap.c:

- Put ifdefs around the 64bit accessors and make sure
  that ioread64, ioread64be, iowrite64 and iowrite64be
  are not available on 32bit builds.

- Also fold in a bug fix where 64bit access was by
  mistake using 32bit writel() accessors rather
  than 64bit writeq().

drivers/parisc/sba_iommu.c:

- Access any 64bit registers using _lo_hi-semantics by way
  of the readq and writeq operations provided by
  <linux/io-64-nonatomic-lo-hi.h>

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/parisc/lib/iomap.c
drivers/parisc/sba_iommu.c