[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D8791C9.1080407@realvnc.com>
Date: Mon, 21 Mar 2011 17:58:33 +0000
From: Toby Gray <toby.gray@...lvnc.com>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
CC: Oliver Neukum <oliver@...kum.name>,
Greg Kroah-Hartman <gregkh@...e.de>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [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@...lvnc.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists