From: khc@pm.waw.pl (Krzysztof Halasa)
To: linux-arm-kernel@lists.infradead.org
Subject: E100: another PCI problem on IXP4xx (guess all ARM)
Date: Tue, 17 Aug 2010 01:31:07 +0200 [thread overview]
Message-ID: <m3r5hygmo4.fsf@intrepid.localdomain> (raw)
Hi,
I also found another PCI issue: e100 driver (to be precise, my own fix
to e100: 6ff9c2e7fa8ca63a575792534b63c5092099c286) doesn't play nice
with dma-mapping BIDIRECTIONAL direction checks. How about copying
42d53b4ff7d61487d18274ebdf1f70c1aef6f122 to ARM?
I know E100 isn't exactly designed as per DMA-API document, but given
the inner workings of cache management and DMA bouncing code, this is
the only workable solution (well, maybe using that other descriptor ring
mode is another).
Comments?
ARM: fix DMA-bounce code to allow sync from_device and to_device with
bidirectional mappings.
Signed-off-by: Krzysztof Ha?asa <khc@pm.waw.pl>
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index cc0a932..7c6ad2b 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -402,7 +402,7 @@ int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr,
if (!buf)
return 1;
- BUG_ON(buf->direction != dir);
+ BUG_ON(buf->direction != dir && buf->direction != DMA_BIDIRECTIONAL);
dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
__func__, buf->ptr, virt_to_dma(dev, buf->ptr),
@@ -431,7 +431,7 @@ int dmabounce_sync_for_device(struct device *dev, dma_addr_t addr,
if (!buf)
return 1;
- BUG_ON(buf->direction != dir);
+ BUG_ON(buf->direction != dir && buf->direction != DMA_BIDIRECTIONAL);
dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
__func__, buf->ptr, virt_to_dma(dev, buf->ptr),
--
Krzysztof Halasa
reply other threads:[~2010-08-16 23:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=m3r5hygmo4.fsf@intrepid.localdomain \
--to=khc@pm.waw.pl \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).