On Mon, Jul 06, 2026 at 11:27:35PM -0700, muhammad.nazim.amirul.nazle.asmade@altera.com wrote:
From: Nazim Amirul <redacted>
When using ethtool to change speed and duplex on a phylink-managed
interface with a PHY attached, the requested speed/duplex combination
is not validated against the MAC's supported capabilities before being
passed down to the PHY layer.
How are you invoking ethtool here? And what other invocations have you
tested, with this patch in place?
quoted hunk ↗ jump to hunk
@@ -2989,6 +2989,10 @@ int phylink_ethtool_ksettings_set(struct phylink *pl,
if (pl->phydev) {
struct ethtool_link_ksettings phy_kset = *kset;
+ if (!phy_caps_lookup(kset->base.speed, kset->base.duplex,
+ pl->supported, true))
+ return -EINVAL;
Are base.speed and base.duplex always set? When looking at
phy_ethtool_ksettings_set() the values are only used when base.autoneg
is false. So maybe they are not always valid?
Andrew