From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20CA7C2D0DC for ; Thu, 26 Dec 2019 21:36:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA25A206CB for ; Thu, 26 Dec 2019 21:36:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="ZTxVZbP8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726985AbfLZVgU (ORCPT ); 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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