提交 1521c607 编写于 作者: C Christoph Hellwig

swiotlb: don't panic when the swiotlb buffer can't be allocated

For historical reasons the switlb code paniced when the metadata could
not be allocated, but just printed a warning when the actual main
swiotlb buffer could not be allocated.  Restore this somewhat unexpected
behavior as changing it caused a boot failure on the Microchip RISC-V
PolarFire SoC Icicle kit.

Fixes: 6424e31b ("swiotlb: remove swiotlb_init_with_tbl and swiotlb_init_late_with_tbl")
Reported-by: NConor Dooley <Conor.Dooley@microchip.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
Acked-by: NConor Dooley <conor.dooley@microchip.com>
Tested-by: NConor Dooley <Conor.Dooley@microchip.com>
上级 84bc4f1d
...@@ -254,8 +254,10 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags, ...@@ -254,8 +254,10 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
tlb = memblock_alloc(bytes, PAGE_SIZE); tlb = memblock_alloc(bytes, PAGE_SIZE);
else else
tlb = memblock_alloc_low(bytes, PAGE_SIZE); tlb = memblock_alloc_low(bytes, PAGE_SIZE);
if (!tlb) if (!tlb) {
panic("%s: failed to allocate tlb structure\n", __func__); pr_warn("%s: failed to allocate tlb structure\n", __func__);
return;
}
if (remap && remap(tlb, nslabs) < 0) { if (remap && remap(tlb, nslabs) < 0) {
memblock_free(tlb, PAGE_ALIGN(bytes)); memblock_free(tlb, PAGE_ALIGN(bytes));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册