[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUa0fUHZF03QCLsgvS8LSN_rGUQ1gPtotQ3uNGEHkCm6g@mail.gmail.com>
Date: Tue, 11 Feb 2020 09:15:02 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Eugeniu Rosca <erosca@...adit-jv.com>,
"open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Ulrich Hecht <uli+renesas@...nd.eu>,
"George G . Davis" <george_davis@...tor.com>,
Andrew Gabbasov <andrew_gabbasov@...tor.com>,
Jiada Wang <jiada_wang@...tor.com>,
Yuichi Kusakabe <yuichi.kusakabe@...so-ten.com>,
Yasushi Asano <yasano@...adit-jv.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jiri Slaby <jslaby@...e.com>,
Fukui Yohhei <yohhei.fukui@...so-ten.com>,
Torii Kenichi <torii.ken1@...fujitsu.com>,
Magnus Damm <magnus.damm@...il.com>,
"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>,
linux-man@...r.kernel.org
Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting
Hi Greg,
CC man
On Mon, Feb 10, 2020 at 9:57 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
> On Thu, Jan 30, 2020 at 01:32:50PM +0100, Geert Uytterhoeven wrote:
> > On Wed, Jan 29, 2020 at 5:20 PM Eugeniu Rosca <erosca@...adit-jv.com> wrote:
> > > From: Torii Kenichi <torii.ken1@...fujitsu.com>
> > >
> > > This patch is necessary to use BT module and XM module with DENSO TEN
> > > development board.
> > >
> > > This patch supports ASYNC_SPD_CUST flag by ioctl(TIOCSSERIAL), enables
> > > custom speed setting with setserial(1).
> > >
> > > The custom speed is calculated from uartclk and custom_divisor.
> > > If custom_divisor is zero, custom speed setting is invalid.
> > >
> > > Signed-off-by: Torii Kenichi <torii.ken1@...fujitsu.com>
> > > [erosca: rebase against v5.5]
> > > Signed-off-by: Eugeniu Rosca <erosca@...adit-jv.com>
> >
> > Thanks for your patch!
> >
> > While this seems to work fine[*], I have a few comments/questions:
> > 1. This feature seems to be deprecated:
> >
> > sh-sci e6e68000.serial: setserial sets custom speed on
> > ttySC1. This is deprecated.
> >
> > 2. As the wanted speed is specified as a divider, the resulting speed
> > may be off, cfr. the example for 57600 below.
> > Note that the SCIF device has multiple clock inputs, and can do
> > 57600 perfectly if the right crystal has been fitted.
> >
> > 3. What to do with "[PATCH/RFC] serial: sh-sci: Update uartclk based
> > on selected clock" (https://patchwork.kernel.org/patch/11103703/)?
> > Combined with this, things become pretty complicated and
> > unpredictable, as uartclk now always reflect the frequency of the
> > last used base clock, which was the optimal one for the previously
> > used speed....
> >
> > I think it would be easier if we just had an API to specify a raw speed.
> > Perhaps that already exists?
>
> Yes, see:
> http://www.panix.com/~grante/arbitrary-baud.c
Thanks a lot!!
This must be one of the most guarded secrets of serial port programming ;-)
Implemented since 2006, commit edc6afc5496875a6 ("[PATCH] tty: switch to
ktermios and new framework"), not documented in today's man-pages.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists