diff options
author | David Miller <davem@davemloft.net> | 2006-06-04 20:41:00 -0700 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2006-06-22 12:16:11 -0700 |
commit | af948395f08691edd731bac85c1f4c334bd312ec (patch) | |
tree | f6c1143b14df1765eeef1ecaa0c2cce0f6d886f1 /include/asm-sparc64/pci.h | |
parent | 76fc2aafe67361e69c980408fc66ac4f051b17da (diff) |
[PATCH] 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.
This is a disk eater when sound is used, so it's pretty critical.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/asm-sparc64/pci.h')
-rw-r--r-- | include/asm-sparc64/pci.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 89bd71b1c0d8..5b12c2ad1d43 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h @@ -44,7 +44,9 @@ struct pci_dev; /* Allocate and map kernel buffer using consistent mode DMA for a device. * hwdev should be valid struct pci_dev pointer for PCI devices. */ -extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle); +extern void *__pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t gfp); +#define pci_alloc_consistent(DEV,SZ,HANDLE) \ + __pci_alloc_consistent(DEV,SZ,HANDLE,GFP_ATOMIC) /* Free and unmap a consistent DMA buffer. * cpu_addr is what was returned from pci_alloc_consistent, |