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: 844670 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="Y8ss+nDz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yrdJ23rLlz9tB5 for ; Tue, 5 Dec 2017 21:28:34 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753341AbdLEK2c (ORCPT ); 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-Google-Smtp-Source: AGs4zMaoUIkLS8SXrPLHZNDgkV82bqpfiuU6WqaApS00pacgBctSXQ2XgIXmJW2esOLvZntR2nY3sQ== 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 Tested-by: Arnaud Patard --- 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(+) 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. */