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: 10142531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF6606034B for ; Wed, 3 Jan 2018 15:48:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DAA3290AD for ; Wed, 3 Jan 2018 15:47:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12B1429118; Wed, 3 Jan 2018 15:47:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A1D83290AD for ; Wed, 3 Jan 2018 15:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=7hm8qD9mevAwHCu1d7XNrImGbBZVq5ZWdB6qFG4MQSs=; b=hS+ bdMrr52YqJk0cY3pFrik72RjdyObf77u5W87unu5P3+a0E3oshRwbruZfNmIHQg1t1ky5EQ74ls3p idQ1+2AqP8DI6LBgjSibJzcEQqcZh5o2ZLCQigMm+6bpkD3iCGawIDmAekZCvfDqv5HThsvE1HK2E 92oh5nDBR9XWlMl7Ldl/5QbvBPdUYFNNwz2NeNFSa7HtKk2nRpNE+cfCqQnL+N4OxGL4P5qgta1t0 Rkv8iqZZ/RU1ruzn5OcjscXc68+YZ8oad3FMo24Jlug+oNnWOdg4kOkUrS8AheKqfQjqTfc89Al/O DaUZUDct0LWpNPPfOoEbqZD5nXfgpjA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eWlGC-0003e4-9m; Wed, 03 Jan 2018 15:47:20 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eWlFo-0003Jr-Js for linux-amlogic@lists.infradead.org; Wed, 03 Jan 2018 15:47:05 +0000 Received: by mail-wm0-x244.google.com with SMTP id 9so3372048wme.4 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=XkMDULwbdK5IWCGOueeiwN1v4d5u/K/ui7RVFRTpaLgY0KhAB2CXS/G6rSrlzkWpL3 HuExWCQCeYMJ1fekzQRoEzdgqZ2UpCnS4Ds40mJR8FLXTINb0Ku8ydla/zCmZNmZ8H47 D1nlyqIIwcGf99oLccHgSBI5gyh2tVF3mzCXBiz+2WbbOLmF2QAc6l+/1gWL92HF2DID EbZz3daPFyprukGbTL8rBkpooXvkVKEzYCU1hIuQUeI1deaHNckhyRQdFstZi73oiQWQ 1FmWXDMbztgVB42dv/fI+VtZsn2qchP5Vj4EhpbuKIAsvftxlA+CCeRSqQeHHGkbvOMs uEuA== X-Gm-Message-State: AKGB3mKkKKRVklfHNCDNufvMSAaJgvD/sHrWH+MP6KMNla9OqClGBYKW OYm8U+NGHooJxaf1UgcV1f99aA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180103_074657_467200_B7176D63 X-CRM114-Status: UNSURE ( 9.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. */