]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: meson-gx: do not use memcpy_to/fromio for dram-access-quirk
authorNeil Armstrong <narmstrong@baylibre.com>
Tue, 28 Sep 2021 07:36:52 +0000 (09:36 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 6 Oct 2021 15:23:28 +0000 (17:23 +0200)
commitc04c63dde4088742d88c80ca017912938c7628b4
tree3e2b5b6bac906489373d45b2dae98c006cd5608a
parente29f97a219c8eec65f7fdca5d791020cf0f35c0d
mmc: meson-gx: do not use memcpy_to/fromio for dram-access-quirk

The memory at the end of the controller only accepts 32bit read/write
accesses, but the arm64 memcpy_to/fromio implementation only uses 64bit
(which will be split into two 32bit access) and 8bit leading to incomplete
copies to/from this memory when the buffer is not multiple of 8bytes.

Add a local copy using writel/readl accesses to make sure we use the right
memory access width.

The switch to memcpy_to/fromio was done because of ae36a2195afd
("arm64: Import latest memcpy()/memmove() implementation"), but using memcpy
worked before since it mainly used 32bit memory acceses.

Fixes: ca5a377a6fde ("mmc: meson-gx: use memcpy_to/fromio for dram-access-quirk")
Reported-by: Christian Hewitt <christianshewitt@gmail.com>
Suggested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210928073652.434690-1-narmstrong@baylibre.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/meson-gx-mmc.c