From patchwork Tue Dec 5 10:28:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 120638 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5564426qgn; Tue, 5 Dec 2017 02:28:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMb6DZrkOEN+rzfzvR+tGgC+oxA9Ys/XBBuWizZLMAik1Sc+rJLx4PGxIGg+OOoW7gJ3Wvd2 X-Received: by 10.99.169.26 with SMTP id u26mr16782097pge.91.1512469714408; Tue, 05 Dec 2017 02:28:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512469714; cv=none; d=google.com; s=arc-20160816; b=x8poCjQDGBmSZBCcNGaCqcGFlAGVKwgyz1uxM//T+g4NHYwHI1MelBufy6yN9WRZBq OAjIE6uFZapPfkwZBP6J5uAWVkJ9H2Ke5/XRwyyRoXTlHYzlmx8iYoAloa8xiPyO6fZ6 YT6RaSW/TBgrwYuQCWthk2V+TD1jeSBOw9/n3yf3tPGgg74XnFBVcIEIiqInqg0I0BcY uYJLs5Ifzf6dz8+ourklZBjCRu/PJNalUpJ3ppkYksCTmtybyq7QtwUrA/M3W/EEIan8 JNRMQJ1f7Nf1L0qrjSf5veyv6pxY84BW6Q6BOf2tq1+CXgWpEOdfyEGQJxoh03L3eO9t YQhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ECPZLN/5QIqRkZB0fBwX21KJ47hclvl/3qhUEq/fC8U=; b=Z56bFnbiapBUOnV6QPb3rufGbV5lpcmfvpdM8d8usM7/Of/D70pC0S86edBBfE67Ck cnu6xUB+ZT7XI0DQaiL+uNpRoVQdhmgBtJZv3wd+jA9j2BWsVGWUFGdBw6mdqNzshX6h VAEiW6Unm3RpYu1Wtu14FUrrR4+mDayF9dT3EBEiV7qakbs2Vkdva4AGnWLjtZy5e4xg llXlvvoMXn15gAFrkHDwdrl2a5WBdDHTdxXubzX1JyQ59UGexYDN5R44okUpaVio5/QZ 8fHKnfiMTb35+xKoekePjNbEXflqUtHaKVilGRummchmxX177DWqQ8Ya56GWUVlAlT8o 4Tcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Y8ss+nDz; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 y192si10715486pgd.109.2017.12.05.02.28.34; Tue, 05 Dec 2017 02:28:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Y8ss+nDz; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753341AbdLEK2c (ORCPT + 7 others); Tue, 5 Dec 2017 05:28:32 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39050 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753132AbdLEK2S (ORCPT ); Tue, 5 Dec 2017 05:28:18 -0500 Received: by mail-wm0-f67.google.com with SMTP id i11so278253wmf.4 for ; Tue, 05 Dec 2017 02:28:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ECPZLN/5QIqRkZB0fBwX21KJ47hclvl/3qhUEq/fC8U=; b=Y8ss+nDz6p0fm0QTEyFnF2aFYFbvXvFUZShFE0Bhbe2qthgFCBFs9lAgmFmyUJPehl 4LkPGC6YMnjlX+Rzyy2KdCqRetrP7ks1oB8vyMVhTsWVHAPvKnOgOUJO1oWd8at6+j3/ xkXdf0Mft6O1oMO7f8E+2mDZGPxGRpFCquKvpHFegd2xBjNEj95ZOanMKcn9IEBcQvgW ZJFE8H12seOQ1upaaK2aEfph1OYYqS0pHBI4KY0Ph/k2l2hdtRdGez1pSOx/Ws5w9ONi vvxPLLvoprI77XwziGYSJ2mMxvvZq9IoYqWyVlF6JBzEpWWmbApfzemHtVTEgU8drW4g mZOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ECPZLN/5QIqRkZB0fBwX21KJ47hclvl/3qhUEq/fC8U=; b=H3w1WLNJ97hs1uHkrg/yopXg4Rb5D1DBRQ6qNkwgpAaJRZa/kNfY37CJL2v0b/0h/I ky+o2fKYTuRSjbLGlbNCBIo36kkFCSHWTnOmIii8jsEGnQt1iqFpuhx2dM98F7H++krQ miro8w7/B7fYZYs10yDUzf2VPorDYpJop/Vh3Eocftm1dL06jmzbDStaBVvh8qv85w/r CEDhVPT407C0iUs+AKeG17HU138ZsYFN8doTVDvj7p4ynMqKtpE8r9ZOcPoJyh+e1hO0 WD/5S0CQNRCYvFibyGGyDaA0IK1qHN53IHHYLfi7K/iHeiQMBXwZj46EDw2yG1iUuOqg FKuA== X-Gm-Message-State: AKGB3mLLC5mI9WB1OFjNmC+OVsq1efA21VrqtBV0tL7sKAtZTAW8nv03 Nhm+7FKIBJ3dYBXyZUxOq7d6KA== X-Received: by 10.28.209.77 with SMTP id i74mr9710803wmg.53.1512469697556; Tue, 05 Dec 2017 02:28:17 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id k42sm20156129wre.80.2017.12.05.02.28.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Dec 2017 02:28:17 -0800 (PST) From: Jerome Brunet To: Giuseppe Cavallaro , Alexandre Torgue Cc: Jerome Brunet , netdev@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH] net: stmmac: enable EEE in MII, GMII or RGMII only Date: Tue, 5 Dec 2017 11:28:09 +0100 Message-Id: <20171205102809.4347-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Note in the databook - Section 4.4 - EEE : " The EEE feature is not supported when the MAC is configured to use the TBI, RTBI, SMII, RMII or SGMII single PHY interface. Even if the MAC supports multiple PHY interfaces, you should activate the EEE mode only when the MAC is operating with GMII, MII, or RGMII interface." Applying this restriction solves a stability issue observed on Amlogic gxl platforms operating with RMII interface and the internal PHY. Fixes: 83bf79b6bb64 ("stmmac: disable at run-time the EEE if not supported") Signed-off-by: Jerome Brunet --- Hi Peppe, Alexandre, As quickly explained in the log above, we are having some stability issue on Amlogic gxl platform: synopsys MAC + internal PHY over RMII. We found out that these issues are caused by EEE. Forcefully disabling this feature solves our problem. We are now looking for the more appropriate way to address the problem. I only had access to a snip of databook. I have no idea if the restriction explained above applies to all the revision of Synopsys MAC controller ? Or maybe the restriction is more generic and we should check for the interface type in phy_init_eee() instead ? Could you please share your opinion on this matter ? Thanks Jerome drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.14.3 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index f63c2ddced3c..8e8add8c6ed3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -364,9 +364,18 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t) bool stmmac_eee_init(struct stmmac_priv *priv) { struct net_device *ndev = priv->dev; + int interface = priv->plat->interface; unsigned long flags; bool ret = false; + if ((interface != PHY_INTERFACE_MODE_MII) && + (interface != PHY_INTERFACE_MODE_GMII) && + (interface != PHY_INTERFACE_MODE_RGMII) && + (interface != PHY_INTERFACE_MODE_RGMII_ID) && + (interface != PHY_INTERFACE_MODE_RGMII_TXID) && + (interface != PHY_INTERFACE_MODE_RGMII_RXID)) + goto out; + /* Using PCS we cannot dial with the phy registers at this stage * so we do not support extra feature like EEE. */