Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp11556701ybl; Fri, 27 Dec 2019 16:38:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyrIROnyhi/ayXOMkuLAKsTJbH0XgYiENbn/OqeQI5tI6uCgOwBKe81YCYcPIQU5NglF6Xi X-Received: by 2002:a9d:4f0a:: with SMTP id d10mr44136153otl.85.1577493525542; Fri, 27 Dec 2019 16:38:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577493525; cv=none; d=google.com; s=arc-20160816; b=IO3YQAE4mIZvOy0Mze8vs+EDlgwuwahgpwEu3wAVV3vzMRF1b6aBxy6b6AjUnl5C2y QDe+PIEdRSsoO4wKdZxCHRxnzKvQLryE3gssAJMjWlGRHFCqtTu+SsxI6pJx/tpLleBW ZqraIay0aqUZRyxixe69MIlU44UUBw1A95+XuGj71tcQBVimUkvR0nK/k3wxQRncsl7w miJgUbNKSC9YpIrXJlCKTTuR7qC8MUv9clz2f5PjdbU2kp+D8uXq+RV+AxUVof5d3tBq w0IkXLBHiVtzpMMUJ8U4jSk8v3pNFJ83hzoq3qX3ba/7DvptbsWmMb50DosuWctXWo+A uCwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=PHAgxMfcUu4W3Nd6TUyC/ynaQ0PnOZXaHCmA4EDHOk0=; b=RmVa+o5ONBCWuTWOK24EYY78iOjNeI9yLZvPRanr8X8ThF9B/kTsQFH9+ccv/uAuSA V390fQD/78lsIDGP3Dx0czuY/VdVVHqEigBSOg/wRJu6z2rLRoNR4lFafwxG4uPpeg94 IidoIdmwmADUX9qDnpZuLz5dlAZ43Jbfk47TCr18KQtrOXywoBP60QWp6ZfAL9AcNqSU 016z7cIhPLlcCnb19puOtkv4pzR6+OmrTYkFwT5CuL+yiJoK8hz245gVVXGXzAxwxsk0 RJkYX9Uyuf+Ww2eVKlz9tPa3TM0ThQJ5e11XOeke01IUsr/etG9l6TQxfvHTQ0LzDQbw gvFg== 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 j143si17196302oib.16.2019.12.27.16.38.33; Fri, 27 Dec 2019 16:38:45 -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; 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 S1726378AbfL1Ahz (ORCPT + 99 others); Fri, 27 Dec 2019 19:37:55 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:53818 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbfL1Ahy (ORCPT ); Fri, 27 Dec 2019 19:37:54 -0500 Received: from localhost (unknown [IPv6:2601:601:9f00:1c3::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 02E0C154D18D0; Fri, 27 Dec 2019 16:37:53 -0800 (PST) Date: Fri, 27 Dec 2019 16:37:53 -0800 (PST) Message-Id: <20191227.163753.1973785313910356084.davem@davemloft.net> To: martin.blumenstingl@googlemail.com Cc: andrew@lunn.ch, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/1] net: stmmac: dwmac-meson8b: Fix the RGMII TX delay on Meson8b/8m2 SoCs From: David Miller In-Reply-To: <20191226190101.3766479-2-martin.blumenstingl@googlemail.com> References: <20191226190101.3766479-1-martin.blumenstingl@googlemail.com> <20191226190101.3766479-2-martin.blumenstingl@googlemail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 27 Dec 2019 16:37:54 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Blumenstingl Date: Thu, 26 Dec 2019 20:01:01 +0100 > GXBB and newer SoCs use the fixed FCLK_DIV2 (1GHz) clock as input for > the m250_sel clock. Meson8b and Meson8m2 use MPLL2 instead, whose rate > can be adjusted at runtime. > > So far we have been running MPLL2 with ~250MHz (and the internal > m250_div with value 1), which worked enough that we could transfer data > with an TX delay of 4ns. Unfortunately there is high packet loss with > an RGMII PHY when transferring data (receiving data works fine though). > Odroid-C1's u-boot is running with a TX delay of only 2ns as well as > the internal m250_div set to 2 - no lost (TX) packets can be observed > with that setting in u-boot. > > Manual testing has shown that the TX packet loss goes away when using > the following settings in Linux (the vendor kernel uses the same > settings): > - MPLL2 clock set to ~500MHz > - m250_div set to 2 > - TX delay set to 2ns on the MAC side > > Update the m250_div divider settings to only accept dividers greater or > equal 2 to fix the TX delay generated by the MAC. > > iperf3 results before the change: > [ ID] Interval Transfer Bitrate Retr > [ 5] 0.00-10.00 sec 182 MBytes 153 Mbits/sec 514 sender > [ 5] 0.00-10.00 sec 182 MBytes 152 Mbits/sec receiver > > iperf3 results after the change (including an updated TX delay of 2ns): > [ ID] Interval Transfer Bitrate Retr Cwnd > [ 5] 0.00-10.00 sec 927 MBytes 778 Mbits/sec 0 sender > [ 5] 0.00-10.01 sec 927 MBytes 777 Mbits/sec receiver > > Fixes: 4f6a71b84e1afd ("net: stmmac: dwmac-meson8b: fix internal RGMII clock configuration") > Signed-off-by: Martin Blumenstingl Applied and queued up for -stable, thanks.