From: Cliff Cai <cliff.cai@xxxxxxxxxx> Due to some anomalies, utilizing DMA double buffer may lead to infinite hangs or data corruption. So when this anomalies exist, disable double buffering mode. Signed-off-by: Cliff Cai <cliff.cai@xxxxxxxxxx> Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx> --- drivers/usb/musb/musb_gadget.c | 14 ++++++++++++++ drivers/usb/musb/musb_host.c | 7 +++++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 74ff624..827a083 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -893,7 +893,14 @@ static int musb_gadget_enable(struct usb_ep *ep, /* REVISIT if can_bulk_split(), use by updating "tmp"; * likewise high bandwidth periodic tx */ +#if defined(CONFIG_BLACKFIN) && ANOMALY_05000450 + /* Set TXMAXP with the FIFO size of the endpoint + * to disable double buffer mode. + */ + musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx); +#else musb_writew(regs, MUSB_TXMAXP, tmp); +#endif csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; if (musb_readw(regs, MUSB_TXCSR) @@ -923,7 +930,14 @@ static int musb_gadget_enable(struct usb_ep *ep, /* REVISIT if can_bulk_combine() use by updating "tmp" * likewise high bandwidth periodic rx */ +#if defined(CONFIG_BLACKFIN) && ANOMALY_05000465 + /* Set RXMAXP with the FIFO size of the endpoint + * to disable double buffer mode. + */ + musb_writew(regs, MUSB_RXMAXP, hw_ep->max_packet_sz_rx); +#else musb_writew(regs, MUSB_RXMAXP, tmp); +#endif /* force shared fifo to OUT-only mode */ if (hw_ep->is_shared_fifo) { diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 74c4c36..159aae6 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -605,8 +605,15 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) musb_writeb(ep->regs, MUSB_RXTYPE, qh->type_reg); musb_writeb(ep->regs, MUSB_RXINTERVAL, qh->intv_reg); /* NOTE: bulk combining rewrites high bits of maxpacket */ +#if defined(CONFIG_BLACKFIN) && ANOMALY_05000465 + /* Set RXMAXP with the FIFO size of the endpoint + * to disable double buffer mode. + */ + musb_writew(ep->regs, MUSB_RXMAXP, ep->max_packet_sz_rx); +#else musb_writew(ep->regs, MUSB_RXMAXP, qh->maxpacket | ((qh->hb_mult - 1) << 11)); +#endif ep->rx_reinit = 0; } -- 1.6.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html