Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4129629ybv; Mon, 10 Feb 2020 12:59:37 -0800 (PST) X-Google-Smtp-Source: APXvYqx3ndUTzgNqyLmoLtHLVUjiwjEd+yfemGP5YxN4egpRi9L/tchd/XI4P+hKvc7CJxFgTvRO X-Received: by 2002:aca:534f:: with SMTP id h76mr663911oib.23.1581368377744; Mon, 10 Feb 2020 12:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581368377; cv=none; d=google.com; s=arc-20160816; b=THmhh/CTJX3U+dfKOvZWmX73xgt2LTPQCMsFMzmW6p/x5Pdb+lFklnY/BrVc+wW4Lz hwSVUriWVJn1x114zJklTfTb7xuRCDADb5TuKs8SHTehlApxd/UFpgvhUInTjBINgrnP Fzk35KYTqd+DgBvRMNqqVyjKt2DsCX42oNckm/u415V8l3+yCEcl7QtKaxBsMd6S6cRI iD99Ic0/no6XOsq6sJedGgZQR67B7NnwT8ZObjPK628hPnZo409S2QDUtcaEKp6WDyMu EQx7on56kt7xDhiE6s8ylOlgemsrEVMhpzZoZwuDeb0YHFQIWo6RpShq5smz7o8I23RV bPww== 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=lYOSSgcDAg1JzC/vYLv0j8SjF/jeDX9OoM44s2y4Efo=; b=tUdX3SnwQyir2dp5NfBHl3mhBN2QcDKJ/nAc5D1tdkq0Rx5iq32pavR4wJpC+u2rbB zdDIpbuFsmT8yVUpezH2y6Ud9bsbCSOlDeM8iYcq62HTF70eGHV1yoo4yy9auyKLrCse I4W/hSOVaA1Q2OH4TVdEiGF+qwwyQ8ZwxaHsu13r7WDZLf5PSr0ylU5btWhTRiZmE4oL FTD4mMIT7uus7+C+SRjOP9nnJbHY6GlAKVNWF+v4Mhl/3m3B4hxA7w1Hj2RiYUUfWnHJ kZVV/NOUeFFn+rQxd/eub0R1xNvGHIy+vIfdReAZytFZJANzK3JT/MnBRnNwi624RYJD CIwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q+K0NWEc; 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 o15si754941otp.314.2020.02.10.12.59.25; Mon, 10 Feb 2020 12:59:37 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Q+K0NWEc; 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 S1727484AbgBJU5h (ORCPT + 99 others); Mon, 10 Feb 2020 15:57:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:45344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgBJU5h (ORCPT ); Mon, 10 Feb 2020 15:57:37 -0500 Received: from localhost (unknown [104.132.1.111]) (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 5876F20715; Mon, 10 Feb 2020 20:57:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581368256; bh=8EBwQnnayyWkzJqyeB1opWjOW6s4LsL74lZDs1gbMSk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q+K0NWEc4WuLeQcS12L0g8smg3uR2/TjI/YFp1Goe4vKDAJgrAzjLT/h3XcCvlZnH mbcYT3lfOd/3IEsiQEAh6LfffzHPnpV1q7PKrsbILzrceiMjbxZP3jKZ7sdufCi6T2 mJVPiefKlgOQfMtx7phL4DPLoUxUwZy6OvoIL7Mw= Date: Mon, 10 Feb 2020 12:57:35 -0800 From: Greg Kroah-Hartman To: Geert Uytterhoeven Cc: Eugeniu Rosca , "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 Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting Message-ID: <20200210205735.GB1347752@kroah.com> References: <20200129161955.30562-1-erosca@de.adit-jv.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, 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