Received: by 2002:a17:90a:9307:0:0:0:0 with SMTP id p7csp5142418pjo; Tue, 11 Feb 2020 04:48:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxi2wgsj4mxMLBe/WNnwR9xGjEpYBrEzNKFui3Lz3rAZ8v/et3bOdYg5r0Cnxb5lbwaQGhq X-Received: by 2002:a05:6830:1d59:: with SMTP id p25mr5209767oth.308.1581425298259; Tue, 11 Feb 2020 04:48:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581425298; cv=none; d=google.com; s=arc-20160816; b=VA3iDMQA4s8aqxLSU81niDD7Lm8MlJV8Sd4sQrmxQM9wMrIXtr9J0fOC3h1hGY5HG+ oLX4BNaNraLYB6Zx4dXxzgS5y5OokXAM9D/s8QnBRr522vfAKqi2V/h4w0Wql1ke4mZ2 2FkTBMnQM3/l9M6kFkijlaydsFzjU20ZTa9u3OQNmRoYAqUv8p79be96v6npn23ZmIem yJ9pW7Cm+GVs9GUyKxwKFO5Ez3gn1h7L1PFhdR8dne/M0kNXc+QD0yl+4utDdIvwt76M uC3CvQW9tRurma0ybxL8eRfoQ7SQ2A3FG4S2CREKBGTL0TwM+kpZ21yIgt8wJxUgxo8i f2Dg== 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=eMu4tMuKSNBOnzHysJ5VgFZFn+qv4qHY43/6Wb+CvWw=; b=ie8NLw/PfINNKJ0/QeHUztNgMBWbl+8Ut6JUrEMyT34XM3sUC4B2WOvlGHT9futlmd pKc0oD75UuzLLydL+LsWpIqDEyb17Fww94VHddpBZHeQ4bk0eoDm8N0X9mCpaN/MeYAu N4E4HStNm/ooaQFStS5KXr1c5yJXj+iV5Vsy2MlzXYL+PtrCDeHCs2YM5B79RpJvVWul CmiA/0CUbvMWG0K7L++GyUk6GKbhBnt+02AtPagxBkyzuMlIchbg1P8pApfx3FOB6rlF JEmW6UoaHiAhXtG90JnW5NQcMHuFZrrKiNH9XDD+dNVMiKaAaMQiG5TuPK5+A4LRVqTW +3Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TyAGYzmB; 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 n9si1769273ota.103.2020.02.11.04.48.06; Tue, 11 Feb 2020 04:48:18 -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=TyAGYzmB; 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 S1728807AbgBKMaK (ORCPT + 99 others); Tue, 11 Feb 2020 07:30:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:51908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728467AbgBKMaK (ORCPT ); Tue, 11 Feb 2020 07:30:10 -0500 Received: from localhost (unknown [209.37.97.194]) (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 8CD5820714; Tue, 11 Feb 2020 12:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581424209; bh=UOl+tQ/zZd+KwI4FO4cTDXiLUcocDiU1LoF+UqO99S4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TyAGYzmBk647Xic8+Af5jY50tMRYt9H5bHtn6wsE10WXBTvj6piI1yGy8Z6MCj+ZS ansTqCI6m6WsvLaA3okd2k0EYZxvvCWq6Iq7nJE8mUUSf4uxk4FoLXexYzdDYJU1te 3efECLAoHJQaFnkycH7+U+jvYJPstPYkJ8I0fcYI= Date: Tue, 11 Feb 2020 04:30:09 -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 , "Michael Kerrisk (man-pages)" , linux-man@vger.kernel.org Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting Message-ID: <20200211123009.GB1858119@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 Tue, Feb 11, 2020 at 09:15:02AM +0100, Geert Uytterhoeven wrote: > Hi Greg, > > CC man > > On Mon, Feb 10, 2020 at 9:57 PM 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 > > Thanks a lot!! > This must be one of the most guarded secrets of serial port programming ;-) It really is, I have to look it up each time it comes up :( > Implemented since 2006, commit edc6afc5496875a6 ("[PATCH] tty: switch to > ktermios and new framework"), not documented in today's man-pages. yeah, serial port control really needs to be documented better, there's all sorts of nice ways of controlling them that people don't seem to know about. I used to have a link to a bunch of online examples, but can't seem to find that anymore either. Ugh, another thing for the long TODO file... greg k-h