Alan Cox wrote: > In a waiting case the driver will get > > ->chars_in_buffer > until it returns zero > ->wait_until_sent > ->change_termios > > which serializes with respect to the one writer. If you have a writer > during a termios change by another well tough luck, you lose and I've > no intention of changing that behaviour unless someone cites a standard > requiring it.

Right, of course.

My comments about TCSETAW just muddled the issue.  Scratch those.

The problem is that a non-sleeping USB serial set_termios has to
return before it can be sure the termios settings have taken effect.
With USB we can send an urb to the device telling it to change termios
settings, but without waiting for the urb callback we don't know
that the device has received the command and actually changed the
settings.

So data written immediately following the set_termios, in the same
process, might possibly be sent out the serial port before the
termios changes have taken effect.

There are several solutions:

* The tty layer could use a semaphore so the USB serial set_termios could
   sleep until the new termios settings have taken effect before returning.

* The USB serial driver could hold off sending data to the device after a
   non-sleeping set_termios until it knew the settings had taken effect in
   the device.

* Maybe in practice this is not a problem--we can just say "set_termios
   for USB serial devices will change the termios settings as soon as
   possible, but there is a slight chance data written immediately after
   set termios might go out under the previous termios settings".

* Or ... other suggestions?

-- Al




------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to