Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp716505pxv; Thu, 15 Jul 2021 14:17:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2t2/S8AIPpZOH7bkGmC1VHps/k2rPASSTW5suV0jubCvfmwOHfcc1GUpK9F+JODpt+Kwb X-Received: by 2002:a17:906:d9d1:: with SMTP id qk17mr3145614ejb.154.1626383866817; Thu, 15 Jul 2021 14:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383866; cv=none; d=google.com; s=arc-20160816; b=LEq/aD7uEs4X4tYGkE3BchjIm9pqawE9OOyJwg/e3jnG9ASjRLYit1CFm9bv5FLWh9 yyGqIwEBXJWAjawOynwj8pZmSXiZ9+yBIBykRP3mlFh//QnrDVXziukqNAkhQ2gdg/18 VbnYAmHtbP55OapdluTAD7S4Ry5WPR3RNwNxprT6YADajgD6+sSssDY98Iq+iL6qsjUw uTVUBCbwf7A04gNShPY8eXkN6r1JG/rrHQ5w8ROH21XdIsgqU+GjDFUsuLdSdcqdYw54 HsqO46i/G3I7vC4UerasNcl/KdvFG5o/6xvL+BRKkzY6WW1I7iKR3Ui40Pyg7whBBMoS 99Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Nd+4AgCBZ07FEqcrsuravVJbi33zktIiEOYZGsZapks=; b=LI0vprUXPw9UiVEt8iYdE2g/25J4Mcgq/NJZ7gRTaSccaLL0U1U/wn6jZLucq6bGXH +hGrDc+dowvf6PzGoMZnoLQa92NC02a4eFcIUeZW4q4uxL5ol4NW344ep9evbFPdSdOF pHumA+Mwm9h1yPnlt/LvG/IQBD51naQDgg7dL3BWyOTkfvSDmOmP/54cEcra6cmTqj+0 ye+dwthz93eQfP8QcOIYABc1oh0sK6zEzCwel0xNpaidYWwJ74Sycs9kw892dcVOVXdi LNS9wuxRsR0CwZrkYiqtchnX1Kj9kPxrcbc8HX1ZIPa2rhUDUfWuXl5OIV+4PPLyxtUu AuvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp26si7531645ejc.565.2021.07.15.14.17.21; Thu, 15 Jul 2021 14:17:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbhGOVTM (ORCPT + 99 others); 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