]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
tty: serial: fsl_lpuart: use the sg count from dma_map_sg
authorPeng Fan <peng.fan@nxp.com>
Tue, 5 Nov 2019 05:51:10 +0000 (05:51 +0000)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 16 Dec 2019 15:32:16 +0000 (09:32 -0600)
commitbe5e49cfe815e565dbd88c822859e2f7a0c74f02
treeddef3b2d951e906fe690a580f70998054f2e64c8
parent60fdee66dc27156c985df9c9946f0e5145214446
tty: serial: fsl_lpuart: use the sg count from dma_map_sg

BugLink: https://bugs.launchpad.net/bugs/1856583
commit 487ee861de176090b055eba5b252b56a3b9973d6 upstream.

The dmaengine_prep_slave_sg needs to use sg count returned
by dma_map_sg, not use sport->dma_tx_nents, because the return
value of dma_map_sg is not always same with "nents".

When enabling iommu for lpuart + edma, iommu framework may concatenate
two sgs into one.

Fixes: 6250cc30c4c4e ("tty: serial: fsl_lpuart: Use scatter/gather DMA for Tx")
Cc: <stable@vger.kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/1572932977-17866-1-git-send-email-peng.fan@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/tty/serial/fsl_lpuart.c