lkml.org 
[lkml]   [2010]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND/PATCH 5/6] USB: musb-gadget: complete request only if data is transfered over
Felipe Balbi wrote:

>>> your forgetting the fact that not always you need to send ZLP after
>>> completing a packet_size-aligned transfer,

>> So what?

> what you're saying is that when we change the ZLP handling, the
> request->actual == request->lenght check will have to be removed, but
> that's not true because ZLP is only needed if request->zero is set.

> So the final code would be something like (pseudo-code):

> if (request->lenght % musb_ep->packet_sz)
> set_last_packet_is_short_flag(musb_request);

> if (request->zero || last_packet_is_short(request)) {
> set_txpktrdy(musb);
> set_musb_request_completed_flag(musb_request);
> return;
> }

> if (request->acual == request->length)
> musb_g_giveback(musb, request);

> restart_ep_if_more_requests(musb_ep);

No, this code will still send ZLP before the whole requested transfer is
done. The (request->actual == request->length) check is needed before we even
check that request->zero is set (and it is there but not for the DMA case). I
thought that this was quite obvious, and I was surprised that this caused such a
lengthy discussion.

WBR, Sergei


\
 
 \ /
  Last update: 2010-09-15 15:05    [W:0.682 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site