From patchwork Tue Feb 4 11:08:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 235956 List-Id: U-Boot discussion From: yamada.masahiro at socionext.com (Masahiro Yamada) Date: Tue, 4 Feb 2020 20:08:57 +0900 Subject: [PATCH 0/9] mmc: sdhci: code clean-up and fix cache coherency problem. Message-ID: <20200204110906.9377-1-yamada.masahiro@socionext.com> My main motivation of this series is the last patch "mmc: sdhci: fix missing cache invalidation after reading by DMA". Currently, read data are occasionally corrupted due to the missing cache invalidation. To fix it nicely (adds dma_unmap_single(), which follows the Linux coding style), I did some cleaups first. Patch 01 and 02 fix the prototypes of dma_{map,unmap}_single(). Patch 03-08 are code clean-ups. Patch 09 fixes the bug. Masahiro Yamada (9): dma-mapping: fix the prototype of dma_map_single() dma-mapping: fix the prototype of dma_unmap_single() mmc: sdhci: put the aligned buffer pointer to struct sdhci_host mmc: sdhci: reduce code duplication for aligned buffer mmc: sdhci: use lower_32_bit2() and upper_32_bits() for setting adma_addr mmc: sdhci: remove unneeded casts mmc: add mmc_get_dma_dir() helper mmc: sdhci: use dma_map_single() instead of flush_cache() before DMA mmc: sdhci: fix missing cache invalidation after reading by DMA arch/arm/include/asm/dma-mapping.h | 9 ++- arch/nds32/include/asm/dma-mapping.h | 9 ++- arch/riscv/include/asm/dma-mapping.h | 9 ++- arch/x86/include/asm/dma-mapping.h | 9 ++- drivers/mmc/sdhci.c | 96 +++++++++++++--------------- drivers/mmc/tmio-common.c | 2 +- drivers/mtd/nand/raw/denali.c | 2 +- drivers/net/macb.c | 2 +- drivers/usb/dwc3/core.c | 6 +- drivers/usb/gadget/udc/udc-core.c | 2 +- include/mmc.h | 6 ++ include/sdhci.h | 3 + 12 files changed, 78 insertions(+), 77 deletions(-)