diff mbox series

[2/3] mmc: tmio: No memory size limitation if runs on IOMMU

Message ID 1556255930-18188-3-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State New, archived
Headers show
Series mmc: renesas_sdhi_internal_dmac: improve performance by using IOMMU | expand

Commit Message

Yoshihiro Shimoda April 26, 2019, 5:18 a.m. UTC
This patch adds a condition to avoid memory size limitaion of
swiotlb if the driver runs on IOMMU.

Tested-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/mmc/host/tmio_mmc_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Sergei Shtylyov April 26, 2019, 8:09 a.m. UTC | #1
On 26.04.2019 8:18, Yoshihiro Shimoda wrote:

> This patch adds a condition to avoid memory size limitaion of

    Limitation.

> swiotlb if the driver runs on IOMMU.
> 
> Tested-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>   drivers/mmc/host/tmio_mmc_core.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
> index 6019628..0474337 100644
> --- a/drivers/mmc/host/tmio_mmc_core.c
> +++ b/drivers/mmc/host/tmio_mmc_core.c
> @@ -1203,9 +1203,10 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
>   	 * Since swiotlb has memory size limitation, this will calculate
>   	 * the maximum size locally (because we don't have any APIs for it now)
>   	 * and check the current max_req_size. And then, this will update
> -	 * the max_req_size if needed as a workaround.
> +	 * the max_req_size if needed as a workaround. However, if the driver
> +	 * runs on IOMMU, this workaround doesn't need.

    Isn't needed, maybe?

[...]

MBR, Sergei
Wolfram Sang April 26, 2019, 9:17 a.m. UTC | #2
> > This patch adds a condition to avoid memory size limitaion of
> 
>    Limitation.

"limitation" :) And maybe "a memory size limitation"?

> > +	 * the max_req_size if needed as a workaround. However, if the driver
> > +	 * runs on IOMMU, this workaround doesn't need.
> 
>    Isn't needed, maybe?

Ack, "isn't needed".

Patch itself looks good to me.
Simon Horman April 26, 2019, 9:45 a.m. UTC | #3
On Fri, Apr 26, 2019 at 02:18:49PM +0900, Yoshihiro Shimoda wrote:
> This patch adds a condition to avoid memory size limitaion of
> swiotlb if the driver runs on IOMMU.
> 
> Tested-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Yoshihiro Shimoda May 7, 2019, 7:13 a.m. UTC | #4
Hi Sergei-san, Wolfram-san,

Thank you for your review and sorry for the delayed response...

> From: Wolfram Sang, Sent: Friday, April 26, 2019 6:18 PM
> 
> > > This patch adds a condition to avoid memory size limitaion of
> >
> >    Limitation.
> 
> "limitation" :) And maybe "a memory size limitation"?

I think so. I'll fix it on v2 patch.

> > > +	 * the max_req_size if needed as a workaround. However, if the driver
> > > +	 * runs on IOMMU, this workaround doesn't need.
> >
> >    Isn't needed, maybe?
> 
> Ack, "isn't needed".

I'll fix it.

> Patch itself looks good to me.

Thank you for your comment!

Best regards,
Yoshihiro Shimoda
diff mbox series

Patch

diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
index 6019628..0474337 100644
--- a/drivers/mmc/host/tmio_mmc_core.c
+++ b/drivers/mmc/host/tmio_mmc_core.c
@@ -1203,9 +1203,10 @@  int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
 	 * Since swiotlb has memory size limitation, this will calculate
 	 * the maximum size locally (because we don't have any APIs for it now)
 	 * and check the current max_req_size. And then, this will update
-	 * the max_req_size if needed as a workaround.
+	 * the max_req_size if needed as a workaround. However, if the driver
+	 * runs on IOMMU, this workaround doesn't need.
 	 */
-	if (swiotlb_max_segment()) {
+	if (swiotlb_max_segment() && !pdev->dev.iommu_group) {
 		unsigned int max_size = (1 << IO_TLB_SHIFT) * IO_TLB_SEGSIZE;
 
 		if (mmc->max_req_size > max_size)