Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp285590ybh; Thu, 12 Mar 2020 01:56:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtFKo5UZ22OfmPgQOmcRai7PCwuH4/fPlkLOdpbIqWJkxtVGHnPEnGmYQ/6SCU5qJbSGFUF X-Received: by 2002:aca:4fc7:: with SMTP id d190mr1805484oib.100.1584003394362; Thu, 12 Mar 2020 01:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584003394; cv=none; d=google.com; s=arc-20160816; b=ayYdqds/xgOOwidNh9psL9jfpQipI7yk+YghOP43Dt295f+YMv7oi5t6UUv3qt0SXs BO09HUXnrNJO2CB1n5ituWkQAhQVI6VmTkH/MdvGXHCMBcVbkgpPLm5k56+Hx/erveHt IoEkkJJo4auZ1q9p1KkSP7Yv2l5VFRxRAoAhyfkeoOVt3uAn+06gr2mAGDiGD6sam9EV 7ThyNr4tRx1k6oQiY3PvR2Yf4h0hPNpk5+7Srm5CZcKnbPs1I7zg2OW1aEUSNqp9Scep qsYOWV5E4o8tnJ56/Knyqe0Q1bPdGReRWKMc7cyyHxjnmAhTwNgb1eJEZEmG1eSC4wqS zKbg== 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 :dkim-signature; bh=x+a1+hx+l+V1Tb45LE8Czva9g6OkuCGIY7mAOR/k8oE=; b=SaDNCDYXjwglTNqVKGZ5c9kte+YB68mm/mXuhZEb0LhJKVPp5LkuyrOeWzMb9DN1Wy iSlf7NeuRv1AkKo7bjwDQtabPO7SPr8IETNNJ+RXQNtVXvK0LSeHmltzwYzYG6VRHqfb +dPXjoBqEO+oaexElXqMVUYuN6LIOtLt16XNW7S4H3CfZIndy0ce4xPBcVgkiRi9dK+f tdmDJmfowBllx3Pd9E5Vwn7zheMGqCVmUPvFQ7CkuMRqaSOi0sEZ6nAW7kHBs67RyhVC 6SzSDsey7/+e8V3YUS7rf0OQN+U2kfSXT2Gg1SfV9BXI6w8Pe9/qWBBi1uA7cjci2yK6 9Jgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gOBxrQZx; 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 h10si2236013oie.63.2020.03.12.01.56.21; Thu, 12 Mar 2020 01:56:34 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=gOBxrQZx; 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 S1726385AbgCLIzF (ORCPT + 99 others); Thu, 12 Mar 2020 04:55:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:37636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725980AbgCLIzE (ORCPT ); Thu, 12 Mar 2020 04:55:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AFD3D20578; Thu, 12 Mar 2020 08:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584003302; bh=z8tXGg7p43hiOHRBmKu5GF7cO2YBA7ZhkgmPMBmqgPk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gOBxrQZxh2mD/SGoHfWSESAS9YFiZPhbQ0h1P8n7W3s7SWueI7qse9R9x7BSifXJf 4Uz36/r2WEGCXc9JM7Z066xHHYzTbE6Yp3yyTozzFwmgUh0RcJ/+4puma9vfR37/V3 CULiJLqoJQOTjMYJzkvC9Fbb5s+/5sOaqcbod0fo= Date: Thu, 12 Mar 2020 09:55:00 +0100 From: "gregkh@linuxfoundation.org" To: "torii.ken1@fujitsu.com" Cc: "geert@linux-m68k.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" , "ashiduka@fujitsu.com" , "magnus.damm@gmail.com" Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting Message-ID: <20200312085500.GA149342@kroah.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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2020 at 05:10:05AM +0000, torii.ken1@fujitsu.com wrote: > Dear Greg, > > 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: > > > 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 > > I saw the code above, I thought I wouldn't write such code normally. Why not? > >#include > > > >int ioctl(int d, int request, ...); > > Do application programmers have to accept this bad code? I do not understand what you are asking here. greg k-h