Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp800358imu; Wed, 23 Jan 2019 06:00:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN6DzF7L7FUO3w050Y5vEp+z+vwkQC2DEQJRGuGj0CyaR2/zcUqWl/PSQAt3CrwJ1sQMX5o9 X-Received: by 2002:a63:f006:: with SMTP id k6mr2030926pgh.259.1548252053844; Wed, 23 Jan 2019 06:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548252053; cv=none; d=google.com; s=arc-20160816; b=m0pVAVm2sJcjo6YQ5zm+4r7jGd2OtjgkggQ2sqOKAy3NByzN3SnnlhzbGlLTIxB4w+ 7S7HGDrONHcWwuvLga457ngpNDRs5EDQ/9KN1ZTiEEUrjVTUOO8W572qHgqOzEffp54a F6QhNZCTx8bNu3nBhZXbMGwn8BRgiVAC/+niDziDp5xgv7gwOAtzUjtQwgiKWJVkQCIq l1a/E2Y4Dz8zNToVyCqoAhO0mku909KJSLF39zDZ1JArVQII7FQSAGYrl8rVDN8J+mRW oqxOk6lne3bb/jqAtJCNchtV0Q41vJ9yx+gNTiMOIss8SMqj0eLfvqioDQzras6xN2E+ W/jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=n6m1+rQA66Um1V6S73QdowUToUwFk5bfYVrsnWnQvV8=; b=W4KOuW+F4pBMex8Vx1ESixxidBEB2IycWOiKooTSRVIln8+NXwlWJ/CooOU56BXMJ0 uOefxqsrEJsfVXzXQEt5wcIpfQ+3bmi5u1MXf1xB1sDVpU6vfztR+mEstVPlPJpASFn2 X/2QYjOEfkdjywOjHAR6te3Z1XZ1clGOzGkzf2JEgHTJbxI10oNmYnhOIssHQO/8ZBhM Ssn53r2JhKZ4hzZOeFaIMdJsREYlAYb2JKG0CyQMhWlsHSpc5oHmdjF07FEBecf1Q++O i4fk6q4/mh1n2Qi/rY22d6x06s0oZTNgkjFYb5ufT0psDwahg65JGPtZCmR19twEZVNW CHgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A+LqxXTM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si18805017plt.406.2019.01.23.06.00.37; Wed, 23 Jan 2019 06:00:53 -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=A+LqxXTM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbfAWN6e (ORCPT + 99 others); Wed, 23 Jan 2019 08:58:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:36288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbfAWN6d (ORCPT ); Wed, 23 Jan 2019 08:58:33 -0500 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 A04552133D; Wed, 23 Jan 2019 13:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548251912; bh=YaoOwzPhlusepuKK6nNhPrPhHcQyK6Hho8Tqvya0vzE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A+LqxXTMBPOIncX0VazN8sQ3MTgWZs1PtPTuRPZfimeT2HvI5M7N5B4/eh+bKnNYl aUwIlieYt8z/bY1Nc1Q4sfAhK2+BVrBHntTbQtQCCiFDCTgczm9ENDefhqGCgqhJoD Q4mHsNnTQmn5yy9ZBu9q3AVWFTdYjnsStyuTlx6w= Date: Wed, 23 Jan 2019 08:58:31 -0500 From: Sasha Levin To: Johan Hovold Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Nikolaj Fogh , linux-usb@vger.kernel.org Subject: Re: [PATCH AUTOSEL 4.20 025/117] USB: serial: ftdi_sio: use rounding when calculating baud rate divisors Message-ID: <20190123135831.GI202535@sasha-vm> References: <20190108192628.121270-1-sashal@kernel.org> <20190108192628.121270-25-sashal@kernel.org> <20190109082437.GA3389@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190109082437.GA3389@localhost> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 09, 2019 at 09:24:37AM +0100, Johan Hovold wrote: >On Tue, Jan 08, 2019 at 02:24:53PM -0500, Sasha Levin wrote: >> From: Nikolaj Fogh >> >> [ Upstream commit 6abd837104a3a8e1cda64fc4d7675f6c3ece9d8b ] >> >> Improve baud-rate generation by using rounding-to-closest instead of >> truncation in divisor calculation. >> >> Results have been verified by logic analyzer on an FT232RT (232BM) chip. >> The following table shows the wanted baud rate, the baud rate obtained >> with the old method (truncation), with the new method (rounding) and the >> baud rate generated by the windows 10 driver. The numbers in parentheses >> is the error. >> >> +- Wanted --+------ Old -------+------ New -------+------ Win -------+ >> | ? 9600? | ? 9600 (0.00%)? |?? 9604 (0.05%)? |?? 9605 (0.05%)? | >> | ? 19200 ? | ? 19200 (0.00%)? |?? 19199 (0.01%)? |?? 19198 (0.01%)? | >> | ? 38400 ? | ? 38395 (0.01%)? |?? 38431 (0.08%)? |?? 38394 (0.02%)? | >> | ? 57600 ? | ? 57725 (0.22%)? |?? 57540 (0.10%)? |?? 57673 (0.13%)? | >> |? 115200 ? |? 115307 (0.09%)? |? 115330 (0.11%)? |? 115320 (0.10%)? | >> |? 921600 ? |? 919963 (0.18%)? |? 920386 (0.13%)? |? 920810 (0.09%)? | >> |? 961200 ? |? 996512 (3.67%)? |? 956480 (0.49%)? |? 956937 (0.44%)? | >> +-----------+------------------+------------------+------------------+ >> >> The error due to noise in the measurements is in the order of a few >> tenths of a %. As can be seen, the baud rate is significantly improved >> for some rates (e.g. 961200), and corresponds to the output given by the >> windows driver. >> >> The theoretical baud rate has been calculated for all baud rates from 1 >> to 3M, and as expected, the error is centered around 0, with a triangle >> shape instead of a sawtooth, so the maximum error is decreased to half. >> >> Signed-off-by: Nikolaj Fogh >> [ johan: edit commit message slightly ] >> Signed-off-by: Johan Hovold >> Signed-off-by: Sasha Levin > >The stable tag was left out on purpose for this one to avoid breaking >working setups which may have compensated and adapted to this driver >behaviour which has been there since the driver was merged ages ago. I'll drop it, thank you. -- Thanks, Sasha