From 72a472d2f912292457d6e3579df342c1138f26d5 Mon Sep 17 00:00:00 2001 From: Takeyoshi Kikuchi Date: Mon, 2 Mar 2015 11:03:51 +0900 Subject: usb: musb: cppi41: fix condition to call cppi41_trans_done(). connect AR9271(USB wifi) to AM335x, and send a flood ping from Mac OSX, AR9271 is stopped. on USB bus, the following occurs. - OUT transaction is ACKed (NYET). - IN transaction is ACKed (512bytes). - PING-NAK transaction is continued for about 2 seconds (AR9271 timeout?). In current imprementation, IN-transaction is not completed because it checks the empty of TX-FIFO in cppi41_dma_callback(). As a result, communication to AR9271 stops. This patch modified to check the empty of TX-FIFO only when OUT-transaction. Signed-off-by: Takeyoshi Kikuchi Signed-off-by: Felipe Balbi --- drivers/usb/musb/musb_cppi41.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/usb/musb/musb_cppi41.c') diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index 9dc45a4a9fa8..8bd8c5e26921 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -250,8 +250,10 @@ static void cppi41_dma_callback(void *private_data) transferred < cppi41_channel->packet_sz) cppi41_channel->prog_len = 0; - empty = musb_is_tx_fifo_empty(hw_ep); - if (empty) { + if (cppi41_channel->is_tx) + empty = musb_is_tx_fifo_empty(hw_ep); + + if (!cppi41_channel->is_tx || empty) { cppi41_trans_done(cppi41_channel); goto out; } -- cgit v1.2.3