From d94fe6f3ff600083512a3cac21baba64c64658c0 Mon Sep 17 00:00:00 2001 From: Alison Wang Date: Mon, 22 May 2017 13:05:26 +0800 Subject: driver: spi: fsl-quad: Hang memcpy: Unhandled fault: alignment fault vmap/iomap based on whether the buffer is in memory region or reserved region.However, both map it as non-cacheable memory.For armv8 specifically, non-cacheable mapping requests use a memory type that has to be accessed aligned to the request size.memcpy() doesn't guarantee that. memcpy_toio() can guarantee 4-bytes alignment. Signed-off-by: Yunhui Cui diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index bee8fe7..fea7173 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c @@ -1072,7 +1072,7 @@ static ssize_t fsl_qspi_read(struct spi_nor *nor, loff_t from, len); /* Read out the data directly from the AHB buffer.*/ - memcpy(buf, q->ahb_addr + q->chip_base_addr + from - q->memmap_offs, + memcpy_toio(buf, q->ahb_addr + q->chip_base_addr + from - q->memmap_offs, len); return len; -- cgit v0.10.2