From patchwork Wed Jan 3 15:46:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 855070 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="HywWdWkp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zBb021Jmcz9s7F for ; Thu, 4 Jan 2018 02:46:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752333AbeACPqr (ORCPT ); Wed, 3 Jan 2018 10:46:47 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:43900 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751685AbeACPqp (ORCPT ); Wed, 3 Jan 2018 10:46:45 -0500 Received: by mail-wm0-f68.google.com with SMTP id n138so3374032wmg.2 for ; Wed, 03 Jan 2018 07:46:45 -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=ok2RHu+C4i2cNYH453DQg1BZ+VmaWrn3qMXIwYunggY=; b=HywWdWkpz9CG5HVVrDR3WO/mLCs7HYcniQ+oK0eg1Dngn54kVeapu5UBAqlpHruwdl xkQ2+UGEvQ+/naf6eO1zdkOKvGPzSVWH/zBbATVzs+gDdITY3WKAeKneGe1yjdaOzL9z djyRrhs6EATiL+p1k2a1/bO9/QC5uT/XK8Jce1FyNlbwRjV1lXA9fm3JWOxYuS190fCa 6obcQn0rBoJYBYspXQRf9XOl7k+QIWLwOCTAvgS/MfWYktpMdMn5z4bJUE/HzSeu7KOe QKVb/myDDicG08laOmoCMW4GT8b4NUcsHQkoaAP3HxD/iW5QZFgHBYFyfznu8kt+qzma 0Chg== 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=ok2RHu+C4i2cNYH453DQg1BZ+VmaWrn3qMXIwYunggY=; b=hxcSStnh00BWf9tgVfiUyNn74qwqYoenYHBEwEJeYZ4AVBlnYTiyZ8xEexg1zYMgLm cLrUlphgdH5IdnJgM5u0NMP3dIjjGMFzBBVC+vk50uHCNv65t2rQ+UtTL8pxnTChgE3f xIGVrYa5499qczFNf8vbo9ra+FNPKTA734TeCwzZM5ZkjF8SXemIoLd+B4fSjMGqjrUe PkkUALsdUaR+bR3s4YaJHEy7iubk54VnA/b/Q230Futk8Si1d5VONkNyHRiKi9mzlY19 GRDs5QeNW1LTP42e09JRsNVPdxZJ3QXoYUYZBLLZ4wyTx8Njqtz1GWFE1tv2JnJ4AVLq KSUQ== X-Gm-Message-State: AKGB3mLRzL9HglbDdUHvw9u7miqcQwxnCCDPHYXz8f7jwXAaHkv8NVRd FOKNzudyzwcr3jdPGQDck4CB/4YS X-Google-Smtp-Source: ACJfBouY/jgElWeLG01QNuBzkf3W6DzRkr7Grl1w9yQJSRz9e4cZlfgIrtlrnllj50ze0yfgnEaH/g== X-Received: by 10.28.55.82 with SMTP id e79mr1641985wma.60.1514994404415; Wed, 03 Jan 2018 07:46:44 -0800 (PST) Received: from localhost.localdomain (cag06-3-82-243-161-21.fbx.proxad.net. [82.243.161.21]) by smtp.googlemail.com with ESMTPSA id d23sm1985371wma.48.2018.01.03.07.46.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2018 07:46:43 -0800 (PST) From: Jerome Brunet To: netdev@vger.kernel.org, Giuseppe Cavallaro , Alexandre Torgue Cc: Jerome Brunet , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH net] net: stmmac: enable EEE in MII, GMII or RGMII only Date: Wed, 3 Jan 2018 16:46:29 +0100 Message-Id: <20180103154629.1433-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 David, 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. 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. Anyway, this change should be safe to apply. If we get more information from Synopsys later on, it will be easy to revert, if necessary. Thanks Jerome Change since RFC [0]: * use phy_interface_mode_is_rgmii() as suggested by Andrew [0]: http://lkml.kernel.org/r/20171205102809.4347-1-jbrunet@baylibre.com drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index c52a9963c19d..023938166821 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -364,9 +364,15 @@ 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) && + !phy_interface_mode_is_rgmii(interface)) + goto out; + /* Using PCS we cannot dial with the phy registers at this stage * so we do not support extra feature like EEE. */