Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68023
b: refs/heads/master
c: aa24886
h: refs/heads/master
i:
  68021: b701f9b
  68019: ab59d67
  68015: 6076df7
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent 677744e commit dd361f5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa007d8bebc5d812a445c48664b5bcad81f1351c
refs/heads/master: aa24886e379d2b641c5117e178b15ce1d5d366ba
3 changes: 3 additions & 0 deletions trunk/Documentation/DMA-API.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ size and dma_handle must all be the same as those passed into the
consistent allocate. cpu_addr must be the virtual address returned by
the consistent allocate.

Note that unlike their sibling allocation calls, these routines
may only be called with IRQs enabled.


Part Ib - Using small dma-coherent buffers
------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/pci-dma_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ void dma_free_coherent(struct device *dev, size_t size,
{
struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
int order = get_order(size);


WARN_ON(irqs_disabled()); /* for portability */
if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) {
int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/pci-dma_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
void dma_free_coherent(struct device *dev, size_t size,
void *vaddr, dma_addr_t bus)
{
WARN_ON(irqs_disabled()); /* for portability */
if (dma_ops->unmap_single)
dma_ops->unmap_single(dev, bus, size, 0);
free_pages((unsigned long)vaddr, get_order(size));
Expand Down
1 change: 1 addition & 0 deletions trunk/lib/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ void
swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
dma_addr_t dma_handle)
{
WARN_ON(irqs_disabled());
if (!(vaddr >= (void *)io_tlb_start
&& vaddr < (void *)io_tlb_end))
free_pages((unsigned long) vaddr, get_order(size));
Expand Down

0 comments on commit dd361f5

Please sign in to comment.