diff mbox series

[RFC,net-next,1/1] net: phy: Add capability to enable/disable 2.5G/5G/10G AN in ethtool

Message ID 20241014060603.29878-1-SkyLake.Huang@mediatek.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series [RFC,net-next,1/1] net: phy: Add capability to enable/disable 2.5G/5G/10G AN in ethtool | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 34 this patch: 34
netdev/source_inline success Was 0 now: 0

Commit Message

SkyLake Huang (黃啟澤) Oct. 14, 2024, 6:06 a.m. UTC
From: "SkyLake.Huang" <skylake.huang@mediatek.com>

For phy loopback test, we need to disable AN. In this way,
users can disable/enable phy AN more conveniently.

Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
---
 drivers/net/phy/phy.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Andrew Lunn Oct. 14, 2024, 1:36 p.m. UTC | #1
On Mon, Oct 14, 2024 at 02:06:03PM +0800, Sky Huang wrote:
> From: "SkyLake.Huang" <skylake.huang@mediatek.com>
> 
> For phy loopback test, we need to disable AN. In this way,
> users can disable/enable phy AN more conveniently.

Please take a look at:

https://lore.kernel.org/netdev/20241013202430.93851-1-gerhard@engleder-embedded.com/T/

We need a good understanding of how 802.3 expects loopback to be used,
and a commit message based on what 802.3 says. Our current
understanding is that 1G and above requires auto-neg for correct
operation, so we don't want to allow autoneg to be disabled in normal
operation. It could be we need to special case loopback somehow.

	Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 14224e0..10772f8 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1085,7 +1085,10 @@  int phy_ethtool_ksettings_set(struct phy_device *phydev,
 		return -EINVAL;
 
 	if (autoneg == AUTONEG_DISABLE &&
-	    ((speed != SPEED_1000 &&
+	    ((speed != SPEED_10000 &&
+	      speed != SPEED_5000 &&
+	      speed != SPEED_2500 &&
+	      speed != SPEED_1000 &&
 	      speed != SPEED_100 &&
 	      speed != SPEED_10) ||
 	     (duplex != DUPLEX_HALF &&