aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2019-02-20 17:15:55 +0900
committerRyo Kataoka <ryo.kataoka.wt@renesas.com>2019-03-22 20:50:20 +0900
commit5c71e29dfff3192e2babf91c48827a7a95663b10 (patch)
tree28e04bf6a80a838061f25fd79f4591265ef6d378
parentaddfe9203290e3c274bca15e64e3f11638649e66 (diff)
downloadrenesas-bsp-5c71e29dfff3192e2babf91c48827a7a95663b10.tar.gz
mmc: renesas_sdhi: add max_segs_on_iommu to use large max_segs
This patch adds a new parameter max_segs_on_iommu into renesas_sdhi_of_data to use large max_segs value If IOMMU is enabled. In case of the SDHI internal DMAC with IOMMU is enabled, since it can use multiple segments, such environment may improve performance, especially small sg buffers are used. Tested-by: Takeshi Saito <takeshi.saito.xv@renesas.com> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
-rw-r--r--drivers/mmc/host/renesas_sdhi.h1
-rw-r--r--drivers/mmc/host/renesas_sdhi_core.c5
-rw-r--r--drivers/mmc/host/renesas_sdhi_internal_dmac.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 14e64336aef60..bac5c739d2627 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -35,6 +35,7 @@ struct renesas_sdhi_of_data {
int taps_num;
unsigned int max_blk_count;
unsigned short max_segs;
+ unsigned short max_segs_on_iommu;
};
struct tmio_mmc_dma {
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index f8345aafec733..345232bff5b0f 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -853,7 +853,10 @@ int renesas_sdhi_probe(struct platform_device *pdev,
mmc_data->capabilities2 |= of_data->capabilities2;
mmc_data->dma_rx_offset = of_data->dma_rx_offset;
mmc_data->max_blk_count = of_data->max_blk_count;
- mmc_data->max_segs = of_data->max_segs;
+ if (pdev->dev.iommu_group)
+ mmc_data->max_segs = of_data->max_segs_on_iommu;
+ else
+ mmc_data->max_segs = of_data->max_segs;
dma_priv->dma_buswidth = of_data->dma_buswidth;
host->bus_shift = of_data->bus_shift;
priv->scc_offset = of_data->scc_offset;
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 2291b55599df9..32acb7dc09b1a 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -101,6 +101,8 @@ static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = {
/* DMAC can handle 0xffffffff blk count but only 1 segment */
.max_blk_count = 0xffffffff,
.max_segs = 1,
+ /* If this device's IOMMU is enabled, it can use multiple segments */
+ .max_segs_on_iommu = 512,
};
static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {