]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:52 +0000 (17:32 +0100)
commitfc983cf5ddd265aa35e9a84323f82446bfded620
tree1bdf2fee2deb07b1b5a00dc45bd04b98a949092f
parent6e092fa42ed156e023461fe47558eb72218c9499
powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs

commit 096339ab84f36beae0b1db25e0ce63fb3873e8b2 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/iommu.c