Skip to contentSkip to conversation

net: stmmac: enable EEE in MII, GMII or RGMII only

RFC PATCH In review Jerome Brunet 3 participants 3 messages Dec 5, 2017 – Dec 14, 2017

Subsystems (5)
lore
Share & tools
lore

Jerome Brunet

author reviewer
#0 lore raw

RFC PATCH 1/1 net: stmmac: enable EEE in MII, GMII or RGMII only

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")

---

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(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +9 -0
index f63c2ddced3c..8e8add8c6ed3 100644
@@ -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.
 	 */
Signature · 1 line
2.14.3
#1 lore raw
Quoted 4 lines

bool stmmac_eee_init(struct stmmac_priv *priv)
{

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -0
 	struct net_device *ndev = priv->dev;
+	int interface = priv->plat->interface;

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c static void stmmac_eee_ctrl_timer(struct timer_list *t) · line 377

Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +7 -0
 	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;

phy_interface_mode_is_rgmii() will make this smaller.

Andrew

Tested-by on v1 1/1
#2 lore raw
In reply to Jerome Brunet
Quoted 8 lines · Jerome Brunet

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.

I was having the issue on my libretech AML-S905X-CC / potato board. With this patch, I've not been able to trigger it at all. Without it and with my test case, I was able to trigger the hang several times reliably.

Any hope to see this merged ?

Quoted 3 lines
Fixes 83bf79b6bb64 ("stmmac: disable at run-time the EEE if not supported")