On Fri, Oct 05, 2018 at 10:35:54PM -0700, hpa@xxxxxxxxx wrote: > On October 5, 2018 4:56:29 PM PDT, Alan Cox <alan@llwyncelyn.cymru> wrote: > >On Fri, 5 Oct 2018 13:00:05 -0700 > >"H. Peter Anvin" <hpa@xxxxxxxxx> wrote: > > > >> On 10/5/18 6:34 AM, Johan Hovold wrote: > >> >> > >> >> Specifically, are there any platforms: > >> >> > >> >> 1. where simply stuffing values into c_ispeed or c_ospeed and > >setting BOTHER > >> >> can be used to set the baud rate, even for the "standard" baud > >rates > >> >> (obviously breaking if the kernel is too old -- how old is > >that?) > >> > > >> > This should work on all archs that define BOTHER and IBSHIFT (for > >input > >> > rates), and also to set standard rates (c_cflag would get updated > >to a > >> > Bfoo value). > >> > > >> > Alan added this (modulo some follow-up fixes) in edc6afc54968 > >("[PATCH] > >> > tty: switch to ktermios and new framework"). > >> > > >> > >> Would you happen to know if there are any architectures *other* than > >Alpha > >> which didn't support this by Linux 3.2 (the current glibc cutoff?) No, sorry. Some quick forensics didn't reveal any other at least. > >Alpha and Sparc were the only two oddities - because they used other > >people's existing APIs. > I just did massive cleanup with an axe, and close to -2000 lines of > code later, Nice. > four architectures are oddballs: sparc, alpha, powerpc, and mips. Of > those, alpha is the only one that still doesn't support BOTHER. > > Also, both alpha and powerpc, especially the latter, can overrun the > baud_table. Good catch. These would be the only archs with CBAUDEX defined as 0. And this is actually leaking too... Can we plug powerpc by reducing CBAUD to the expected five bits (037), while handling alpha by defining BOTHER as you suggested? This would need to be backported to stable. Johan