[PATCH corrected] firewire: fw-ohci: fix DMA mapping for ar context

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stefan Richter
Date: Tuesday, October 16, 2007 - 10:40 am

The CPU must not touch the buffer after it was DMA-mapped.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
 drivers/firewire/fw-ohci.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux/drivers/firewire/fw-ohci.c
===================================================================
--- linux.orig/drivers/firewire/fw-ohci.c
+++ linux/drivers/firewire/fw-ohci.c
@@ -258,6 +258,7 @@ static int ar_context_add_page(struct ar
 		free_page((unsigned long) ab);
 		return -ENOMEM;
 	}
+	dma_sync_single_for_cpu(dev, ab_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
 
 	memset(&ab->descriptor, 0, sizeof(ab->descriptor));
 	ab->descriptor.control        = cpu_to_le16(DESCRIPTOR_INPUT_MORE |

-- 
Stefan Richter
-=====-=-=== =-=- =----
http://arcgraph.de/sr/

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] firewire: fw-ohci: fix DMA mapping for ar context, Stefan Richter, (Tue Oct 16, 10:25 am)
[PATCH corrected] firewire: fw-ohci: fix DMA mapping for a ..., Stefan Richter, (Tue Oct 16, 10:40 am)
[PATCH] firewire: fw-ohci: avoid an atomic allocation, Stefan Richter, (Tue Oct 16, 11:30 am)