aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-18 11:06:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-18 11:06:00 -0500
commitb6584065ee833dcec20683be7fc25da3f2268cee (patch)
tree29e2a8cbc5ada9c81492133f71cd4a84ec2c6fde
parent376fdd2a5d2484c90caabef483390a2cd3cda7a0 (diff)
parent1e74f3000b86969de421ca0da08f42e7d21cbd99 (diff)
Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: swiotlb: use coherent_dma_mask in alloc_coherent MAINTAINERS: remove me as RAID maintainer
-rw-r--r--MAINTAINERS2
-rw-r--r--lib/swiotlb.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 8e0777fae3ce..627e4c89328e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3928,8 +3928,6 @@ M: bootc@bootc.net
3928S: Maintained 3928S: Maintained
3929 3929
3930SOFTWARE RAID (Multiple Disks) SUPPORT 3930SOFTWARE RAID (Multiple Disks) SUPPORT
3931P: Ingo Molnar
3932M: mingo@redhat.com
3933P: Neil Brown 3931P: Neil Brown
3934M: neilb@suse.de 3932M: neilb@suse.de
3935L: linux-raid@vger.kernel.org 3933L: linux-raid@vger.kernel.org
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 78330c37a61b..5f6c629a924d 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -467,9 +467,13 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
467 dma_addr_t dev_addr; 467 dma_addr_t dev_addr;
468 void *ret; 468 void *ret;
469 int order = get_order(size); 469 int order = get_order(size);
470 u64 dma_mask = DMA_32BIT_MASK;
471
472 if (hwdev && hwdev->coherent_dma_mask)
473 dma_mask = hwdev->coherent_dma_mask;
470 474
471 ret = (void *)__get_free_pages(flags, order); 475 ret = (void *)__get_free_pages(flags, order);
472 if (ret && address_needs_mapping(hwdev, virt_to_bus(ret), size)) { 476 if (ret && !is_buffer_dma_capable(dma_mask, virt_to_bus(ret), size)) {
473 /* 477 /*
474 * The allocated memory isn't reachable by the device. 478 * The allocated memory isn't reachable by the device.
475 * Fall back on swiotlb_map_single(). 479 * Fall back on swiotlb_map_single().
@@ -493,9 +497,9 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
493 dev_addr = virt_to_bus(ret); 497 dev_addr = virt_to_bus(ret);
494 498
495 /* Confirm address can be DMA'd by device */ 499 /* Confirm address can be DMA'd by device */
496 if (address_needs_mapping(hwdev, dev_addr, size)) { 500 if (!is_buffer_dma_capable(dma_mask, dev_addr, size)) {
497 printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n", 501 printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n",
498 (unsigned long long)*hwdev->dma_mask, 502 (unsigned long long)dma_mask,
499 (unsigned long long)dev_addr); 503 (unsigned long long)dev_addr);
500 504
501 /* DMA_TO_DEVICE to avoid memcpy in unmap_single */ 505 /* DMA_TO_DEVICE to avoid memcpy in unmap_single */