On 04/01/16 08:06, Tomas Krcka wrote:
> Hi,
>   I had a problem with setting baudrate of serial line by stty command.
> I tried to change the baudrate, but the stty went to frozen state.
> I found out that problem is that kernel has IXON enabled as default
> and before change of speed the line received DC3 char. It's illegal
> character in this situation, it happens once per 100 starts of the
> system.
> 
> Example situation:
>    IXON is enabled in kernel by default and a serial line received DC3
> char and then you can not disable IXON. There is waiting for empty
> buffer in kernel but sending is stopped because of DC3 char.
> 
> If TCSADRAIN is changed to TCSANOW then it's correct.
> 
> Do you have any opinion about the situation ? Is it possible to change
> TCSADRAIN to TCSANOW or create a new parameter of stty to change the
> serial line settings immediately ?

Interesting. I see that Red Hat systems for the last 6 years
have unconditionally used TCSANOW rather than TCSADRAIN due to:
https://bugzilla.redhat.com/504798

I see a similar 13 year old request to debian:
https://bugs.debian.org/210475

I see that FreeBSD uses TCSANOW (well the equivalent 0 value).

Now it's tempting to use TCSANOW unconditionally
though it does seem safer to drain pending output before changing settings,
so an option like you suggest seems appropriate.

thanks,
Pádraig

Reply via email to