[POWERPC] Use archdata.dma_data in dma_direct_ops and add the offset

Previous thread: [POWERPC] Add celleb_dma_dev_setup() by Linux Kernel Mailing List on Wednesday, January 30, 2008 - 8:05 pm. (1 message)

Next thread: [POWERPC] Have cell use its own dma_direct_offset variable by Linux Kernel Mailing List on Wednesday, January 30, 2008 - 8:05 pm. (1 message)
From: Linux Kernel Mailing List
Date: Wednesday, January 30, 2008 - 8:05 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=35e4a6...
Commit:     35e4a6e26d0c6bc7f32087db61f0fb3666531183
Parent:     450d87eaeb4d43bd9e1f9523a6a3bfeb48209fea
Author:     Michael Ellerman <michael@ellerman.id.au>
AuthorDate: Mon Jan 21 16:42:43 2008 +1100
Committer:  Paul Mackerras <paulus@samba.org>
CommitDate: Fri Jan 25 22:52:54 2008 +1100

    [POWERPC] Use archdata.dma_data in dma_direct_ops and add the offset
    
    Now that all platforms using dma_direct_offset setup the
    archdata.dma_data correctly, we can change the dma_direct_ops to
    retrieve the offset from the dma_data, rather than directly from the
    global.
    
    While we're here, change the way the offset is used - instead of
    or'ing it into the value, add it.  This should have no effect on
    current implementations where the offset is far larger than memory,
    however in future we may want to use smaller offsets.
    
    Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
    Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/kernel/dma_64.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/dma_64.c b/arch/powerpc/kernel/dma_64.c
index 14206e3..a2d076d 100644
--- a/arch/powerpc/kernel/dma_64.c
+++ b/arch/powerpc/kernel/dma_64.c
@@ -117,6 +117,11 @@ EXPORT_SYMBOL(dma_iommu_ops);
  */
 unsigned long dma_direct_offset;
 
+static unsigned long get_dma_direct_offset(struct device *dev)
+{
+	return (unsigned long)dev->archdata.dma_data;
+}
+
 static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
 				       dma_addr_t *dma_handle, gfp_t flag)
 {
@@ -130,7 +135,7 @@ static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
 		return NULL;
 	ret = page_address(page);
 	memset(ret, 0, size);
-	*dma_handle = virt_to_abs(ret) | ...
Previous thread: [POWERPC] Add celleb_dma_dev_setup() by Linux Kernel Mailing List on Wednesday, January 30, 2008 - 8:05 pm. (1 message)

Next thread: [POWERPC] Have cell use its own dma_direct_offset variable by Linux Kernel Mailing List on Wednesday, January 30, 2008 - 8:05 pm. (1 message)