Hello. On 16-09-2010 8:46, Ming Lei wrote:
If so, once the dma interrupt comes, will request->actual be same with request->length in musb_g_tx? And if it is true, could we remove the check for 'is_dma'?
see that is_dma is set to true by just checking if dma in enabled in txcsr, it might be that dma didn't complete everything and you need to write txpktrdy by hand to send last short packet. So to remove that you would need to re-work a bit more code.
You need to know when this is a dma IRQ or an endpoint IRQ.
How about the fix below(against the previous patch set) for the ZLP problem pointed by Sergei?
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 46cf94a..a15a83c 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -477,40 +477,37 @@ void musb_g_tx(struct musb *musb, u8 epnum) epnum, csr, musb_ep->dma->actual_len, request); } - if (is_dma || request->actual == request->length) { - /* - * First, maybe a terminating short packet. Some DMA - * engines might handle this by themselves. - */ - if ((request->zero && request->length - && request->length % musb_ep->packet_sz == 0) + /* + * First, maybe a terminating short packet. Some DMA + * engines might handle this by themselves. + */ + if ((request->zero && (request->actual == request->length))
No. You should only send ZLP only if (request->length % musb_ep->packet_sz == 0)
WBR, Sergei -- 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