Re: [PATCH] USB: cdc-acm: Prevent data loss when filling tty buffer.

From: Toby Gray
Date: Wed Mar 23 2011 - 08:16:02 EST

This is a multi-part message in MIME format.On 22/03/2011 07:43, Oliver Neukum wrote:
Have you tested whether the driver recovers from running out of buffers?
Other than that it is looking good to me.
I had tested the driver running out of buffers quite extensively, but I think I must have just been lucky with the timings. Now that I've had a look at the code in more detail, I believe it would be possible for a throttle/unthrottle not to occur, in which case no more new URB reads would be submitted.

I've attached a v3 version of the patch which ensures that either the tty is throttled or the tasklet is rescheduled. I assume that it would be preferable to wait until Johan Hovold's '[PATCH 16/16] USB: cdc-acm: re-write read processing' has been submitted and then for me to submit another similar patch to this one, but which doesn't need the rx tasklet.

I decided it was still worth attaching the patch as it'll allow people to fix this issue on older kernel versions