android_kernel_oneplus_msm8998/arch/arc
Jose Abreu 44b4717e50 ARC: io.h: Implement reads{x}()/writes{x}()
[ Upstream commit 10d443431dc2bb733cf7add99b453e3fb9047a2e ]

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:09:52 +01:00
..
boot ARC: [plat-sim] unbork non default CONFIG_LINUX_LINK_BASE 2015-12-17 11:06:43 +05:30
configs arc: [devboards] Add support of NFSv3 ACL 2018-12-13 09:21:33 +01:00
include ARC: io.h: Implement reads{x}()/writes{x}() 2018-12-21 14:09:52 +01:00
kernel ARC: clone syscall to setp r25 as thread pointer 2018-10-13 09:11:34 +02:00
lib ARCv2: lib: memcpy: use local symbols 2015-11-03 17:33:00 +05:30
mm arc: fix type warnings in arc/mm/cache.c 2018-09-05 09:18:36 +02:00
oprofile
plat-axs10x ARCv2: smp: [plat-*]: No need to explicitly call mcip_init_smp() 2015-10-28 16:13:41 +05:30
plat-sim ARC: remove extraneous header include 2015-11-14 13:11:38 +05:30
plat-tb10x
Kbuild
Kconfig ARC: change defconfig defaults to ARCv2 2018-12-13 09:21:32 +01:00
Kconfig.debug ARC: With earlycon in use, retire EARLY_PRINTK 2015-05-11 11:20:21 +05:30
Makefile ARC: change defconfig defaults to ARCv2 2018-12-13 09:21:32 +01:00