summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-23 02:40:55 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-23 02:40:55 +0200
commite2172d8fd500a51a3845bc2294cdf4feaa388dab (patch)
treef9eb9b8b0d704e3c86d1f953cdbbcf57522f9352 /lib
parentMerge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel... (diff)
parentx86/crash: Allocate enough low memory when crashkernel=high (diff)
downloadlinux-e2172d8fd500a51a3845bc2294cdf4feaa388dab.tar.xz
linux-e2172d8fd500a51a3845bc2294cdf4feaa388dab.zip
Merge branch 'x86-kdump-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 kdump updates from Ingo Molnar: "Three kdump robustness related improvements (Joerg Roedel)" * 'x86-kdump-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/crash: Allocate enough low memory when crashkernel=high x86/swiotlb: Try coherent allocations with __GFP_NOWARN swiotlb: Warn on allocation failure in swiotlb_alloc_coherent()
Diffstat (limited to 'lib')
-rw-r--r--lib/swiotlb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 3c365ab6cf5f..42e192decbfd 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -656,7 +656,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
*/
phys_addr_t paddr = map_single(hwdev, 0, size, DMA_FROM_DEVICE);
if (paddr == SWIOTLB_MAP_ERROR)
- return NULL;
+ goto err_warn;
ret = phys_to_virt(paddr);
dev_addr = phys_to_dma(hwdev, paddr);
@@ -670,7 +670,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
/* DMA_TO_DEVICE to avoid memcpy in unmap_single */
swiotlb_tbl_unmap_single(hwdev, paddr,
size, DMA_TO_DEVICE);
- return NULL;
+ goto err_warn;
}
}
@@ -678,6 +678,13 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
memset(ret, 0, size);
return ret;
+
+err_warn:
+ pr_warn("swiotlb: coherent allocation failed for device %s size=%zu\n",
+ dev_name(hwdev), size);
+ dump_stack();
+
+ return NULL;
}
EXPORT_SYMBOL(swiotlb_alloc_coherent);