Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4166608ybv; Mon, 10 Feb 2020 13:45:44 -0800 (PST) X-Google-Smtp-Source: APXvYqxw19rVMLMDn2NSR2ISze8d8kmFb4OvUAZLVsb/t6NJN6QI1Z884OP+uEBOEXooi05GAIoH X-Received: by 2002:a05:6808:4c7:: with SMTP id a7mr788296oie.83.1581371144355; Mon, 10 Feb 2020 13:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581371144; cv=none; d=google.com; s=arc-20160816; b=nqZqnRvu8dRtz3RpGn30lZPPFu5uZK80cbJng7M9ACuYRnLXizYk+lqGxgyATOEpRm BTzcUIIWxGaR5HXdrUcvykdcozyxmM8x0xbDHN5OWtbLVFCQZiMln4PGWJ75U8a192D/ Vb+UY9EwtKP6IMVebEdlB7Snrf3ileaJRgwG2Qb6+u94MuUA052na0eCmXrLtJmaCkF2 uM0Rgsy69wD8Y5/P2sSYbXT399plZjHgiKURwm0qbjvcQGicjFuzNYDWG3kSq0eV9Q4l iZl2iK8Yftd1k1e0X8km6uHnLzMfxyeNoNIvtWDjohVBUmv4AnrZrUz57jtrBC2l3j5+ qYLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=yY4ykJmIUY7u5HW6IbsyyXHsui7SKFf9KkHM7edU4Lc=; b=sq9n1mK8Fk7GG/NWt6XHNqlMbt+/2/+FuxQYYdMQmY2rBPTN9LIsdBI7ID4/0ELSbi 0Ylx+OmVo+BDJNuZWHG9r90u6nkj1uJDZSVzjntlmUHfqLsjZvtxVdjn6xDyKO0Jl0SS wWPoMrlq2QOWl2XPhkH4l04MTI6cDoj4I0TX44ZVrp0zyDire7M4uxWAH8yh/usj84e+ iKWZr+BdSMN2gfR+xAM9fh1yYS8w3cELuiXBu1GrGYxdeaLzEJFPpFpOuJm8l4BUMcAL FqFv5S0k1gQefFOKhzuGZeWFFG9eoLPGhmYPUBQ6T5aSST2584iaoTNSfXEPkUIrM1jo YCUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si711888oii.60.2020.02.10.13.45.32; Mon, 10 Feb 2020 13:45:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727569AbgBJVpH (ORCPT + 99 others); Mon, 10 Feb 2020 16:45:07 -0500 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:38312 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgBJVpH (ORCPT ); Mon, 10 Feb 2020 16:45:07 -0500 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id 133413C057F; Mon, 10 Feb 2020 22:45:03 +0100 (CET) Received: from smtp1.de.adit-jv.com ([127.0.0.1]) by localhost (smtp1.de.adit-jv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QURNWDN5PY02; Mon, 10 Feb 2020 22:44:54 +0100 (CET) Received: from HI2EXCH01.adit-jv.com (hi2exch01.adit-jv.com [10.72.92.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id D36383C0012; Mon, 10 Feb 2020 22:44:54 +0100 (CET) Received: from lxhi-065.adit-jv.com (10.72.93.66) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.468.0; Mon, 10 Feb 2020 22:44:54 +0100 Date: Mon, 10 Feb 2020 22:44:51 +0100 From: Eugeniu Rosca To: Greg Kroah-Hartman , Geert Uytterhoeven CC: "open list:SERIAL DRIVERS" , Linux-Renesas , Wolfram Sang , Yoshihiro Shimoda , Ulrich Hecht , "George G . Davis" , Andrew Gabbasov , Jiada Wang , Yuichi Kusakabe , Yasushi Asano , Linux Kernel Mailing List , Jiri Slaby , Fukui Yohhei , Torii Kenichi , Magnus Damm , Eugeniu Rosca , Eugeniu Rosca Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting Message-ID: <20200210214451.GA6104@lxhi-065.adit-jv.com> References: <20200129161955.30562-1-erosca@de.adit-jv.com> <20200210205735.GB1347752@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200210205735.GB1347752@kroah.com> X-Originating-IP: [10.72.93.66] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Geert and Greg, On Mon, Feb 10, 2020 at 12:57:35PM -0800, Greg Kroah-Hartman wrote: > On Thu, Jan 30, 2020 at 01:32:50PM +0100, Geert Uytterhoeven wrote: > > Hi Eugeniu, > > > > 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 This looks like a compelling piece of evidence users should stay away from implementing and using the kludge (38400 baud) mechanism? Unless the author and the users of this patch (CC-ed in this thread) have a different opinion, I consider this topic closed. Thanks! -- Best Regards Eugeniu Rosca