From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= Date: Mon, 18 Mar 2024 10:46:24 +0300 Subject: [PATCH 2/3] net: dsa: mt7530: fix disabling EEE on failure on MT7531 and MT7988 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240318-for-net-mt7530-fix-eee-for-mt7531-mt7988-v1-2-3f17226344e8@arinc9.com> References: <20240318-for-net-mt7530-fix-eee-for-mt7531-mt7988-v1-0-3f17226344e8@arinc9.com> In-Reply-To: <20240318-for-net-mt7530-fix-eee-for-mt7531-mt7988-v1-0-3f17226344e8@arinc9.com> To: Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , =?utf-8?q?Ren=C3=A9_van_Dorst?= , Russell King , SkyLake Huang , Heiner Kallweit Cc: Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1710748010; l=1925; i=arinc.unal@arinc9.com; s=arinc9-patatt; h=from:subject:message-id; bh=DsZ4XshfmuCrCshjsgaop6WdjUbPqTHmbY230mILEL4=; b=ZS2k0DqfL9loUCm/WH/G9QtdGPn4jxGPZw06+JXJaEZak6hQGeq8Eo2REkCgRqRRkLXD1yaJo PcRkQSXM9Q6Az5i1Ibchy0fQ6e6xoBAq81gevdHjvamgoEvGlL5+Gp2 X-Developer-Key: i=arinc.unal@arinc9.com; a=ed25519; pk=VmvgMWwm73yVIrlyJYvGtnXkQJy9CvbaeEqPQO9Z4kA= X-Endpoint-Received: by B4 Relay for arinc.unal@arinc9.com/arinc9-patatt with auth_id=115 List-Id: B4 Relay Submissions The MT7531_FORCE_EEE1G and MT7531_FORCE_EEE100 bits let the PMCR_FORCE_EEE1G and PMCR_FORCE_EEE100 bits determine the 1G/100 EEE abilities of the MAC. If MT7531_FORCE_EEE1G and MT7531_FORCE_EEE100 are unset, the abilities are left to be determined by PHY auto polling. The commit 40b5d2f15c09 ("net: dsa: mt7530: Add support for EEE features") made it so that the PMCR_FORCE_EEE1G and PMCR_FORCE_EEE100 bits are set on mt753x_phylink_mac_link_up(). But it did not set the MT7531_FORCE_EEE1G and MT7531_FORCE_EEE100 bits. Because of this, EEE will be enabled on the switch MACs by polling the PHY, regardless of the result of phy_init_eee(). Define these bits and add them to MT7531_FORCE_MODE which is being used by the subdriver. With this, EEE will be prevented from being enabled on the switch MACs when phy_init_eee() fails. Fixes: 40b5d2f15c09 ("net: dsa: mt7530: Add support for EEE features") Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h index 509ed5362236..5b99aeca34b4 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 | \ -- 2.40.1