diff options
author | David S. Miller <davem@davemloft.net> | 2006-05-23 05:07:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-05-23 05:07:22 -0400 |
commit | 42f142371e48fbc44956d57b4e506bb6ce673cd7 (patch) | |
tree | cbcf77d8bf8adc923c50e1fd53a8becd81952beb /arch/sparc64/kernel/pci_sun4v.c | |
parent | 353b28bafd1b962359a866ff263a7fad833d29a1 (diff) |
[SPARC64]: Respect gfp_t argument to dma_alloc_coherent().
Using asm-generic/dma-mapping.h does not work because pushing
the call down to pci_alloc_coherent() causes the gfp_t argument
of dma_alloc_coherent() to be ignored.
Fix this by implementing things directly, and adding a gfp_t
argument we can use in the internal call down to the PCI DMA
implementation of pci_alloc_coherent().
This fixes massive memory corruption when using the sound driver
layer, which passes things like __GFP_COMP down into these
routines and (correctly) expects that to work.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_sun4v.c')
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 9e94db2573a2..2b7a1f316a93 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c | |||
@@ -154,7 +154,7 @@ static void pci_arena_free(struct pci_iommu_arena *arena, unsigned long base, un | |||
154 | __clear_bit(i, arena->map); | 154 | __clear_bit(i, arena->map); |
155 | } | 155 | } |
156 | 156 | ||
157 | static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) | 157 | static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp) |
158 | { | 158 | { |
159 | struct pcidev_cookie *pcp; | 159 | struct pcidev_cookie *pcp; |
160 | struct pci_iommu *iommu; | 160 | struct pci_iommu *iommu; |
@@ -169,7 +169,7 @@ static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr | |||
169 | 169 | ||
170 | npages = size >> IO_PAGE_SHIFT; | 170 | npages = size >> IO_PAGE_SHIFT; |
171 | 171 | ||
172 | first_page = __get_free_pages(GFP_ATOMIC, order); | 172 | first_page = __get_free_pages(gfp, order); |
173 | if (unlikely(first_page == 0UL)) | 173 | if (unlikely(first_page == 0UL)) |
174 | return NULL; | 174 | return NULL; |
175 | 175 | ||