Skip to contentSkip to conversation

net: stmmac: fix ethtool flow control not able to get/set

PATCH In review Weifeng Voon 3 participants 3 messages May 20, 2019 – May 21, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: fix ethtool flow control not able to get/set

From: "Tan, Tee Min" <[email protected]>

Currently ethtool was not able to get/set the flow control due to a missing "!". It will always return -EOPNOTSUPP even the device is flow control supported.

This patch fixes the condition check for ethtool flow control get/set function for ETHTOOL_LINK_MODE_Asym_Pause_BIT.

Fixes 3c1bcc8614db (“net: ethernet: Convert phydev advertize and supported from u32 to link mode”)
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +2 -2
index 3c749c3..e09522c 100644
@@ -460,7 +460,7 @@ static void stmmac_ethtool_gregs(struct net_device *dev,
 	} else {
 		if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
 				       netdev->phydev->supported) ||
-		    linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
+		    !linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
 				      netdev->phydev->supported))
 			return;
 	}
@@ -491,7 +491,7 @@ static void stmmac_ethtool_gregs(struct net_device *dev,
 	} else {
 		if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
 				       phy->supported) ||
-		    linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
+		    !linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
 				      phy->supported))
 			return -EOPNOTSUPP;
 	}
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Weifeng Voon

From: "Tan, Tee Min" <[email protected]>

Currently ethtool was not able to get/set the flow control due to a missing "!". It will always return -EOPNOTSUPP even the device is flow control supported.

Quoted 7 lines

This patch fixes the condition check for ethtool flow control get/set function for ETHTOOL_LINK_MODE_Asym_Pause_BIT.

Fixes 3c1bcc8614db (“net: ethernet: Convert phydev advertize and supported from u32 to link mode”)

Upps, my bad. Sorry.

Andrew

maintainer
#2 lore raw
In reply to Weifeng Voon

From: Weifeng Voon <[email protected]>
Date: Tue, 21 May 2019 12:55:42 +0800

Quoted 6 lines

From: "Tan, Tee Min" <[email protected]>

Currently ethtool was not able to get/set the flow control due to a missing "!". It will always return -EOPNOTSUPP even the device is flow control supported.

Quoted 7 lines

This patch fixes the condition check for ethtool flow control get/set function for ETHTOOL_LINK_MODE_Asym_Pause_BIT.

Fixes 3c1bcc8614db (“net: ethernet: Convert phydev advertize and supported from u32 to link mode”)

Applied and queued up for -stable.