[openwrt/openwrt] ramips: mtk-mmc: don't advertise highmem support.

LEDE Commits lede-commits at lists.infradead.org
Thu Apr 5 10:49:21 PDT 2018


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/f27336e11571a609a11bffad3eca0d7ac63135de

commit f27336e11571a609a11bffad3eca0d7ac63135de
Author: NeilBrown <neil at brown.name>
AuthorDate: Tue Feb 6 12:22:48 2018 +1100

    ramips: mtk-mmc: don't advertise highmem support.
    
    of_dma_configure() sets a default ->dma_mask of
    DMA_BIT_MASK(32), claiming devices can DMA from
    the full 32bit address space.
    The mtk-mmc driver does not support access to
    highmem pages, so it is really limited to the
    bottom 512M (actually 448M due to 64M of IO space).
    Setting ->dma_mask to NULL causes mmc_setup_queue()
    to fall-back to using BLK_BOUNCE_HIGH to tell the
    block layer to use a bounce-buffer for any highmem
    pages requiring IO.
    
    Signed-off-by: NeilBrown <neil at brown.name>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c | 1 +
 target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c
index ebfdc06..3a146f6 100644
--- a/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c
+++ b/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c
@@ -2821,6 +2821,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
    
     host->dma.used_gpd = 0;
     host->dma.used_bd = 0;
+    mmc_dev(mmc)->dma_mask = NULL;
 
     /* using dma_alloc_coherent*/  /* todo: using 1, for all 4 slots */
     host->dma.gpd = dma_alloc_coherent(NULL, MAX_GPD_NUM * sizeof(gpd_t), &host->dma.gpd_addr, GFP_KERNEL); 
diff --git a/target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c
index ebfdc06..3a146f6 100644
--- a/target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c
+++ b/target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c
@@ -2821,6 +2821,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
    
     host->dma.used_gpd = 0;
     host->dma.used_bd = 0;
+    mmc_dev(mmc)->dma_mask = NULL;
 
     /* using dma_alloc_coherent*/  /* todo: using 1, for all 4 slots */
     host->dma.gpd = dma_alloc_coherent(NULL, MAX_GPD_NUM * sizeof(gpd_t), &host->dma.gpd_addr, GFP_KERNEL); 



More information about the lede-commits mailing list