Skip to content

Commit 0090114

Browse files
liubiingregkh
authored andcommitted
usb: musb: cppi41: don't check early-TX-interrupt for Isoch transfer
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") Cc: <stable@vger.kernel.org> Freescale#4.1+ 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 3243367 commit 0090114

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
@@ -238,8 +238,27 @@ static void cppi41_dma_callback(void *private_data,
238238
transferred < cppi41_channel->packet_sz)
239239
cppi41_channel->prog_len = 0;
240240

241-
if (cppi41_channel->is_tx)
242-
empty = musb_is_tx_fifo_empty(hw_ep);
241+
if (cppi41_channel->is_tx) {
242+
u8 type;
243+
244+
if (is_host_active(musb))
245+
type = hw_ep->out_qh->type;
246+
else
247+
type = hw_ep->ep_in.type;
248+
249+
if (type == USB_ENDPOINT_XFER_ISOC)
250+
/*
251+
* Don't use the early-TX-interrupt workaround below
252+
* for Isoch transfter. Since Isoch are periodic
253+
* transfer, by the time the next transfer is
254+
* scheduled, the current one should be done already.
255+
*
256+
* This avoids audio playback underrun issue.
257+
*/
258+
empty = true;
259+
else
260+
empty = musb_is_tx_fifo_empty(hw_ep);
261+
}
243262

244263
if (!cppi41_channel->is_tx || empty) {
245264
cppi41_trans_done(cppi41_channel);

0 commit comments

Comments
 (0)