Skip to content

Commit 47285be

Browse files
liubiingregkh
authored andcommitted
usb: musb: cppi41: don't check early-TX-interrupt for Isoch transfer
commit 0090114 upstream. The CPPI 4.1 driver polls register to workaround the premature TX interrupt issue, but it causes audio playback underrun when triggered in Isoch transfers. Isoch doesn't do back-to-back transfers, the TX should be done by the time the next transfer is scheduled. So skip this polling workaround for Isoch transfer. Fixes: a655f48 ("usb: musb: musb_cppi41: handle pre-mature TX complete interrupt") Reported-by: Alexandre Bailon <abailon@baylibre.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Tested-by: Alexandre Bailon <abailon@baylibre.com> Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a7cb1fa commit 47285be

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

drivers/usb/musb/musb_cppi41.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,27 @@ static void cppi41_dma_callback(void *private_data)
250250
transferred < cppi41_channel->packet_sz)
251251
cppi41_channel->prog_len = 0;
252252

253-
if (cppi41_channel->is_tx)
254-
empty = musb_is_tx_fifo_empty(hw_ep);
253+
if (cppi41_channel->is_tx) {
254+
u8 type;
255+
256+
if (is_host_active(musb))
257+
type = hw_ep->out_qh->type;
258+
else
259+
type = hw_ep->ep_in.type;
260+
261+
if (type == USB_ENDPOINT_XFER_ISOC)
262+
/*
263+
* Don't use the early-TX-interrupt workaround below
264+
* for Isoch transfter. Since Isoch are periodic
265+
* transfer, by the time the next transfer is
266+
* scheduled, the current one should be done already.
267+
*
268+
* This avoids audio playback underrun issue.
269+
*/
270+
empty = true;
271+
else
272+
empty = musb_is_tx_fifo_empty(hw_ep);
273+
}
255274

256275
if (!cppi41_channel->is_tx || empty) {
257276
cppi41_trans_done(cppi41_channel);

0 commit comments

Comments
 (0)