Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10242417ybl; Thu, 26 Dec 2019 13:40:18 -0800 (PST) X-Google-Smtp-Source: APXvYqw6Co63StI0sI6lRv5uaqvSvWheh8NuNi+UHfz+d2HAyOkIWLYHsMz9FdzJgJZ/mgSdhn2i X-Received: by 2002:a05:6830:1442:: with SMTP id w2mr54901584otp.143.1577396418270; Thu, 26 Dec 2019 13:40:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577396418; cv=none; d=google.com; s=arc-20160816; b=LFQqKdDbfXmdbwpS/jDujP3S+TT5Tn0ZszkUG/GikxuwZvC8IEpnu8lyF5R5eTqP7U gmmbIwNnoveN35/d2bprrE6qMqdF0mAICOTQIArid/pCVoFnL0dkxMPJT9f3XjDEy1sU KqR2YJc/WRhMnwtSNPgdodzFJlkW2h4pbJzC7nWW9iPWs3/LqxOpoKq3EKkmHiUe95rG U/DW7EfzvIemG/yHrGr1eJ2NEFFu+JNVYo/3tT/V6u6TPCgpvJUY+kZSz1OtU1RRri/C 7CGUpGfWAGIZGWRFyiIuqxc6kjetDQkXZD3zDT9xnFgVefU69WNCT6oqkPGFLeyBKjy2 BXWg== 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=bZoxgAannd2tkNNwwKV808Ug99KBWslN4hI308jxAhg=; b=fw2QAXrklv34Z2PpC8GgHCIqtuBM+RMi4V7hW76UflwVikdNX0Im+AM+Nr5ygTFxeX hO0OPdu0qtdTLaVSkejlellxemQ1L4Q7kuEl9utqnwC0rO4Z0Xu1Q8BsXf6c28J8HFXC Vm2kBaMPc4FfGcsNq1fCAdFHjcLBNTq2VYQ/XfiwERp76zuOS/f9zb31aWIUhLi0pwMh ieC67BGf6+6DvSd6s6FomkUThdPOJsGa+oK9kVTm7m3hURzS8TuNAfLjt3uc15kuSdRL Vt8zEXTM8pMU1tsTPtm4Ni+8AyjVg2vvJnc5VsIw1Cb/xoxhJGJSxq5LXD4oAwwbRTt7 HLlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=ZTxVZbP8; 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 e13si9466131otp.164.2019.12.26.13.39.51; Thu, 26 Dec 2019 13:40: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=fail header.i=@lunn.ch header.s=20171124 header.b=ZTxVZbP8; 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 S1726994AbfLZVgU (ORCPT + 99 others); Thu, 26 Dec 2019 16:36:20 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:40916 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbfLZVgU (ORCPT ); Thu, 26 Dec 2019 16:36:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=bZoxgAannd2tkNNwwKV808Ug99KBWslN4hI308jxAhg=; b=ZTxVZbP8jHh4LUydfIbDacSml9 p6f862RCdnk35tCi5JKeLOO+fJT/giHdSgS1id+hipPbF65+xyiR7b/hqkEhs15n15sqduE+4zPFP GnsJ3c5yflBU/GhXqC41Lr6fy1BdKK2kA2FLoIgAXAAFOwssipmQ4yHGNajKopjJNuFY=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1ikanm-0000Ho-Fy; Thu, 26 Dec 2019 22:36:14 +0100 Date: Thu, 26 Dec 2019 22:36:14 +0100 From: Andrew Lunn To: Martin Blumenstingl Cc: f.fainelli@gmail.com, davem@davemloft.net, 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 Message-ID: <20191226213614.GC32477@lunn.ch> References: <20191226190101.3766479-1-martin.blumenstingl@googlemail.com> <20191226190101.3766479-2-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191226190101.3766479-2-martin.blumenstingl@googlemail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 26, 2019 at 08:01:01PM +0100, Martin Blumenstingl wrote: > 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 Reviewed-by: Andrew Lunn Andrew