Skip to content

Commit

Permalink
Revert "swiotlb: panic if nslabs is too small"
Browse files Browse the repository at this point in the history
This reverts commit 0bf28fc.

Reasons:
  1. new panic()s shouldn't be added [1].
  2. It does no "cleanup" but breaks MIPS [2].

[1]: https://lore.kernel.org/r/CAHk-=wit-DmhMfQErY29JSPjFgebx_Ld+pnerc4J2Ag990WwAA@mail.gmail.com/
[2]: https://lore.kernel.org/r/20220820012031.1285979-1-yuzhao@google.com/

Fixes: 0bf28fc ("swiotlb: panic if nslabs is too small")
Signed-off-by: Yu Zhao <yuzhao@google.com>
  • Loading branch information
yuzhaogoogle authored and intel-lab-lkp committed Aug 29, 2022
1 parent c40e834 commit b253fbc
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kernel/dma/swiotlb.c
Expand Up @@ -325,10 +325,6 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
if (!default_nareas)
swiotlb_adjust_nareas(num_possible_cpus());

nslabs = default_nslabs;
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
* allow to pick a location everywhere for hypervisors with guest
Expand All @@ -341,8 +337,7 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
else
tlb = memblock_alloc_low(bytes, PAGE_SIZE);
if (!tlb) {
pr_warn("%s: Failed to allocate %zu bytes tlb structure\n",
__func__, bytes);
pr_warn("%s: failed to allocate tlb structure\n", __func__);
return;
}

Expand Down

0 comments on commit b253fbc

Please sign in to comment.