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: 10092659 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 1FEF66035E for ; Tue, 5 Dec 2017 10:29:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 186B1223A5 for ; Tue, 5 Dec 2017 10:29:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C1F128A0D; Tue, 5 Dec 2017 10:29:32 +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 C07EE223A5 for ; Tue, 5 Dec 2017 10:29:29 +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=MIBHdV2F0O8a+SjvMKqH/ucSME0aVWIHYbC4rtWkZBQ=; b=To/ 1mw61kxh7T1kOdQHtNagNEkFIFtkvQ8ZC8qUoUArEVDu6ILp/MJxdk87fdhizjIM2GZ4xpX7q09vD FLa1+/8TlrShMYB2OtEw+HVOFfETxmjNHd5Y9gRdNSjbjOXCjzM7BPyO5azO7QJcW0NcZdVx2OaEL vaE6ye5sTUahs59pp1XM5fEi2+vVCzf+nol+1BOcT9MWQdigXXO+3Y8iLgipt3vzyz3uPFR3Ahr9K u8eBykWRQmoGvbIUeuRe0AGuTU71/nx0uYaXJ2TSCd9MdlmgH5Cg5LDFWwzNJNe0HN2UFlEbxKeyM sC95O8/xqFnuGofGHUiB8YBgpMgp8rQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eMATV-0003O0-1h; Tue, 05 Dec 2017 10:29:17 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eMASt-0002p7-QQ for linux-amlogic@lists.infradead.org; Tue, 05 Dec 2017 10:28:46 +0000 Received: by mail-wm0-x242.google.com with SMTP id f206so270767wmf.5 for ; Tue, 05 Dec 2017 02:28:19 -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=ds5VYhkFWgwPSRn4YQMX4IuY8q+ym1EGJHe9Am0yGdOlYSiogzsAKpg346b9BJUPu5 e7H9x7sc3K5EiCnV/A4X5Cep0M7HG8RKSRyqa9Hq9CzBVKhWN/kr+R/33uO83Eufa66Z tkK2Bl5+bRovznTyCCbKtfRhcW0lz3Hs68G174/rHb7G4qtRga+2C/8XsG+xTgI0yDpk +/7TTjPB6opa4gF+hxhz8I220zZs5+jP7/Q8fjUP+xt4x4s9tMpTswwS/zKoVS6n7LSQ AJLit5o8Z7fsuyVpMsR39j8spNdf7KcV7Q/inyDXT9VNi6eogFQpG1uPXtoX8wU0lN3l PiwA== X-Gm-Message-State: AKGB3mLdijv7lMs7AV6UxgDsiZttvmSNLvCdsEQ/OUonr6JCMO7jMe/z a3CThdHFTQxTuVv845/FMBPo51h6 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171205_022840_551997_619FA9A2 X-CRM114-Status: UNSURE ( 9.70 ) 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: netdev@vger.kernel.org, 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 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. */