]> git.itanic.dy.fi Git - linux-stable/commit
powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs
authorGaurav Batra <gbatra@linux.vnet.ibm.com>
Thu, 4 May 2023 17:59:13 +0000 (12:59 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 16 May 2023 14:53:06 +0000 (00:53 +1000)
commit096339ab84f36beae0b1db25e0ce63fb3873e8b2
treed5e69697bc080af578672e6d07b2491828c3b87f
parentad593827db9b73f15eb65416ec975ec0311f773a
powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs

When DMA window is backed by 2MB TCEs, the DMA address for the mapped
page should be the offset of the page relative to the 2MB TCE. The code
was incorrectly setting the DMA address to the beginning of the TCE
range.

Mellanox driver is reporting timeout trying to ENABLE_HCA for an SR-IOV
ethernet port, when DMA window is backed by 2MB TCEs.

Fixes: 387273118714 ("powerps/pseries/dma: Add support for 2M IOMMU page size")
Cc: stable@vger.kernel.org # v5.16+
Signed-off-by: Gaurav Batra <gbatra@linux.vnet.ibm.com>
Reviewed-by: Greg Joyce <gjoyce@linux.vnet.ibm.com>
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230504175913.83844-1-gbatra@linux.vnet.ibm.com
arch/powerpc/kernel/iommu.c