linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH stable v2 0/2] termios: Alpha BOTHER/IBSHIFT, tty_baudrate fix
@ 2018-10-08  4:06 H. Peter Anvin
  2018-10-08  4:06 ` [PATCH stable v2 1/2] arch/alpha, termios: implement BOTHER, IBSHIFT and termios2 H. Peter Anvin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: H. Peter Anvin @ 2018-10-08  4:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tobias Klausmann, H. Peter Anvin (Intel), Greg Kroah-Hartman,
	Jiri Slaby, Al Viro, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Thomas Gleixner, Kate Stewart, Philippe Ombredanne,
	Eugene Syromiatnikov, linux-alpha, linux-serial, Johan Hovold,
	Alan Cox, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, stable

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

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(-)

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Eugene Syromiatnikov <esyr@redhat.com>
Cc: <linux-alpha@vger.kernel.org>
Cc: <linux-serial@vger.kernel.org>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: <stable@vger.kernel.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-10-08 17:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-08  4:06 [PATCH stable v2 0/2] termios: Alpha BOTHER/IBSHIFT, tty_baudrate fix H. Peter Anvin
2018-10-08  4:06 ` [PATCH stable v2 1/2] arch/alpha, termios: implement BOTHER, IBSHIFT and termios2 H. Peter Anvin
2018-10-08 15:38   ` Johan Hovold
2018-10-08 16:01     ` H. Peter Anvin
2018-10-08  4:06 ` [PATCH stable v2 2/2] termios, tty/tty_baudrate.c: simplify, auto-generate baud table H. Peter Anvin
2018-10-08 15:46   ` Johan Hovold
2018-10-08 17:29     ` H. Peter Anvin
2018-10-08 15:34 ` [PATCH stable v2 0/2] termios: Alpha BOTHER/IBSHIFT, tty_baudrate fix Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).