Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-16 Thread Felipe Balbi
Hi, On Wed, Sep 15, 2010 at 08:10:15AM -0500, Sergei Shtylyov wrote: I don't see what to rework. The last short packet should still satisfy (request-actual == request-length) condition, no? of course not, it's short not zero. so the last short packet can be anything from 1 to 511 bytes.

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-16 Thread Gadiyar, Anand
On Thu, Sep 16, 2010 at 11:35 AM, Felipe Balbi ba...@ti.com wrote: Hi, On Wed, Sep 15, 2010 at 08:10:15AM -0500, Sergei Shtylyov wrote:   I don't see what to rework. The last short packet should still satisfy (request-actual == request-length) condition, no? of course not, it's short not

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-16 Thread Felipe Balbi
On Thu, Sep 16, 2010 at 01:15:32AM -0500, Gadiyar, Anand wrote: On Thu, Sep 16, 2010 at 11:35 AM, Felipe Balbi ba...@ti.com wrote: Hi, On Wed, Sep 15, 2010 at 08:10:15AM -0500, Sergei Shtylyov wrote:   I don't see what to rework. The last short packet should still satisfy (request-actual ==

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-16 Thread Ming Lei
2010/9/16 Felipe Balbi ba...@ti.com: If it's TX, both condtions should automatically be true, right? even in mode1 ? I have to revist my docs, but afaict mode1 won't transmit last short packet, no matter if it's tx or rx. Could be wrong, though. Seems short packet is always sent using mode

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-16 Thread Sergei Shtylyov
Hello. On 16-09-2010 10:05, Felipe Balbi wrote: I don't see what to rework. The last short packet should still satisfy (request-actual == request-length) condition, no? of course not, it's short not zero. so the last short packet can be anything from 1 to 511 bytes. Sigh. Where have I

[Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-15 Thread Ming Lei
Hi All, In another thread, Sergei pointed out there is a ZLP issue in musb_g_tx: Sergei Shtylyov sshtyl...@mvista.com wrote: Hello. On 15-09-2010 14:05, Felipe Balbi wrote: I didn't say it was duplicate for DMA, just too late. how come ? we need to send ZLP before giving back the

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-15 Thread Felipe Balbi
Hi, On Wed, Sep 15, 2010 at 05:53:10AM -0500, Ming Lei wrote: 1), why is the check for is_dma needed here? if (is_dma || request-actual == request-length) { } if you programmed dma to request-length (and assuming it worked just fine) mode1 will only interrupt you

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-15 Thread Ming Lei
2010/9/15 Felipe Balbi ba...@ti.com: Hi, On Wed, Sep 15, 2010 at 05:53:10AM -0500, Ming Lei wrote: 1),  why is the check for is_dma needed here?     if (is_dma || request-actual == request-length) {               } if you programmed dma to request-length (and assuming it worked just

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-15 Thread Felipe Balbi
Hi, On Wed, Sep 15, 2010 at 06:02:22AM -0500, 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

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-15 Thread Ming Lei
2010/9/15 Felipe Balbi ba...@ti.com: IMO, it is not difficult to give a good fix for the ZLP problem if the two questions are clear. true, but some re-work needs to be done. I suggest we do the fix for ZLP issue in a new patch against the current patch set to avoid the rework. More

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-15 Thread Sergei Shtylyov
Ming Lei wrote: Hi All, In another thread, Sergei pointed out there is a ZLP issue in musb_g_tx: Sergei Shtylyov sshtyl...@mvista.com wrote: Hello. On 15-09-2010 14:05, Felipe Balbi wrote: I didn't say it was duplicate for DMA, just too late. how come ? we need to send ZLP before

Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx

2010-09-15 Thread Sergei Shtylyov
Hello. Felipe Balbi wrote: On Wed, Sep 15, 2010 at 06:02:22AM -0500, 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