Fair enough. I wasn't 100% sure that adding what is really an extra layer of buffering in the driver was the best solution.This patch adds checking for how many bytes have been inserted into the ttyI don't think this is the way to tackle it.
buffer and places data which hasn't been inserted into a pending buffer list.
The pending buffer list is pushed to the tty buffer when the tty unthrottles
If the kernel tty buffer code is shedding data then not only have weThe setup is a Nokia mobile phone sending some application data over a USB connection. Applications running on Nokia's Symbian based mobile phones which wish to communicate with a PC over USB are offered a virtual COM port on the mobile phone side. This COM port appears as a second cdc-acm device to the PC.
asserted a throttle but 64K has been accumulated or the system is out of
memory.
So the questions to me are:
a) Why is your setup filling 64K in the time it takes the throttle
response to occur
b) Do we care (is the right thing to do to lose bits anyway at that point)The cdc-acm driver which Nokia provide for Windows doesn't drop data when transferring large volumes of data, so most application making use of the mobile phone to PC USB connection won't have implemented any form of error correction or retransmission. If we don't care about data loss on Linux then it will force the application layer to implement some way of detecting these losses and to then retransmit the data.
c) What should we do about it in the *general* caseAgreed. I'm not sure about how specific to cdc-acm it is though. I think the reason that I'm seeing this problem is due to the high data rate of USB combined with the protocol that is being used over the cdc-acm channel not having any flow control or acknowledgements. I have no idea how specialist this situation is though.
It seems to me either its a cdc-acm specific problem with throttle
response behaviour, or its a general case at very high speed (which seems
more likely). In neither case is adding an extra queue to paper over it
the right solution.