mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
swiotlb: panic if nslabs is too small
Panic on purpose if nslabs is too small, in order to sync with the remap retry logic. In addition, print the number of bytes for tlb alloc failure. Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
04c14e8e38
commit
0bf28fc40d
1 changed files with 5 additions and 1 deletions
|
@ -242,6 +242,9 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
|
||||||
if (swiotlb_force_disable)
|
if (swiotlb_force_disable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (nslabs < IO_TLB_MIN_SLABS)
|
||||||
|
panic("%s: nslabs = %lu too small\n", __func__, nslabs);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* By default allocate the bounce buffer memory from low memory, but
|
* By default allocate the bounce buffer memory from low memory, but
|
||||||
* allow to pick a location everywhere for hypervisors with guest
|
* allow to pick a location everywhere for hypervisors with guest
|
||||||
|
@ -254,7 +257,8 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
|
||||||
else
|
else
|
||||||
tlb = memblock_alloc_low(bytes, PAGE_SIZE);
|
tlb = memblock_alloc_low(bytes, PAGE_SIZE);
|
||||||
if (!tlb) {
|
if (!tlb) {
|
||||||
pr_warn("%s: failed to allocate tlb structure\n", __func__);
|
pr_warn("%s: Failed to allocate %zu bytes tlb structure\n",
|
||||||
|
__func__, bytes);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue