* E100: another PCI problem on IXP4xx (guess all ARM)
@ 2010-08-16 23:31 Krzysztof Halasa
0 siblings, 0 replies; only message in thread
From: Krzysztof Halasa @ 2010-08-16 23:31 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-08-16 23:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-16 23:31 E100: another PCI problem on IXP4xx (guess all ARM) Krzysztof Halasa
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).