Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp464198imu; Wed, 9 Jan 2019 00:26:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN4GAw8gvPACZhCu5hH/rKdcQfWpB8M8pKoasNCF4mlZJYFyaEu4VSfGuzYwAEjTx+j+lhn0 X-Received: by 2002:a65:6684:: with SMTP id b4mr4562164pgw.55.1547022384113; Wed, 09 Jan 2019 00:26:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547022384; cv=none; d=google.com; s=arc-20160816; b=BBtpwpYQ6ETRHESO174yWDvL3wcAIta8OzXAwWjxWN+Dn2QBND+/cQN1vkomXHZapP sEDuYqBCQaBgO/rXYgYfZ3WfYboHygJ2OJpvvlpkSA+fvXDZ/4Vcon6Eqh9nXw5S3Kuw r/LaEjdVEi0OOFbBdSzmOvEkCMqCriaoUCZXo1y0yKDgsg/CJJov7DclghNbawCKVSQE 9y1gM1qsRPVvw/73hyz9FA9mkBtb6Yg5yFMn7atOkbfftvueAkO8qUd14zUzTJwNXQm6 I4uPGmUXqsRc/ZMjS+/RpjNefBz2Jqx3ohyPzpECrpV2YeARTVNd4W2tmNjpc9v/0Qxs eHnQ== 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=vLanaI8a99gMLIUKf8jOB4ad4EZ0sLCvedts9QvaNnE=; b=cngdyVVf+4aSxdp3bvddLFBSfP/+Rqx+yo0/vVw9/eIb9a3K4ruzbC02g60uHq3vVe i3DE+pomOJZrkOa/wAhd+ubZ/xPXipnbPirujv085+oGQE4uK8Gp47V59+kg7xkxhrR1 39+4vgdAZxgGfie+T8Q5kjWrIfpP4sbPcmH6nKrR5kgboafQKgGk9mAUQyDOJyAer8Bo QIkUxt4Wy9nrzn3IlZRwOUePmlGP1+hODm+htl6s7sccmMpPf+wopGnLcuJBIwrH7VDO bIXe2JpKTCFzga1p7sU7aX1mPFqXihWOc7MoIedQvQ12Svi0vLijZFMLWeC4i6+cn5vD IevA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YJPn2TZb; 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=fail (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 t184si21592269pfb.22.2019.01.09.00.26.08; Wed, 09 Jan 2019 00:26:24 -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=fail header.i=@gmail.com header.s=20161025 header.b=YJPn2TZb; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729572AbfAIIYi (ORCPT + 99 others); Wed, 9 Jan 2019 03:24:38 -0500 Received: from mail-lf1-f46.google.com ([209.85.167.46]:34827 "EHLO mail-lf1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbfAIIYh (ORCPT ); Wed, 9 Jan 2019 03:24:37 -0500 Received: by mail-lf1-f46.google.com with SMTP id e26so4982595lfc.2; Wed, 09 Jan 2019 00:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=vLanaI8a99gMLIUKf8jOB4ad4EZ0sLCvedts9QvaNnE=; b=YJPn2TZbD295LfZbMtu89jipZ4ktUokJtCckQ82w6YDvfXaC3Ew6Yo/BRFOS2qLILK Oc68hC8vYNyw2PcleZSqJemgghfHP8+bTwlqgA8LVa8Kbck4dlaI22NjMLp3nNOzpaj6 xxlR/m+gYM6ciSyiNgPzM/cPvzQLFfPlAyyiJ5DLw2r5/o7+dWgqw+tS0fWWy18UDGCC KEPGhRDyFUGsY3klw+u/FVU8poX6K7bHBoaM9FfMysDIqnIvF7Dd40f6pClewhgIS0Hy Ru6k5YDXcsNwhddKNQEwbd8k5ZwtIPtg1aCgKdlfUhykSwOgluljAYb89l/xQYTvBU1D zX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=vLanaI8a99gMLIUKf8jOB4ad4EZ0sLCvedts9QvaNnE=; b=R3NGaVN7bbPZiIz9FJjOsD/ftu8lBC5rdalfefMnAOO8Pqbr3+XJOnC10Lq3oaCYsV PzEG5GQpq88MOlQAr9ur0cBt9Vt9jJXBGKeA6UbxMPJtZ2wvjfVtpVd1+aQRxUDHnHkF cKW8savi4WTHc6LCcvOXNjMniY7kI53b2fdzLZf2dcS4MRGJygAFUvIiqwbCDnWm1ExM jeHk0dVbh7mTjkiF1qJ7tisbYPk/RRerPKvPRJ8qJZaaXyFM9C7nETRfbrP7C10H5ijk +/xP6YeIHSEyrEEMgnGPWFrWU4kWC1g435zF5+HIG14uDkfxlblqaXjXuu9IClfwH7Gk KvsQ== X-Gm-Message-State: AJcUukcJqsrgxmzG4v6GWEcjnA75EoB2xiixcBVGpib3c3zthieniLyh bR4R6D391XRwwdqu8FeEfx4= X-Received: by 2002:a19:24c6:: with SMTP id k189mr2478278lfk.77.1547022273984; Wed, 09 Jan 2019 00:24:33 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id z6sm13701604lfd.50.2019.01.09.00.24.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 00:24:33 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gh9AD-00056L-FH; Wed, 09 Jan 2019 09:24:37 +0100 Date: Wed, 9 Jan 2019 09:24:37 +0100 From: Johan Hovold To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Nikolaj Fogh , Johan Hovold , 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: <20190109082437.GA3389@localhost> References: <20190108192628.121270-1-sashal@kernel.org> <20190108192628.121270-25-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190108192628.121270-25-sashal@kernel.org> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Johan