Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp293799ybh; Thu, 12 Mar 2020 02:05:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvVo67Mf4SP9T1tC98lBkijsInoXZoIsSckvZi6edimbPAqZ9yUsAaJlSxKXzsJ8AwaWjc2 X-Received: by 2002:a05:6830:134e:: with SMTP id r14mr1208255otq.132.1584003946606; Thu, 12 Mar 2020 02:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584003946; cv=none; d=google.com; s=arc-20160816; b=HuQpGXJjTvWwDUYqw/h6G/FuFHVWiuSczBen6ri4VJKcNlS4q3lKSUi2mSoS2cbnIn SU9Z6WAvuXJbuH8sFkcF3yk4n8xw+SgkDolwvnqm091nt7/sX8wRELgOwP3zLWGTTHZP iY7+ooOJlzGOY19Boax64szP2y256KtToku8V07SSD/iFtThL5FdJFleqfWzRCd6ieKO RZF4pOCJpha1zUHIapi+i54e0XGOj6zxuPTxtADau5NAUo2UwFe8dR6TvUZibofFnu9o cNwWNOprYGEE7WZWYzNW05uW7wr7v5yBeXsqPSphi8gCjPpWxoWSxJcXQNynvzlXQFZb UFvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=pcqqOkF47Er9rA3HRF63y15rDeiBnLWeD7fktteNLOs=; b=p8AbKj42fFQ6XvvKJrZKjFGziMoiDV9PjEPaINppEk7O+Z9ZUVf/0EhZlMSHkoE+j0 7fZY13hpMvD6l8SBgbYoiPQdbcfAHzD0Ub0h9r5asRXhbhV5Q1tujaOamnwkdfXYaNY4 tHtOsuywfFcUae+0eM8ezzhMhz9Zbd1V4lKXcaD47iz2FXbGtC8ebZSz8UwnfqC7HivI 6sHT+MKqLIi1kDwjIviiTDqrrzspX+HxDHV29dDN6K29SGT3tctv3Iq1MA4gUgt6g27y iV2eGRG1mtyy9QjcVGVEQhqj5rNYjp5yl5HfQvo8bm+GcLJW8CfGh7i4O793C5LB8MAt l/Xw== 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 s8si2255184oij.275.2020.03.12.02.05.25; Thu, 12 Mar 2020 02:05:46 -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; 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 S1726646AbgCLJD0 (ORCPT + 99 others); Thu, 12 Mar 2020 05:03:26 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:40967 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725980AbgCLJD0 (ORCPT ); Thu, 12 Mar 2020 05:03:26 -0400 Received: by mail-ot1-f66.google.com with SMTP id s15so5304000otq.8; Thu, 12 Mar 2020 02:03:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pcqqOkF47Er9rA3HRF63y15rDeiBnLWeD7fktteNLOs=; b=kjHndIYH3dDb4ZAnrK7tnaOk44t/NSsm8rN/9dtFBzXPfHyZFfj7mqidpYUPIIGDaD 57S9aAlUDqOnf3iQG0fsfYlyMISoVktm8TsK1fZCODtxQAeA2idathLrHYlk3SHZaiUr TzhK6BkHLAtBhaAvdhCh1GcgKjftIUydGPwMyUQuw4UsLeVF0yOFnlQTkYExXloLrojH 72fhpmhUUeQMp9dNBRUQVaLM/lnMGvvehDL5qqFs73Rslwmf23ed3QRrueyKHp/F1h6X kct5Ricq+dDQ3NaNhtQsa4KPUACVICBf7gMQ7bO4PU/4GXiUUqof/6ZE4/OmufYqvn/T l08g== X-Gm-Message-State: ANhLgQ0Cnn7JmHgvDoBI8LhggaTZ134KStdmpI2rGaqLn4xcXi86crz/ ShAdcbB1CzPz8HcRuYoFuS6WqvlTO/zcl08BECc= X-Received: by 2002:a9d:1708:: with SMTP id i8mr5511068ota.250.1584003805625; Thu, 12 Mar 2020 02:03:25 -0700 (PDT) MIME-Version: 1.0 References: <20200129161955.30562-1-erosca@de.adit-jv.com> <20200210205735.GB1347752@kroah.com> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 12 Mar 2020 10:03:13 +0100 Message-ID: Subject: Re: [PATCH] serial: sh-sci: Support custom speed setting To: "torii.ken1@fujitsu.com" 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" , "ashiduka@fujitsu.com" , "magnus.damm@gmail.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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