linux-stable/arch/arc
Jose Abreu bf69dc3cb1 ARC: io.h: Implement reads{x}()/writes{x}()
[ Upstream commit 10d443431d ]

Some ARC CPU's do not support unaligned loads/stores. Currently, generic
implementation of reads{b/w/l}()/writes{b/w/l}() is being used with ARC.
This can lead to misfunction of some drivers as generic functions do a
plain dereference of a pointer that can be unaligned.

Let's use {get/put}_unaligned() helpers instead of plain dereference of
pointer in order to fix. The helpers allow to get and store data from an
unaligned address whilst preserving the CPU internal alignment.
According to [1], the use of these helpers are costly in terms of
performance so we added an initial check for a buffer already aligned so
that the usage of the helpers can be avoided, when possible.

[1] Documentation/unaligned-memory-access.txt

Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David Laight <David.Laight@ACULAB.COM>
Tested-by: Vitor Soares <soares@synopsys.com>
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:15:16 +01:00
..
boot ARC: dma [IOC]: mark DMA devices connected as dma-coherent 2018-08-31 12:47:26 -07:00
configs arc: [devboards] Add support of NFSv3 ACL 2018-12-08 12:59:10 +01:00
include ARC: io.h: Implement reads{x}()/writes{x}() 2018-12-21 14:15:16 +01:00
kernel ARC: clone syscall to setp r25 as thread pointer 2018-10-05 14:33:29 -07:00
lib ARC: dw2 unwind: enable cfi pseudo ops in string lib 2016-09-30 14:48:22 -07:00
mm ARC: don't check for HIGHMEM pages in arch_dma_alloc 2018-09-04 13:21:38 -07:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
plat-axs10x ARC: [plat-axs103] refactor the quad core DT quirk code 2017-12-20 12:41:45 -08:00
plat-eznps arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c 2018-07-30 11:48:49 -07:00
plat-hsdk ARCv2: [plat-hsdk]: Save accl reg pair by default 2018-07-19 10:36:45 -07:00
plat-sim ARC: [plat-sim] Include this platform unconditionally 2017-08-04 13:49:47 +05:30
plat-tb10x arc: select GPIOLIB directly 2016-04-26 14:07:59 +02:00
Kbuild
Kconfig ARC: change defconfig defaults to ARCv2 2018-12-08 12:59:10 +01:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile ARC: change defconfig defaults to ARCv2 2018-12-08 12:59:10 +01:00