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: 123330 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp10324175qgn; Wed, 3 Jan 2018 07:46:51 -0800 (PST) X-Google-Smtp-Source: ACJfBovAbXOH9MBDO74V1UD9aqWtjLiLlfFjAF+bnEk+zPQ3oIy0Q0XrnHalrWguciu3MnMkAs7n X-Received: by 10.159.207.151 with SMTP id z23mr1849006plo.164.1514994411082; Wed, 03 Jan 2018 07:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514994411; cv=none; d=google.com; s=arc-20160816; b=cLi6Ppqdpm5zvAAAjtyKTJhxsSTy6ttjNqATSgmmu/Zlq62ImYPOmZOT1uQpTPhrU+ 14UVTefWqIJZgLSfx/x654GNoPRJmqAwkOuwLp9v3SphLy2VEyDIckC9H9Hv41sQzq5+ 9kpAvqW4CdceRgH0wkU8wo8tPU6A1ayWE1MGW07Qa6UykBtTNOScKypX9aE+bve3A8dB //80N9wKxn76p3rntlDrTjLr3l3U2N4mLfr6gkhfuPqv1OwTCANZbJ0Jl2YzVGdcYnSE og1daJzKSZYQ69xbtU1KGf2oVnvI7Ek/I7/Y6T0rr3+4dSHb6dKo9Kp3XX/1K0ZAeLnz 7vOg== 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=ok2RHu+C4i2cNYH453DQg1BZ+VmaWrn3qMXIwYunggY=; b=W+LGgfFyKgZXFZiJxf7BLGm4KyyZZH1/AuvnRc/OYuOWYf9tArQO6bvLVwEapvVowj oVQ5+ogs0/z8hEX3VdgDuXS6J5uaUWGdNf80wGa7Zu+yJtx+qWfzFosTeaHJ+651LE01 NiadKO3TQax3KkYnr7rjDn8d0EkeqIqImJ+WyCiJkz4Bmdf3CkrfZApPP2eEOp+quIrA tlxyD3119hwaGaoA5WgFMOWaG6CLnJt6IFdDFV+lWdvWQUo3VT5vlWFaETdwrLZuzGSh ooE4V0QpVTKeuzyHlxGIfrnTHEBHnyf6ywn87LGbMgdAsoabVnYrVTn6Bg6wzX+ggOQ2 7uKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=HywWdWkp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z1si841583plb.260.2018.01.03.07.46.50; Wed, 03 Jan 2018 07:46:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=HywWdWkp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752421AbeACPqr (ORCPT + 28 others); Wed, 3 Jan 2018 10:46:47 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:41706 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbeACPqp (ORCPT ); Wed, 3 Jan 2018 10:46:45 -0500 Received: by mail-wm0-f66.google.com with SMTP id g75so3416556wme.0 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=ZyyvrdiapzUzmzbWGdtvWfL99TTt6TBj8HGAFquN+1kAuSsjODIywCYIgrlFp1Of6j MikWNR2Pyx4JYg8O51ivXN9GdP8OEVm2O5ikQzU2wcOK/tpAXnc5joO0NReRffE0/Puh YPq0V49jEH04HrcudcqF9XpTy+KKYmqK0KgAa0C0NpJJxS0Zm8bK78+1XWIsj2zydosa TpTVAIFqws96atrUaLOroqAsF4rMoMfSoZW1/FnLa5SdqXV68RyLlxhOyA4rOBfYpNIX nzmDMg4ZP5jIufF0DFEDgnoslHOZ1wuLHztEaGT9mkCVc5bmuX/cgGoSqorZyENI4Vkm jGIg== X-Gm-Message-State: AKGB3mKhrb8MymyP4e28uY64VyEajLbtvwc1X+d+CV8Bew93l6UdsfBl 9u5ohoe5Gf1i4/IbJ635YKx1Rw== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) -- 2.14.3 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. */