From 690cd1d4c48b369c9c7be0626575aec2a09b4ce8 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 23 Oct 2008 18:42:03 +0900 Subject: [PATCH] --- yaml --- r: 117972 b: refs/heads/master c: a2b89b596c5a0b288adac84b17bdda6bde8d144e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/lib/swiotlb.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 6a993f4711dd..10429afcdd78 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ff3c536291ce96ef6f45704cd37eaed71127dd42 +refs/heads/master: a2b89b596c5a0b288adac84b17bdda6bde8d144e diff --git a/trunk/lib/swiotlb.c b/trunk/lib/swiotlb.c index f8eebd489149..78330c37a61b 100644 --- a/trunk/lib/swiotlb.c +++ b/trunk/lib/swiotlb.c @@ -497,8 +497,10 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size, printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n", (unsigned long long)*hwdev->dma_mask, (unsigned long long)dev_addr); - panic("swiotlb_alloc_coherent: allocated memory is out of " - "range for device"); + + /* DMA_TO_DEVICE to avoid memcpy in unmap_single */ + unmap_single(hwdev, ret, size, DMA_TO_DEVICE); + return NULL; } *dma_handle = dev_addr; return ret;