Skip to content

tty: fix input-speed handling

Johan Hovold lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tty: fix termios input-speed encodingdrivers/tty/tty_baudrate.c+3 -00 replies
2/3tty: fix termios input-speed encoding when using BOTHERdrivers/tty/tty_baudrate.c+7 -30 replies
3/3tty: support CIBAUD without BOTHERdrivers/tty/tty_baudrate.c+7 -64 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] tty: fix input-speed handling

Turns out we had some long-standing bugs in how we handle termios input speeds. Specifically, we could end up setting the CIBAUD bits despite the user leaving them cleared (i.e. B0, which means that we use the same input and output rate). And once any of these bits were set we failed to clear them on later updates, leading to incorrect rates being reported back to user space.

Both issues could lead to an unexpected input rate being set on subsequent termios updates unless the user actively clears CIBAUD.

Fortunately, no in-tree tty driver seems to use the input speed for anything but to suppress line-setting updates, so the impact of this should be mostly limited to the CIBAUD bits sometimes being incorrectly set in returned termios data.

The final patch cleans up the conditional compilation of the BOTHER and CIBAUD functionality by not having the latter depend on the former.

Johan

Johan Hovold (3):
tty: fix termios input-speed encoding
tty: fix termios input-speed encoding when using BOTHER
tty: support CIBAUD without BOTHER

 drivers/tty/tty_baudrate.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
Signature · 1 line
2.18.0