serial: samsung: use dma_ops of DMA if attached
authorTamseel Shams <m.shams@samsung.com>
Tue, 29 Jun 2021 04:59:02 +0000 (10:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jul 2021 10:40:33 +0000 (12:40 +0200)
commit4fc2d3cd6d3a487a9fb79ebc81f7ae86a7dace7a
treebdc8fb5e816c15a0331caf60d157ff0b6fdb2ebf
parentb0819465be8be0c76af15436a9e6db4dab4c196e
serial: samsung: use dma_ops of DMA if attached

When DMA is used for TX and RX by serial driver, it should
pass the DMA device pointer to DMA API instead of UART device
pointer. DMA device should be used for DMA API because only
the DMA device is aware of how the device connects to the memory.
There might be an extra level of address translation due to a
SMMU attached to the DMA device. When serial device is used for
DMA API, the DMA API will have no clue of the SMMU attached to
the DMA device.

This patch is necessary to fix the SMMU page faults
which is observed when a DMA(with SMMU enabled) is attached
to UART for transfer.

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Tamseel Shams <m.shams@samsung.com>
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Link: https://lore.kernel.org/r/20210629045902.48912-1-m.shams@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/samsung_tty.c