summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/onboard_usb_dev.c
diff options
context:
space:
mode:
authorJiri Slaby (SUSE) <jirislaby@kernel.org>2025-05-22 07:38:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-19 15:32:35 +0200
commit393abb68b9ecc78f5ae9bc2898c3325427cd8e1d (patch)
treea8ca03f1d98c4f66bfd62727ac496dd0104f3a4b /drivers/usb/misc/onboard_usb_dev.c
parent00ddc7dad55b7bbb78df80d6e174d0c4764dea0c (diff)
tty: serial: 8250_omap: fix TX with DMA for am33xx
commit b495021a973e2468497689bd3e29b736747b896f upstream. Commit 1788cf6a91d9 ("tty: serial: switch from circ_buf to kfifo") introduced an error in the TX DMA handling for 8250_omap. When the OMAP_DMA_TX_KICK flag is set, the "skip_byte" is pulled from the kfifo and emitted directly in order to start the DMA. While the kfifo is updated, dma->tx_size is not decreased. This leads to uart_xmit_advance() called in omap_8250_dma_tx_complete() advancing the kfifo by one too much. In practice, transmitting N bytes has been seen to result in the last N-1 bytes being sent repeatedly. This change fixes the problem by moving all of the dma setup after the OMAP_DMA_TX_KICK handling and using kfifo_len() instead of the DMA size for the 4-byte cutoff check. This slightly changes the behaviour at buffer wraparound, but it still transmits the correct bytes somehow. Now, the "skip_byte" would no longer be accounted to the stats. As previously, dma->tx_size included also this skip byte, up->icount.tx was updated by aforementioned uart_xmit_advance() in omap_8250_dma_tx_complete(). Fix this by using the uart_fifo_out() helper instead of bare kfifo_get(). Based on patch by Mans Rullgard <mans@mansr.com> Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Fixes: 1788cf6a91d9 ("tty: serial: switch from circ_buf to kfifo") Link: https://lore.kernel.org/all/20250506150748.3162-1-mans@mansr.com/ Reported-by: Mans Rullgard <mans@mansr.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250522053835.3495975-1-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/onboard_usb_dev.c')
0 files changed, 0 insertions, 0 deletions