lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f1f8827-730e-4f36-bc0a-fec6f5558e93@arinc9.com>
Date: Thu, 14 Mar 2024 15:57:09 +0300
From: Arınç ÜNAL <arinc.unal@...nc9.com>
To: Frank Wunderlich <frank-w@...lic-files.de>
Cc: Daniel Golle <daniel@...rotopia.org>, netdev <netdev@...r.kernel.org>
Subject: Energy Efficient Ethernet on MT7531 switch

Hi Frank.

Do you have a board with an external PHY that supports EEE connected to an
MT7531 switch? I've stumbled across an option on the trap register of
MT7531 that claims that EEE is disabled switch-wide by default after reset.

I'm specifically asking for an external PHY because the MT7531 switch PHYs
don't support EEE yet. But the MT753X DSA subdriver claims to support EEE,
so the remaining option is external PHYs.

It'd be great if you can test with and without this diff [1] and see if you
see EEE supported on ethtool on a computer connected to the external PHY.

Example output on the computer side:

$ sudo ethtool --show-eee eno1
EEE settings for eno1:
	EEE status: enabled - active
	Tx LPI: 17 (us)
	Supported EEE link modes:  100baseT/Full
	                           1000baseT/Full
	Advertised EEE link modes:  100baseT/Full
	                            1000baseT/Full
	Link partner advertised EEE link modes:  100baseT/Full
	                                         1000baseT/Full

I'm also CC'ing Daniel and the netdev mailing list, if someone else would
like to chime in.

[1]
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index b347d8ab2541..4ef3948d310d 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2499,6 +2499,8 @@ mt7531_setup(struct dsa_switch *ds)
  	mt7531_ind_c45_phy_write(priv, MT753X_CTRL_PHY_ADDR, MDIO_MMD_VEND2,
  				 CORE_PLL_GROUP4, val);
  
+	mt7530_rmw(priv, MT7530_MHWTRAP, CHG_STRAP | EEE_DIS, CHG_STRAP);
+
  	mt7531_setup_common(ds);
  
  	/* Setup VLAN ID 0 for VLAN-unaware bridges */
diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
index 3c3e7ae0e09b..1b3e81f6c90e 100644
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -299,11 +299,15 @@ enum mt7530_vlan_port_acc_frm {
  #define  MT7531_FORCE_DPX		BIT(29)
  #define  MT7531_FORCE_RX_FC		BIT(28)
  #define  MT7531_FORCE_TX_FC		BIT(27)
+#define  MT7531_FORCE_EEE100		BIT(26)
+#define  MT7531_FORCE_EEE1G		BIT(25)
  #define  MT7531_FORCE_MODE		(MT7531_FORCE_LNK | \
  					 MT7531_FORCE_SPD | \
  					 MT7531_FORCE_DPX | \
  					 MT7531_FORCE_RX_FC | \
-					 MT7531_FORCE_TX_FC)
+					 MT7531_FORCE_TX_FC | \
+					 MT7531_FORCE_EEE100 | \
+					 MT7531_FORCE_EEE1G)
  #define  PMCR_LINK_SETTINGS_MASK	(PMCR_TX_EN | PMCR_FORCE_SPEED_1000 | \
  					 PMCR_RX_EN | PMCR_FORCE_SPEED_100 | \
  					 PMCR_TX_FC_EN | PMCR_RX_FC_EN | \
@@ -457,6 +461,7 @@ enum mt7531_clk_skew {
  #define  XTAL_FSEL_M			BIT(7)
  #define  PHY_EN				BIT(6)
  #define  CHG_STRAP			BIT(8)
+#define  EEE_DIS			BIT(4)
  
  /* Register for hw trap modification */
  #define MT7530_MHWTRAP			0x7804

Thanks a lot!
Arınç

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ