Pete --
It does look like this solves the out of order writes, but at the expense of allocating a buffer for every write and delaying the write until the helper gets scheduled. It also needs GFP_ATOMIC kmallocs. I fear this overhead will hurt performance. (We just recently had a customer who bought a bunch of EdgePorts because it could write data with under 20ms latency--if we have to wait to schedule your post_helper I am not sure we can meet that latency requirement.)
Also, your write_room function will prevent USB serial drivers from reporting the real amount of room. The new io_ti driver has its own write buffer, but your patch would not call the io_ti driver write_room function in interrupts and instead decide for itself that io_ti has 64 bytes of room--even if that is not true.
I still think the bugs should be fixed in the low level serial drivers rather than worked around by this complicated patch.
At the very least, we must add a "low_level_locking" flag to usbserial so that USB serial drivers that do their own locking correctly and their own correct write_room handling can avoid both the broken semaphore in usbserial, and, if it gets added, this post_helper. I am preparing such a patch right now.
Would you be willing to help me fix the low level USB serial drivers? Two fixes in the low level drivers will do everything your post_helper patch does, and do it correctly. First we need to add spinlocking to the low level write and write room functions. Then we need to add a write buffer so that the write_room function can report a meaningful value. This can either be a circular buffer, or a non-circular buffer (see digi_acceleport for example). It is more work, but so much cleaner, as your comments admit.
-- Al
------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel