public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [patch 2.6.13] swiotlb: add swiotlb_sync_single_range_for_{cpu,device}
@ 2005-08-30 18:03 Luck, Tony
  2005-08-30 18:09 ` John W. Linville
  0 siblings, 1 reply; 20+ messages in thread
From: Luck, Tony @ 2005-08-30 18:03 UTC (permalink / raw)
  To: John W. Linville, linux-kernel; +Cc: Andi Kleen, discuss, linux-ia64


>+swiotlb_sync_single_range_for_cpu(struct device *hwdev, 
>+swiotlb_sync_single_range_for_device(struct device *hwdev, 

Huh?  These look identical ... same args, same code, just a
different name.

-Tony

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [patch 2.6.13] x86_64: implement dma_sync_single_range_for_{cpu,device}
@ 2005-08-29 20:09 John W. Linville
  2005-08-29 20:54 ` Andi Kleen
  0 siblings, 1 reply; 20+ messages in thread
From: John W. Linville @ 2005-08-29 20:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: ak, discuss

Implement dma_sync_single_range_for_{cpu,device}, based on curent
implementations of dma_sync_single_for_{cpu,device}.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
It is hard to use this API if common platforms do not implement it. :-)
Hopefully I did not miss something obvious?

This is a naive implementation, so flame away...

 include/asm-x86_64/dma-mapping.h |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+)

diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h
--- a/include/asm-x86_64/dma-mapping.h
+++ b/include/asm-x86_64/dma-mapping.h
@@ -85,6 +85,34 @@ static inline void dma_sync_single_for_d
 	flush_write_buffers();
 }
 
+static inline void dma_sync_single_range_for_cpu(struct device *hwdev,
+						 dma_addr_t dma_handle,
+						 unsigned long offset,
+						 size_t size, int direction)
+{
+	if (direction == DMA_NONE)
+		out_of_line_bug();
+
+	if (swiotlb)
+		return swiotlb_sync_single_for_cpu(hwdev,dma_handle+offset,size,direction);
+
+	flush_write_buffers();
+}
+
+static inline void dma_sync_single_range_for_device(struct device *hwdev,
+						    dma_addr_t dma_handle,
+						    unsigned long offset,
+						    size_t size, int direction)
+{
+        if (direction == DMA_NONE)
+		out_of_line_bug();
+
+	if (swiotlb)
+		return swiotlb_sync_single_for_device(hwdev,dma_handle+offset,size,direction);
+
+	flush_write_buffers();
+}
+
 static inline void dma_sync_sg_for_cpu(struct device *hwdev,
 				       struct scatterlist *sg,
 				       int nelems, int direction)
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2005-09-13  4:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-30 18:03 [patch 2.6.13] swiotlb: add swiotlb_sync_single_range_for_{cpu,device} Luck, Tony
2005-08-30 18:09 ` John W. Linville
2005-08-30 18:33   ` [rfc patch] swiotlb: consolidate swiotlb_sync_single_* implementations John W. Linville
2005-08-30 18:40     ` [rfc patch] swiotlb: consolidate swiotlb_sync_sg_* implementations John W. Linville
2005-09-12 14:48   ` [patch 2.6.13 0/6] swiotlb maintenance and x86_64 dma_sync_single_range_for_{cpu,device} John W. Linville
2005-09-12 14:48     ` [patch 2.6.13 1/6] swiotlb: move from arch/ia64/lib to lib John W. Linville
2005-09-12 14:48       ` [patch 2.6.13 2/6] swiotlb: cleanup some code duplication cruft John W. Linville
2005-09-12 14:48         ` [patch 2.6.13 3/6] swiotlb: support syncing sub-ranges of mappings John W. Linville
2005-09-12 14:48           ` [patch 2.6.13 4/6] swiotlb: support syncing DMA_BIDIRECTIONAL mappings John W. Linville
2005-09-12 14:48             ` [patch 2.6.13 5/6] swiotlb: file header comments John W. Linville
2005-09-12 14:48               ` [patch 2.6.13 6/6] x86_64: implement dma_sync_single_range_for_{cpu,device} John W. Linville
2005-09-12 15:22                 ` Andi Kleen
2005-09-12 18:51             ` [patch 2.6.13 4/6] swiotlb: support syncing DMA_BIDIRECTIONAL mappings Grant Grundler
2005-09-12 19:51               ` John W. Linville
2005-09-12 19:53                 ` [patch 2.6.13] swiotlb: BUG() for DMA_NONE in sync_single John W. Linville
2005-09-12 20:23                   ` Grant Grundler
2005-09-12 23:45                     ` [patch 2.6.13 (take #2)] " John W. Linville
2005-09-12 23:59                       ` Grant Grundler
2005-09-13  4:05                       ` [discuss] " Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2005-08-29 20:09 [patch 2.6.13] x86_64: implement dma_sync_single_range_for_{cpu,device} John W. Linville
2005-08-29 20:54 ` Andi Kleen
2005-08-29 21:48   ` John W. Linville
2005-08-30  1:14     ` [discuss] " Andi Kleen
2005-08-30 17:54       ` John W. Linville
2005-08-30 17:58         ` [patch 2.6.13] swiotlb: add swiotlb_sync_single_range_for_{cpu,device} John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox