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 /include/asm-sparc64/pci.h | |
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 'include/asm-sparc64/pci.h')
-rw-r--r-- | include/asm-sparc64/pci.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 7c5a589ea437..e1ea67bc32f2 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h | |||
@@ -42,7 +42,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) | |||
42 | struct pci_dev; | 42 | struct pci_dev; |
43 | 43 | ||
44 | struct pci_iommu_ops { | 44 | struct pci_iommu_ops { |
45 | void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *); | 45 | void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *, gfp_t); |
46 | void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); | 46 | void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); |
47 | dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); | 47 | dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); |
48 | void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); | 48 | void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); |
@@ -59,7 +59,7 @@ extern struct pci_iommu_ops *pci_iommu_ops; | |||
59 | */ | 59 | */ |
60 | static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) | 60 | static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) |
61 | { | 61 | { |
62 | return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle); | 62 | return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle, GFP_ATOMIC); |
63 | } | 63 | } |
64 | 64 | ||
65 | /* Free and unmap a consistent DMA buffer. | 65 | /* Free and unmap a consistent DMA buffer. |