1112-driver-spi-fsl-quad-Hang-memcpy-Unhandled-fault-alig.patch 1.1 KB

1234567891011121314151617181920212223242526272829
  1. From f1b7824a42505669476f203e126fc26dd1006af2 Mon Sep 17 00:00:00 2001
  2. From: Yutang Jiang <yutang.jiang@nxp.com>
  3. Date: Fri, 9 Sep 2016 22:57:55 +0800
  4. Subject: [PATCH 112/113] driver: spi: fsl-quad: Hang memcpy: Unhandled fault:
  5. alignment fault
  6. vmap/iomap based on whether the buffer is in memory region or reserved region.
  7. However, both map it as non-cacheable memory.
  8. For armv8 specifically, non-cacheable mapping requests use a memory type
  9. that has to be accessed aligned to the request size. memcpy() doesn't guarantee
  10. that. memcpy_toio() can guarantee 4-bytes alignment.
  11. Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
  12. Integrated-by: Yutang Jiang <yutang.jiang@nxp.com>
  13. ---
  14. drivers/mtd/spi-nor/fsl-quadspi.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. --- a/drivers/mtd/spi-nor/fsl-quadspi.c
  17. +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
  18. @@ -1103,7 +1103,7 @@ static ssize_t fsl_qspi_read(struct spi_
  19. len);
  20. /* Read out the data directly from the AHB buffer.*/
  21. - memcpy(buf, q->ahb_addr + q->chip_base_addr + from - q->memmap_offs,
  22. + memcpy_toio(buf, q->ahb_addr + q->chip_base_addr + from - q->memmap_offs,
  23. len);
  24. return len;