From: Cliff Cai <cliff.cai@xxxxxxxxxx> Some Blackfin MUSB versions of hardware have problems with mode1 and max packet sizes (interrupts are not generated). So in this case, fall back to mode0 automatically. Signed-off-by: Cliff Cai <cliff.cai@xxxxxxxxxx> Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx> --- drivers/usb/musb/musb_gadget.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 7577094..6a14601 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -308,10 +308,16 @@ static void txstate(struct musb *musb, struct musb_request *req) { size_t request_size; - /* setup DMA, then program endpoint CSR */ + /* setup DMA, then program endpoint CSR, + * currently, don't use mode1 on Blackfin. + */ +#if !defined(CONFIG_BLACKFIN) || defined(USE_MODE1) request_size = min_t(size_t, request->length, musb_ep->dma->max_len); - if (request_size < musb_ep->packet_sz) +#else + request_size = fifo_count; +#endif + if (request_size <= musb_ep->packet_sz) musb_ep->dma->desired_mode = 0; else musb_ep->dma->desired_mode = 1; -- 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