Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Joerg Roedel <jroedel@suse.de>
To: Raul Rangel <rrangel@chromium.org>
Cc: linux-mmc@vger.kernel.org, murphyt7@tcd.ie,
	dianders@chromium.org, evgreen@chromium.org,
	Daniel Kurtz <djkurtz@chromium.org>
Subject: Re: Problems using AMD eMMC with AMD IOMMU
Date: Fri, 8 May 2020 17:22:36 +0200	[thread overview]
Message-ID: <20200508152236.GQ8135@suse.de> (raw)
In-Reply-To: <CAHQZ30CXW7W6Wv12u45Mpn4+_oQhcR=_hpu-gOv8PqvajnLC4Q@mail.gmail.com>

On Wed, May 06, 2020 at 03:00:21PM -0600, Raul Rangel wrote:
> Any suggestions would be appreciated.

Two possibilities:

	1) Please try the 5 patches from this branch:
	   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/log/?h=iommu/fixes

	   The fix some race-condition issues, I think it is unlikely
	   you hit them, but it is worth a test.

	2) Dma-iommu code does sg-merging, which the previous DMA-API
	   implementation did not. Can you try attached diff from Robin
	   Murphy to disable sg-merging? It that helps it is an issue in
	   the eMMC driver.

Regards,

	Joerg

diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index a2e96a5fd9a7..a6b71bad518e 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -779,7 +779,7 @@ static int __finalise_sg(struct device *dev, struct 
scatterlist *sg, int nents,
  		 * - but doesn't fall at a segment boundary
  		 * - and wouldn't make the resulting output segment too long
  		 */
-		if (cur_len && !s_iova_off && (dma_addr & seg_mask) &&
+		if (0 && cur_len && !s_iova_off && (dma_addr & seg_mask) &&
  		    (max_len - cur_len >= s_length)) {
  			/* ...then concatenate it with the previous one */
  			cur_len += s_length;
@@ -799,6 +799,7 @@ static int __finalise_sg(struct device *dev, struct 
scatterlist *sg, int nents,
  		if (s_length + s_iova_off < s_iova_len)
  			cur_len = 0;
  	}
+	WARN_ON(count < nents);
  	return count;
  }

  reply	other threads:[~2020-05-08 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 21:00 Problems using AMD eMMC with AMD IOMMU Raul Rangel
2020-05-08 15:22 ` Joerg Roedel [this message]
2020-05-08 15:46   ` Raul Rangel
2020-05-08 16:59     ` Raul Rangel
2020-05-08 18:53       ` Andy Shevchenko
2020-05-08 20:31         ` Raul Rangel
2020-05-08 21:09       ` Raul Rangel
2020-05-08 21:44         ` Raul Rangel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200508152236.GQ8135@suse.de \
    --to=jroedel@suse.de \
    --cc=dianders@chromium.org \
    --cc=djkurtz@chromium.org \
    --cc=evgreen@chromium.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=murphyt7@tcd.ie \
    --cc=rrangel@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox