Re: [PATCH 2/4] dma/ia64: update ia64 machvecs

Previous thread: [PATCH 1/4] dma: document dma_{un}map_{single|sg}_attrs() interface by akepner on Wednesday, January 30, 2008 - 1:50 am. (3 messages)

Next thread: [PATCH 3/4] IB: add dmabarrier to ib_umem_get() prototype by akepner on Wednesday, January 30, 2008 - 1:53 am. (2 messages)
To: Tony Luck <tony.luck@...>, Grant Grundler <grundler@...>, Jesse Barnes <jbarnes@...>, Jes Sorensen <jes@...>, Randy Dunlap <randy.dunlap@...>, Roland Dreier <rdreier@...>, James Bottomley <James.Bottomley@...>, David Miller <davem@...>, Muli Ben-Yehuda <muli@...>
Cc: <linux-kernel@...>
Date: Wednesday, January 30, 2008 - 1:52 am

Change all ia64 machvecs to use the new dma_{un}map_*_attrs()
interfaces. Implement the old dma_{un}map_*() interfaces in
terms of the corresponding new interfaces. For ia64/sn, make
use of one dma attribute, DMA_ATTR_BARRIER.

Signed-off-by: Arthur Kepner <akepner@sgi.com>

--

arch/ia64/hp/common/hwsw_iommu.c | 60 ++++++++++++------------
arch/ia64/hp/common/sba_iommu.c | 62 ++++++++++++++----------
arch/ia64/sn/pci/pci_dma.c | 77 ++++++++++++++++++++-----------
include/asm-ia64/dma-mapping.h | 28 +++++++++--
include/asm-ia64/machvec.h | 52 ++++++++++++--------
include/asm-ia64/machvec_hpzx1.h | 16 +++---
include/asm-ia64/machvec_hpzx1_swiotlb.h | 16 +++---
include/asm-ia64/machvec_sn2.h | 16 +++---
include/linux/dma-attrs.h | 48 +++++++++++++++++++
lib/swiotlb.c | 50 ++++++++++++++++----
10 files changed, 289 insertions(+), 136 deletions(-)

diff --git a/arch/ia64/hp/common/hwsw_iommu.c b/arch/ia64/hp/common/hwsw_iommu.c
index 94e5710..8cedd6c 100644
--- a/arch/ia64/hp/common/hwsw_iommu.c
+++ b/arch/ia64/hp/common/hwsw_iommu.c
@@ -20,10 +20,10 @@
extern int swiotlb_late_init_with_default_size (size_t size);
extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent;
extern ia64_mv_dma_free_coherent swiotlb_free_coherent;
-extern ia64_mv_dma_map_single swiotlb_map_single;
-extern ia64_mv_dma_unmap_single swiotlb_unmap_single;
-extern ia64_mv_dma_map_sg swiotlb_map_sg;
-extern ia64_mv_dma_unmap_sg swiotlb_unmap_sg;
+extern ia64_mv_dma_map_single_attrs swiotlb_map_single_attrs;
+extern ia64_mv_dma_unmap_single_attrs swiotlb_unmap_single_attrs;
+extern ia64_mv_dma_map_sg_attrs swiotlb_map_sg_attrs;
+extern ia64_mv_dma_unmap_sg_attrs swiotlb_unmap_sg_attrs;
extern ia64_mv_dma_supported swiotlb_dma_supported;
extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error;

@@ -31,19 +31,19 @@ extern ia64_mv_dma_mapp...

To: <akepner@...>
Cc: Tony Luck <tony.luck@...>, Grant Grundler <grundler@...>, Jesse Barnes <jbarnes@...>, Jes Sorensen <jes@...>, Randy Dunlap <randy.dunlap@...>, Roland Dreier <rdreier@...>, David Miller <davem@...>, Muli Ben-Yehuda <muli@...>, <linux-kernel@...>
Date: Wednesday, January 30, 2008 - 1:25 pm

In general, the patches look reasonable to me. Just an observation:

The attribute names (DMA_ATTR_...) are going to have to live somewhere
outside of the #ifdef ARCH_USES_DMA_ATTRS otherwise we'll get compile
failures of drivers using attributes on architectures that don't support
them.

Secondly, DMA_ATTR_BARRIER doesn't quite sound right. What you're
actually doing is trying to prescribe strict ordering, so shouldn't this
be something like DMA_ATTR_STRICT_ORDERING (and perhaps with a
corresponding DMA_ATTR_RELAXED_ORDERING for the PCIe case). also,
strike the DMA_ATTR_FOO and DMA_ATTR_GOO since they have no plausible
meaning.

James

--

To: James Bottomley <James.Bottomley@...>
Cc: Tony Luck <tony.luck@...>, Grant Grundler <grundler@...>, Jesse Barnes <jbarnes@...>, Jes Sorensen <jes@...>, Randy Dunlap <randy.dunlap@...>, Roland Dreier <rdreier@...>, David Miller <davem@...>, Muli Ben-Yehuda <muli@...>, <linux-kernel@...>
Date: Wednesday, January 30, 2008 - 3:45 pm

Yeah, I realized only after sending that I'd forgotten to
remove these.

--
Arthur

--

Previous thread: [PATCH 1/4] dma: document dma_{un}map_{single|sg}_attrs() interface by akepner on Wednesday, January 30, 2008 - 1:50 am. (3 messages)

Next thread: [PATCH 3/4] IB: add dmabarrier to ib_umem_get() prototype by akepner on Wednesday, January 30, 2008 - 1:53 am. (2 messages)