Skip to content
Commit 466257d9 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Vinod Koul
Browse files

dmaengine: sh: usb-dmac: set tx_result parameters

A client driver (renesas_usbhs) assumed that
dmaengine_tx_status() could return the residue even if
the transfer was completed. However, this was not correct
usage [1] and this caused to break getting the residue after
the commit 24461d97 ("dmaengine: virt-dma: Fix access after
free in vchan_complete()") actually. So, this is possible to get
wrong received size if the usb controller gets a short packet.
For example, g_zero driver causes "bad OUT byte" errors.

To use the tx_result from the renesas_usbhs driver when
the transfer is completed, set the tx_result parameters.

Notes that the renesas_usbhs driver needs to update for it.

[1]
https://lore.kernel.org/dmaengine/20200616165550.GP2324254@vkoul-mobl/



Reported-by: default avatarHien Dang <hien.dang.eb@renesas.com>
Fixes: 24461d97 ("dmaengine: virt-dma: Fix access after free in vchan_complete()")
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/1592482053-19433-1-git-send-email-yoshihiro.shimoda.uh@renesas.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent d964d5ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment