]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pseries/iommu: Fix window size for direct mapping with pmem
authorLeonardo Bras <leobras.c@gmail.com>
Tue, 20 Apr 2021 04:54:04 +0000 (01:54 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 21 Apr 2021 12:52:31 +0000 (22:52 +1000)
commitd229509fb2ef4f05678befdf109d1feea29c3bbd
treec97668fa571d9b4bac903f003d2ec521d56e5a4a
parentbaf6f71057b66de6015283b8ca1cae5954db8d39
powerpc/pseries/iommu: Fix window size for direct mapping with pmem

As of today, if the DDW is big enough to fit (1 << MAX_PHYSMEM_BITS)
it's possible to use direct DMA mapping even with pmem region.

But, if that happens, the window size (len) is set to (MAX_PHYSMEM_BITS
- page_shift) instead of MAX_PHYSMEM_BITS, causing a pagesize times
smaller DDW to be created, being insufficient for correct usage.

Fix this so the correct window size is used in this case.

Fixes: 34f485db98073 ("powerpc/dma: Fallback to dma_ops when persistent memory present")
Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210420045404.438735-1-leobras.c@gmail.com
arch/powerpc/platforms/pseries/iommu.c