From patchwork Wed Jan 25 18:39:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 719799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v7v4P4qzjz9sD5 for ; Thu, 26 Jan 2017 05:40:21 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cWSUW-0003fG-BK; Wed, 25 Jan 2017 18:40:20 +0000 Received: from smtprelay.synopsys.com ([198.182.47.9]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cWSUQ-0002IQ-GG for linux-snps-arc@lists.infradead.org; Wed, 25 Jan 2017 18:40:19 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id A923724E20ED; Wed, 25 Jan 2017 10:39:52 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 48EC661E; Wed, 25 Jan 2017 10:39:52 -0800 (PST) Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id C08835F9; Wed, 25 Jan 2017 10:39:51 -0800 (PST) Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 25 Jan 2017 10:39:27 -0800 Received: from DE02WEMBXB.internal.synopsys.com ([fe80::95ce:118a:8321:a099]) by DE02WEHTCA.internal.synopsys.com ([::1]) with mapi id 14.03.0266.001; Wed, 25 Jan 2017 19:39:24 +0100 From: Alexey Brodkin To: "peppe.cavallaro@st.com" Subject: Re: stmmac: GMAC_RGSMIIIS reports bogus values Thread-Topic: stmmac: GMAC_RGSMIIIS reports bogus values Thread-Index: AQHSNe3WHCWZ99cl6060z9b7QcHLU6DYIbIAgHHWYIA= Date: Wed, 25 Jan 2017 18:39:24 +0000 Message-ID: <1485369563.7117.81.camel@synopsys.com> References: <1478189833.4072.65.camel@synopsys.com> In-Reply-To: Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.121.8.91] Content-ID: <91937DA5124C1B42A9A67DFB11A346BA@internal.synopsys.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170125_104014_566414_DF5C40E1 X-CRM114-Status: GOOD ( 14.82 ) X-Spam-Score: -5.1 (-----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-5.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -3.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.47.9 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "fabrice.gasnier@st.com" , "netdev@vger.kernel.org" , "manabian@gmail.com" , "linux-kernel@vger.kernel.org" , "preid@electromag.com.au" , "davem@davemloft.net" , "alexandre.torgue@gmail.com" , "linux-snps-arc@lists.infradead.org" , Vineet Gupta Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi Giuseppe, On Mon, 2016-11-14 at 09:14 +0100, Giuseppe CAVALLARO wrote: > Hello Alexey > > Sorry for my late reply. In that case, I think that the stmmac > is using own RGMII/SGMII support (PCS) to dialog with the > transceiver. I think, from the HW capability register > this feature is present and the driver is using it as default. Yep looks like that. > I kindly ask you to verify if this is your setup or if you > do not want to use it. In that case, it is likely we need to > add some code in the driver. Well GMAC's databook says: --------------------------->8-------------------------- The DWC_gmac provides an IEEE 802.3z compliant 10-bit Physical Coding Sublayer (PCS) interface that you can use when the MAC is configured for the TBI, RTBI, or SGMII PHY interface. ... You can include the optional PCS module in the DWC_gmac by selecting the TBI, RTBI, or SGMII interface in coreConsultant during configuration. --------------------------->8-------------------------- But we use RGMII for communication with the PHY. And from the quote above I would conclude that for RGMII we should have PCS excluded from GMAC. I just sent email to GMAC developers here in Synopsys and hopefully will get some clarifications from them soon. Probably correct solution is as simple as: --------------------------->8-------------------------- --------------------------->8-------------------------- > Also I wonder if, other version of the stmmac worked on this platform > before. It did work and still works. The only problem is we're getting a lot of noise now about bogus link status change. That's because this info is now in pr_info() compared to being previously in pr_debug(). -Alexey diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a276a32d57f2..f4b67dc7d530 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -803,13 +803,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv)         int interface = priv->plat->interface;           if (priv->dma_cap.pcs) { -               if ((interface == PHY_INTERFACE_MODE_RGMII) || -                   (interface == PHY_INTERFACE_MODE_RGMII_ID) || -                   (interface == PHY_INTERFACE_MODE_RGMII_RXID) || -                   (interface == PHY_INTERFACE_MODE_RGMII_TXID)) { -                       netdev_dbg(priv->dev, "PCS RGMII support enabled\n"); -                       priv->hw->pcs = STMMAC_PCS_RGMII; -               } else if (interface == PHY_INTERFACE_MODE_SGMII) { +               if (interface == PHY_INTERFACE_MODE_SGMII) {                         netdev_dbg(priv->dev, "PCS SGMII support enabled\n");                         priv->hw->pcs = STMMAC_PCS_SGMII;                 }