From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIM_ADSP_NXDOMAIN, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39116C636CA for ; Thu, 15 Jul 2021 21:16:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BD5661374 for ; Thu, 15 Jul 2021 21:16:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230343AbhGOVTM (ORCPT ); Thu, 15 Jul 2021 17:19:12 -0400 Received: from fgw20-7.mail.saunalahti.fi ([62.142.5.81]:65294 "EHLO fgw20-7.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbhGOVTL (ORCPT ); Thu, 15 Jul 2021 17:19:11 -0400 Received: from localhost (88-115-248-186.elisa-laajakaista.fi [88.115.248.186]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id e12a8b70-e5b1-11eb-ba24-005056bd6ce9; Fri, 16 Jul 2021 00:16:15 +0300 (EEST) Date: Fri, 16 Jul 2021 00:16:11 +0300 From: andy@surfacebook.localdomain To: "ashiduka@fujitsu.com" Cc: 'Geert Uytterhoeven' , "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" , "magnus.damm@gmail.com" , "torii.ken1@fujitsu.com" Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting Message-ID: References: <20200129161955.30562-1-erosca@de.adit-jv.com> <20200210205735.GB1347752@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mon, Mar 30, 2020 at 07:43:09AM +0000, ashiduka@fujitsu.com kirjoitti: > Dear Greg, Geert, > > > Right. > > Adding "#include " to Greg's sample code causes a > > compilation error. > > > Is it normal to declare ioctl() without "#include " ? > > 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? Side note: I hope introducing spd_cust hack hadn't made upstream. To the point. Use BOTHER as in code excerpt. Yes, there is a problematic parts with the headers regarding to this feature. But you may look how others solve it. https://github.com/npat-efault/picocom/blob/master/termios2.txt > > 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 instead. > > > > Right. > > Adding "#include " 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 " ? > > > > Thanks & Best Regards, > > Yuusuke Ashiduka > > Embedded System Development Dept. Embedded System Development Div. > > FUJITSU COMPUTER TECHNOLOGIES Ltd. > > > > > -----Original Message----- > > > From: Geert Uytterhoeven > > > Sent: Thursday, March 12, 2020 6:03 PM > > > To: Torii, Kenichi/鳥居 健一 > > > 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/ > > > 芦塚 雄介 ; 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 > > > 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 > > > wrote: > > > > > > > From: Torii Kenichi > > > > > > > > > > > > > > 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 > > > > > > > [erosca: rebase against v5.5] > > > > > > > Signed-off-by: Eugeniu Rosca > > > > > > > > > > > > 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 > > > > > > > > > >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 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 -- With Best Regards, Andy Shevchenko