linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Eugeniu Rosca <erosca@de.adit-jv.com>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Ulrich Hecht <uli+renesas@fpond.eu>,
	"George G . Davis" <george_davis@mentor.com>,
	Andrew Gabbasov <andrew_gabbasov@mentor.com>,
	Jiada Wang <jiada_wang@mentor.com>,
	Yuichi Kusakabe <yuichi.kusakabe@denso-ten.com>,
	Yasushi Asano <yasano@jp.adit-jv.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jiri Slaby <jslaby@suse.com>,
	Fukui Yohhei <yohhei.fukui@denso-ten.com>,
	Torii Kenichi <torii.ken1@jp.fujitsu.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	linux-man@vger.kernel.org
Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting
Date: Tue, 11 Feb 2020 04:30:09 -0800	[thread overview]
Message-ID: <20200211123009.GB1858119@kroah.com> (raw)
In-Reply-To: <CAMuHMdUa0fUHZF03QCLsgvS8LSN_rGUQ1gPtotQ3uNGEHkCm6g@mail.gmail.com>

On Tue, Feb 11, 2020 at 09:15:02AM +0100, Geert Uytterhoeven wrote:
> Hi Greg,
> 
> CC man
> 
> On Mon, Feb 10, 2020 at 9:57 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.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@de.adit-jv.com> wrote:
> > > > From: Torii Kenichi <torii.ken1@jp.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@jp.fujitsu.com>
> > > > [erosca: rebase against v5.5]
> > > > Signed-off-by: Eugeniu Rosca <erosca@de.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 ;-)

It really is, I have to look it up each time it comes up :(

> Implemented since 2006, commit edc6afc5496875a6 ("[PATCH] tty: switch to
> ktermios and new framework"), not documented in today's man-pages.

yeah, serial port control really needs to be documented better, there's
all sorts of nice ways of controlling them that people don't seem to
know about.  I used to have a link to a bunch of online examples, but
can't seem to find that anymore either.  Ugh, another thing for the long
TODO file...

greg k-h

      reply	other threads:[~2020-02-11 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200129161955.30562-1-erosca@de.adit-jv.com>
     [not found] ` <CAMuHMdWV0kkKq6sKOHsdz+FFGNHphzq_q7rvmYAL=U4fH2H3wQ@mail.gmail.com>
     [not found]   ` <20200210205735.GB1347752@kroah.com>
2020-02-11  8:15     ` [PATCH] serial: sh-sci: Support custom speed setting Geert Uytterhoeven
2020-02-11 12:30       ` Greg Kroah-Hartman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200211123009.GB1858119@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andrew_gabbasov@mentor.com \
    --cc=erosca@de.adit-jv.com \
    --cc=geert@linux-m68k.org \
    --cc=george_davis@mentor.com \
    --cc=jiada_wang@mentor.com \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mtk.manpages@gmail.com \
    --cc=torii.ken1@jp.fujitsu.com \
    --cc=uli+renesas@fpond.eu \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yasano@jp.adit-jv.com \
    --cc=yohhei.fukui@denso-ten.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    --cc=yuichi.kusakabe@denso-ten.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).