--- zzzz-none-000/linux-2.6.39.4/drivers/usb/musb/musb_host.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/drivers/usb/musb/musb_host.c 2021-11-10 13:23:10.000000000 +0000 @@ -1171,6 +1171,8 @@ if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) { dma->status = MUSB_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); + /* Added by Hai - the channel was tore down, need to re-allocate in ep_program later? */ + hw_ep->tx_channel = NULL; } /* do the proper sequence to abort the transfer in the @@ -1530,6 +1532,8 @@ if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) { dma->status = MUSB_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); + /* Added by Hai - the channel was tore down, need to re-allocate later? */ + hw_ep->rx_channel = NULL; xfer_len = dma->actual_len; } musb_h_flush_rxfifo(hw_ep, MUSB_RXCSR_CLRDATATOG); @@ -1561,6 +1565,8 @@ if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) { dma->status = MUSB_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); + /* Added by Hai - the channel was tore down, need to re-allocate later? */ + hw_ep->rx_channel = NULL; xfer_len = dma->actual_len; done = true; } @@ -1593,7 +1599,7 @@ /* even if there was an error, we did the dma * for iso_frame_desc->length */ - if (d->status != EILSEQ && d->status != -EOVERFLOW) + if (d->status != -EILSEQ && d->status != -EOVERFLOW) d->status = 0; if (++qh->iso_idx >= urb->number_of_packets) @@ -2101,12 +2107,22 @@ dma = is_in ? ep->rx_channel : ep->tx_channel; if (dma) { + /*REVISIT: check if we really need to modify dma->status */ + dma->status = MUSB_DMA_STATUS_CORE_ABORT; status = ep->musb->dma_controller->channel_abort(dma); DBG(status ? 1 : 3, "abort %cX%d DMA for urb %p --> %d\n", is_in ? 'R' : 'T', ep->epnum, urb, status); urb->actual_length += dma->actual_len; + + /* Added by Hai */ + if( is_in ) { + ep->rx_channel = NULL; + } else { + ep->tx_channel = NULL; + } + } }