projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e540e3b
)
net: phy: Add phy library support to check supported list when autoneg is enabled
author
Divya Koppera
<divya.koppera@microchip.com>
Wed, 21 Aug 2024 05:59:05 +0000
(11:29 +0530)
committer
Jakub Kicinski
<kuba@kernel.org>
Mon, 26 Aug 2024 16:21:15 +0000
(09:21 -0700)
Adds support in phy library to accept autoneg configuration only when
feature is enabled in supported list.
Signed-off-by: Divya Koppera <divya.koppera@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link:
https://patch.msgid.link/20240821055906.27717-2-Divya.Koppera@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/phy/phy.c
b/drivers/net/phy/phy.c
index 785182fa5fe01f950de7cb5082865fd8c3c5ba3a..cba3af926429d890b2d9a0fc10c07c359f132d90 100644
(file)
--- a/
drivers/net/phy/phy.c
+++ b/
drivers/net/phy/phy.c
@@
-1089,7
+1089,10
@@
int phy_ethtool_ksettings_set(struct phy_device *phydev,
if (autoneg != AUTONEG_ENABLE && autoneg != AUTONEG_DISABLE)
return -EINVAL;
- if (autoneg == AUTONEG_ENABLE && linkmode_empty(advertising))
+ if (autoneg == AUTONEG_ENABLE &&
+ (linkmode_empty(advertising) ||
+ !linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
+ phydev->supported)))
return -EINVAL;
if (autoneg == AUTONEG_DISABLE &&