Skip to content

termios: Alpha BOTHER/IBSHIFT, tty_baudrate fix

H. Peter Anvin linux-alpha linux-serial lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v12 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arch/alpha, termios: implement BOTHER, IBSHIFT and termios2arch/alpha/include/asm/termios.h arch/alpha/include/uapi/asm/ioctls.h arch/alpha/include/uapi/asm/termbits.h+29 -12 replies
2/2termios, tty/tty_baudrate.c: simplify, auto-generate baud tabledrivers/tty/.gitignore drivers/tty/Makefile drivers/tty/bmacros.c +1 more+85 -1162 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchCc: Johan Hovold
1/2
2/2Requested-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH stable v2 0/2] termios: Alpha BOTHER/IBSHIFT, tty_baudrate fix

From: "H. Peter Anvin (Intel)" <[email protected]>

It turns out that Alpha is the only architecture that never implemented BOTHER and IBSHIFT, which is otherwise ages old. This is one thing that has held up glibc support for this feature (all other architectures have supported these for about a decade, at least before the current 3.2 glibc cutoff.)

Furthermore, in the process of dealing with this, I discovered that the current code in tty_baudrate.c can read past the end of the baud_table[] on Alpha and PowerPC. The second patch in this series fixes that, but it also cleans up the code substantially by auto-generating the table and, since all architectures now have them, removing all conditionals for BOTHER and IBSHIFT existing.

Tagging for stable because these are concrete and immediate problems. I have a much bigger update in process, nearly done, which will clean up a lot of duplicated code and make the uapi headers usable for libc, but that is not critical on the same level.

Tested on x86, compile-tested on Alpha. SPARC, and PowerPC.

v2: the CBAUDEX masking-as-fallback code was wrong, but it could never
be exercised on any architecture anyway (gcc would not even emit it) so just remove it. There are thus no object code changes from v1.

---
 arch/alpha/include/asm/termios.h       |   8 +-
 arch/alpha/include/uapi/asm/ioctls.h   |   5 +
 arch/alpha/include/uapi/asm/termbits.h |  17 +++
 drivers/tty/.gitignore                 |   1 +
 drivers/tty/Makefile                   |  16 +++
 drivers/tty/bmacros.c                  |   2 +
 drivers/tty/tty_baudrate.c             | 182 ++++++++++++---------------------
 7 files changed, 114 insertions(+), 117 deletions(-)
Cc Greg Kroah-Hartman <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Al Viro <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc Matt Turner <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Kate Stewart <[email protected]>
Cc Philippe Ombredanne <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Eugene Syromiatnikov <[email protected]>
Cc Johan Hovold <[email protected]>
Cc Alan Cox <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>