From: "ashiduka@fujitsu.com" <ashiduka@fujitsu.com>
To: 'Geert Uytterhoeven' <geert@linux-m68k.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "erosca@de.adit-jv.com" <erosca@de.adit-jv.com>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>,
"wsa+renesas@sang-engineering.com"
<wsa+renesas@sang-engineering.com>,
"yoshihiro.shimoda.uh@renesas.com"
<yoshihiro.shimoda.uh@renesas.com>,
"uli+renesas@fpond.eu" <uli+renesas@fpond.eu>,
"george_davis@mentor.com" <george_davis@mentor.com>,
"andrew_gabbasov@mentor.com" <andrew_gabbasov@mentor.com>,
"jiada_wang@mentor.com" <jiada_wang@mentor.com>,
"yuichi.kusakabe@denso-ten.com" <yuichi.kusakabe@denso-ten.com>,
"yasano@jp.adit-jv.com" <yasano@jp.adit-jv.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"jslaby@suse.com" <jslaby@suse.com>,
"yohhei.fukui@denso-ten.com" <yohhei.fukui@denso-ten.com>,
"magnus.damm@gmail.com" <magnus.damm@gmail.com>,
"torii.ken1@fujitsu.com" <torii.ken1@fujitsu.com>
Subject: RE: [PATCH] serial: sh-sci: Support custom speed setting
Date: Mon, 30 Mar 2020 07:43:09 +0000 [thread overview]
Message-ID: <OSBPR01MB506141BA2FDD08FE11FC4DEBDFCB0@OSBPR01MB5061.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <OSBPR01MB50612C6EF774733B3496AECADFFD0@OSBPR01MB5061.jpnprd01.prod.outlook.com>
Dear Greg, Geert,
> Right.
> Adding "#include <sys/ioctl.h>" to Greg's sample code causes a
> compilation error.
<snip>
> Is it normal to declare ioctl() without "#include <sys/ioctl.h>" ?
I would be happy if you could give me some comments.
> http://www.panix.com/~grante/arbitrary-baud.c
We think this sample code is no good.
Should I work on glibc changes instead of kernel fixes?
Thanks & Best Regards,
Yuusuke Ashiduka <ashiduka@fujitsu.com>
Embedded System Development Dept. Embedded System Development Div.
FUJITSU COMPUTER TECHNOLOGIES Ltd.
> -----Original Message-----
> From: Ashizuka, Yuusuke/芦塚 雄介 <ashiduka@fujitsu.com>
> Sent: Thursday, March 12, 2020 6:44 PM
> To: 'Geert Uytterhoeven' <geert@linux-m68k.org>;
> gregkh@linuxfoundation.org
> Cc: erosca@de.adit-jv.com; linux-serial@vger.kernel.org;
> linux-renesas-soc@vger.kernel.org;
> wsa+renesas@sang-engineering.com;
> yoshihiro.shimoda.uh@renesas.com; uli+renesas@fpond.eu;
> george_davis@mentor.com; andrew_gabbasov@mentor.com;
> jiada_wang@mentor.com; yuichi.kusakabe@denso-ten.com;
> yasano@jp.adit-jv.com; linux-kernel@vger.kernel.org;
> jslaby@suse.com; yohhei.fukui@denso-ten.com;
> magnus.damm@gmail.com; Torii, Kenichi/鳥居 健一
> <torii.ken1@fujitsu.com>
> Subject: RE: [PATCH] serial: sh-sci: Support custom speed setting
>
> Dear Greg, Geert,
>
> > I guess you mean the forward declaration of ioctrl()?
> > No, they should include <sys/ioctl.h> instead.
>
> Right.
> Adding "#include <sys/ioctl.h>" to Greg's sample code causes a
> compilation error.
>
> > > I saw the code above, I thought I wouldn't write such code
> normally.
> > Why not?
>
> Is it normal to declare ioctl() without "#include <sys/ioctl.h>" ?
>
> Thanks & Best Regards,
> Yuusuke Ashiduka <ashiduka@fujitsu.com>
> Embedded System Development Dept. Embedded System Development Div.
> FUJITSU COMPUTER TECHNOLOGIES Ltd.
>
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > Sent: Thursday, March 12, 2020 6:03 PM
> > To: Torii, Kenichi/鳥居 健一 <torii.ken1@fujitsu.com>
> > Cc: gregkh@linuxfoundation.org; erosca@de.adit-jv.com;
> > linux-serial@vger.kernel.org;
> linux-renesas-soc@vger.kernel.org;
> > wsa+renesas@sang-engineering.com;
> > yoshihiro.shimoda.uh@renesas.com; uli+renesas@fpond.eu;
> > george_davis@mentor.com; andrew_gabbasov@mentor.com;
> > jiada_wang@mentor.com; yuichi.kusakabe@denso-ten.com;
> > yasano@jp.adit-jv.com; linux-kernel@vger.kernel.org;
> > jslaby@suse.com; yohhei.fukui@denso-ten.com; Ashizuka, Yuusuke/
> > 芦塚 雄介 <ashiduka@fujitsu.com>; magnus.damm@gmail.com
> > Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting
> >
> > Hi Torii-san,
> >
> > On Thu, Mar 12, 2020 at 6:10 AM torii.ken1@fujitsu.com
> > <torii.ken1@fujitsu.com> wrote:
> > > On Tue, 11 Feb 2020 05:57:35 +0900,
> > > Greg Kroah-Hartman 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
> > >
> > > I saw the code above, I thought I wouldn't write such code
> normally.
> > >
> > > >#include <linux/termios.h>
> > > >
> > > >int ioctl(int d, int request, ...);
> > >
> > > Do application programmers have to accept this bad code?
> >
> > I guess you mean the forward declaration of ioctrl()?
> > No, they should include <sys/ioctl.h> instead.
> >
> > Gr{oetje,eeting}s,
> >
> > Geert
> >
> > --
> > Geert Uytterhoeven -- There's lots of Linux beyond ia32 --
> > geert@linux-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
next prev parent reply other threads:[~2020-03-30 7:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 16:19 [PATCH] serial: sh-sci: Support custom speed setting Eugeniu Rosca
2020-01-30 12:32 ` Geert Uytterhoeven
2020-02-10 20:57 ` Greg Kroah-Hartman
2020-02-10 21:44 ` Eugeniu Rosca
2020-02-11 8:15 ` Geert Uytterhoeven
2020-02-11 12:30 ` Greg Kroah-Hartman
2020-03-12 5:10 ` torii.ken1
2020-03-12 8:55 ` gregkh
2020-03-12 9:03 ` Geert Uytterhoeven
2020-03-12 9:44 ` ashiduka
2020-03-30 7:43 ` ashiduka [this message]
2021-07-15 21:16 ` andy
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=OSBPR01MB506141BA2FDD08FE11FC4DEBDFCB0@OSBPR01MB5061.jpnprd01.prod.outlook.com \
--to=ashiduka@fujitsu.com \
--cc=andrew_gabbasov@mentor.com \
--cc=erosca@de.adit-jv.com \
--cc=geert@linux-m68k.org \
--cc=george_davis@mentor.com \
--cc=gregkh@linuxfoundation.org \
--cc=jiada_wang@mentor.com \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=torii.ken1@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).