Commit:     6f7d998e94ec7b7f08bd0c72fc05343435d7fa93
Parent:     f13cec8447f18cca3a0feb4b83b7ba6fae9e59ae
Author:     Christoph Lameter <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 14:24:58 2007 -0700
Committer:  Kyle McMartin <[EMAIL PROTECTED]>
CommitDate: Thu Oct 18 00:58:45 2007 -0700

    [PARISC] Use page allocator instead of slab allocator in pci-dma.c
    Slab pages obtained via kmalloc are not cacheline aligned.  Nor is it
    advisable to perform VM operations designed for page allocator pages on
    memory obtained via kmalloc.
    So replace the page sized allocations in kernel/pci-dma.c with page 
    Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]>
    Cc: Hugh Dickins <[EMAIL PROTECTED]>
    Cc: Grant Grundler <[EMAIL PROTECTED]>
    Cc: Matthew Wilcox <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]>
 arch/parisc/kernel/pci-dma.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 23c1388..41f8e32 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -569,11 +569,10 @@ static void *fail_alloc_consistent(struct device *dev, 
size_t size,
 static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
                                          dma_addr_t *dma_handle, gfp_t flag)
-       void *addr = NULL;
+       void *addr;
-       /* rely on kmalloc to be cacheline aligned */
-       addr = kmalloc(size, flag);
-       if(addr)
+       addr = (void *)__get_free_pages(flag, get_order(size));
+       if (addr)
                *dma_handle = (dma_addr_t)virt_to_phys(addr);
        return addr;
@@ -582,7 +581,7 @@ static void *pa11_dma_alloc_noncoherent(struct device *dev, 
size_t size,
 static void pa11_dma_free_noncoherent(struct device *dev, size_t size,
                                        void *vaddr, dma_addr_t iova)
-       kfree(vaddr);
+       free_pages((unsigned long)vaddr, get_order(size));
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to