Akhil R 30f0ced997 dmaengine: tegra186: Fix residual calculation
The existing residual calculation returns an incorrect value when
bytes_xfer == bytes_req. This scenario occurs particularly with drivers
like UART where DMA is scheduled for maximum number of bytes and is
terminated when the bytes inflow stops. At higher baud rates, it could
request the tx_status while there is no bytes left to transfer. This will
lead to incorrect residual being set. Hence return residual as '0' when
bytes transferred equals to the bytes requested.

Fixes: ee17028009d4 ("dmaengine: tegra: Add tegra gpcdma driver")
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20240315124411.17582-1-akhilrajeev@nvidia.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2024-03-28 12:31:42 +05:30
..
2024-03-15 12:25:13 -07:00
2023-11-03 18:56:51 -10:00
2024-03-15 12:25:13 -07:00
2024-03-15 12:25:13 -07:00
2024-03-15 12:25:13 -07:00
2024-03-15 12:25:13 -07:00
2023-11-03 18:56:51 -10:00