| .. | .. |
|---|
| 18 | 18 | |
|---|
| 19 | 19 | shift = iova_shift(iovad); |
|---|
| 20 | 20 | iova_len = size >> shift; |
|---|
| 21 | + |
|---|
| 22 | +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE |
|---|
| 21 | 23 | /* |
|---|
| 22 | 24 | * Freeing non-power-of-two-sized allocations back into the IOVA caches |
|---|
| 23 | 25 | * will come back to bite us badly, so we have to waste a bit of space |
|---|
| .. | .. |
|---|
| 26 | 28 | */ |
|---|
| 27 | 29 | if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1))) |
|---|
| 28 | 30 | iova_len = roundup_pow_of_two(iova_len); |
|---|
| 31 | +#endif |
|---|
| 29 | 32 | |
|---|
| 30 | 33 | #if (KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE) |
|---|
| 31 | 34 | dma_limit = min_not_zero(dma_limit, dev->bus_dma_limit); |
|---|