lkml.org 
[lkml]   [2011]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] USB: cdc-acm: Prevent data loss when filling tty buffer.
On 21/03/2011 16:56, Alan Cox wrote:
> On Mon, 21 Mar 2011 15:52:25 +0000
> Toby Gray<toby.gray@realvnc.com> wrote:

>> This patch adds checking for how many bytes have been inserted into the tty
>> buffer and returns any remaining bytes back to the filled read buffer list.
> How does ACM handle flow control - is the expectation that it gets flow
> controlled in hardware by not having the opportunity to send bits
> to the host end ? If so this seems to make sense.
Yes, the expectation is that it is flow controlled in hardware if a bulk
endpoint is used. To this end cdc-acm.ko doesn't issue any new read
requests while the tty is throttled. This works as flow control most of
the time, but not when the data is arriving quickly (a few megabytes per
second).

Thank you for your other comments. I had initially gone for the memmove
thinking that having a buffer head as well as a base would have
needlessly complicated the rest of the code.

Having made the required changes it seems I'd greatly overestimated the
changes and it is definitely far cleaner without the memmove.

Regards,

Toby


\
 
 \ /
  Last update: 2011-03-21 19:01    [from the cache]
©2003-2011 Jasper Spaans