diff options
-rw-r--r-- | Documentation/DMA-API.txt | 3 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma_32.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma_64.c | 1 | ||||
-rw-r--r-- | lib/swiotlb.c | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt index cc7a8c39fb6f..b939ebb62871 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt | |||
@@ -68,6 +68,9 @@ size and dma_handle must all be the same as those passed into the | |||
68 | consistent allocate. cpu_addr must be the virtual address returned by | 68 | consistent allocate. cpu_addr must be the virtual address returned by |
69 | the consistent allocate. | 69 | the consistent allocate. |
70 | 70 | ||
71 | Note that unlike their sibling allocation calls, these routines | ||
72 | may only be called with IRQs enabled. | ||
73 | |||
71 | 74 | ||
72 | Part Ib - Using small dma-coherent buffers | 75 | Part Ib - Using small dma-coherent buffers |
73 | ------------------------------------------ | 76 | ------------------------------------------ |
diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c index 048f09b62553..0aae2f3847a5 100644 --- a/arch/x86/kernel/pci-dma_32.c +++ b/arch/x86/kernel/pci-dma_32.c | |||
@@ -63,7 +63,8 @@ void dma_free_coherent(struct device *dev, size_t size, | |||
63 | { | 63 | { |
64 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; | 64 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; |
65 | int order = get_order(size); | 65 | int order = get_order(size); |
66 | 66 | ||
67 | WARN_ON(irqs_disabled()); /* for portability */ | ||
67 | if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) { | 68 | if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) { |
68 | int page = (vaddr - mem->virt_base) >> PAGE_SHIFT; | 69 | int page = (vaddr - mem->virt_base) >> PAGE_SHIFT; |
69 | 70 | ||
diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 29711445c818..9576a2eb375e 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c | |||
@@ -167,6 +167,7 @@ EXPORT_SYMBOL(dma_alloc_coherent); | |||
167 | void dma_free_coherent(struct device *dev, size_t size, | 167 | void dma_free_coherent(struct device *dev, size_t size, |
168 | void *vaddr, dma_addr_t bus) | 168 | void *vaddr, dma_addr_t bus) |
169 | { | 169 | { |
170 | WARN_ON(irqs_disabled()); /* for portability */ | ||
170 | if (dma_ops->unmap_single) | 171 | if (dma_ops->unmap_single) |
171 | dma_ops->unmap_single(dev, bus, size, 0); | 172 | dma_ops->unmap_single(dev, bus, size, 0); |
172 | free_pages((unsigned long)vaddr, get_order(size)); | 173 | free_pages((unsigned long)vaddr, get_order(size)); |
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index a7381d55663a..30c1400e749e 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -497,6 +497,7 @@ void | |||
497 | swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, | 497 | swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, |
498 | dma_addr_t dma_handle) | 498 | dma_addr_t dma_handle) |
499 | { | 499 | { |
500 | WARN_ON(irqs_disabled()); | ||
500 | if (!(vaddr >= (void *)io_tlb_start | 501 | if (!(vaddr >= (void *)io_tlb_start |
501 | && vaddr < (void *)io_tlb_end)) | 502 | && vaddr < (void *)io_tlb_end)) |
502 | free_pages((unsigned long) vaddr, get_order(size)); | 503 | free_pages((unsigned long) vaddr, get_order(size)); |