qh = hw_ep->in_qh;
else
qh = hw_ep->out_qh;
- qh = musb_giveback(qh, urb, 0);
+
+ if (urb->status == -EINPROGRESS)
+ qh = musb_giveback(qh, urb, 0);
+ else
+ qh = musb_giveback(qh, urb, urb->status);
if (qh && qh->is_ready && !list_empty(&qh->hep->urb_list)) {
DBG(4, "... next ep%d %cX urb %p\n",
} else {
csr = musb_readw(ep->regs, MUSB_RXCSR);
if (csr & MUSB_RXCSR_RXPKTRDY)
- WARN("rx%d, packet/%d ready?\n", ep->epnum,
+ WARNING("rx%d, packet/%d ready?\n", ep->epnum,
musb_readw(ep->regs, MUSB_RXCOUNT));
musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
pipe = urb->pipe;
- DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zd)\n",
+ DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zu)\n",
epnum, rx_csr, urb->actual_length,
dma ? dma->actual_len : 0);
(void) musb->dma_controller->channel_abort(dma);
xfer_len = dma->actual_len;
}
- musb_h_flush_rxfifo(hw_ep, 0);
+ musb_h_flush_rxfifo(hw_ep, MUSB_RXCSR_CLRDATATOG);
musb_writeb(epio, MUSB_RXINTERVAL, 0);
done = true;
goto finish;
done = true;
}
- DBG(2, "RXCSR%d %04x, reqpkt, len %zd%s\n", epnum, rx_csr,
+ DBG(2, "RXCSR%d %04x, reqpkt, len %zu%s\n", epnum, rx_csr,
xfer_len, dma ? ", dma" : "");
rx_csr &= ~MUSB_RXCSR_H_REQPKT;
return 0;
if (is_host_active(musb) && musb->is_active) {
- WARN("trying to suspend as %s is_active=%i\n",
+ WARNING("trying to suspend as %s is_active=%i\n",
otg_state_string(musb), musb->is_active);
return -EBUSY;
} else