linux/drivers/net/phy
Russell King (Oracle) e2668c34b7 net: phy: fix phy_ethtool_set_eee() incorrectly enabling LPI
When phy_ethtool_set_eee_noneg() detects a change in the LPI
parameters, it attempts to update phylib state and trigger the link
to cycle so the MAC sees the updated parameters.

However, in doing so, it sets phydev->enable_tx_lpi depending on
whether the EEE configuration allows the MAC to generate LPI without
taking into account the result of negotiation.

This can be demonstrated with a 1000base-T FD interface by:

 # ethtool --set-eee eno0 advertise 8   # cause EEE to be not negotiated
 # ethtool --set-eee eno0 tx-lpi off
 # ethtool --set-eee eno0 tx-lpi on

This results in being true, despite EEE not having been negotiated and:
 # ethtool --show-eee eno0
	EEE status: enabled - inactive
	Tx LPI: 250 (us)
	Supported EEE link modes:  100baseT/Full
	                           1000baseT/Full
	Advertised EEE link modes:  100baseT/Full
	                                         1000baseT/Full

Fix this by keeping track of whether EEE was negotiated via a new
eee_active member in struct phy_device, and include this state in
the decision whether phydev->enable_tx_lpi should be set.

Fixes: 3e43b903da ("net: phy: Immediately call adjust_link if only tx_lpi_enabled changes")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1tErSe-005RhB-2R@rmk-PC.armlinux.org.uk
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-11-28 09:26:13 +01:00
..
aquantia net: phy: aquantia: Add mdix config and reporting 2024-11-11 16:43:29 -08:00
mediatek net: phy: mediatek: add MT7530 & MT7531's PHY ID macros 2024-11-13 13:06:04 +00:00
mscc net: phy: use ethtool string helpers 2024-11-03 11:07:46 -08:00
qcom net: phy: use ethtool string helpers 2024-11-03 11:07:46 -08:00
Kconfig net: phy: mediatek: Re-organize MediaTek ethernet phy drivers 2024-11-13 13:06:04 +00:00
Makefile net: phy: mediatek: Re-organize MediaTek ethernet phy drivers 2024-11-13 13:06:04 +00:00
adin.c net: phy: use ethtool string helpers 2024-11-03 11:07:46 -08:00
adin1100.c
air_en8811h.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
amd.c
ax88796b.c
ax88796b_rust.rs rust: net::phy unified read/write API for C22 and C45 registers 2024-08-30 10:27:35 +01:00
bcm-cygnus.c
bcm-phy-lib.c net: phy: broadcom: use genphy_c45_an_config_eee_aneg in bcm_config_lre_aneg 2024-11-07 20:31:06 -08:00
bcm-phy-lib.h net: phy: bcm-phy-lib: Implement BroadR-Reach link modes 2024-07-14 20:38:35 -07:00
bcm-phy-ptp.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
bcm7xxx.c
bcm63xx.c
bcm87xx.c
bcm54140.c
bcm84881.c net: phy: bcm84881: Fix some error handling paths 2024-10-04 16:19:00 -07:00
broadcom.c net: phy: bcm-phy-lib: Implement BroadR-Reach link modes 2024-07-14 20:38:35 -07:00
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83td510.c phy: dp83td510: Utilize ALCD for cable length measurement when link is active 2024-08-26 09:33:58 -07:00
dp83tg720.c net: phy: dp83tg720: Add cable testing support 2024-08-16 10:16:26 -07:00
dp83640.c net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
dp83640_reg.h
dp83822.c net: phy: dp83822: Configure RMII mode on DP83825 devices 2024-10-31 15:42:58 +01:00
dp83848.c net: phy: ti: add PHY_RST_AFTER_CLK_EN flag 2024-11-05 17:46:03 -08:00
dp83867.c
dp83869.c net: phy: dp83869: fix status reporting for 1000base-x autonegotiation 2024-11-14 19:11:03 -08:00
et1011c.c
fixed_phy.c
icplus.c net: phy: use ethtool string helpers 2024-11-03 11:07:46 -08:00
intel-xway.c net: phy: intel-xway: add support for PHY LEDs 2024-10-15 11:24:22 +02:00
linkmode.c
lxt.c
marvell-88q2xxx.c net: phy: marvell-88q2xxx: Enable auto negotiation for mv88q2110 2024-10-08 18:18:16 -07:00
marvell-88x2222.c net: phy: add helpers to handle sfp phy connect/disconnect 2024-08-23 13:04:34 +01:00
marvell.c net: phy: use ethtool string helpers 2024-11-03 11:07:46 -08:00
marvell10g.c net: phy: add helpers to handle sfp phy connect/disconnect 2024-08-23 13:04:34 +01:00
mdio-boardinfo.c
mdio-boardinfo.h
mdio-open-alliance.h
mdio_bus.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
mdio_device.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
mdio_devres.c
meson-gxl.c
micrel.c net: phy: convert eee_broken_modes to a linkmode bitmap 2024-11-14 18:01:37 -08:00
microchip.c net: phy: microchip: lan937x: add support for 100BaseTX PHY 2024-07-09 15:12:04 +02:00
microchip_t1.c net: phy: microchip_t1: Clause-45 PHY loopback support for LAN887x 2024-11-15 15:22:10 -08:00
microchip_t1s.c net: phy: microchip_t1s: configure collision detection based on PLCA mode 2024-10-11 15:54:40 -07:00
mii_timestamper.c
motorcomm.c net: phy: Add driver for Motorcomm yt8821 2.5G ethernet phy 2024-09-05 15:21:12 +02:00
mxl-gpy.c net: phy: mxl-gpy: correctly describe LED polarity 2024-10-15 11:24:21 +02:00
national.c
ncn26000.c
nxp-c45-tja11xx-macsec.c
nxp-c45-tja11xx.c net: phy: use ethtool string helpers 2024-11-03 11:07:46 -08:00
nxp-c45-tja11xx.h net: phy: c45-tja11xx: add support for outputting RMII reference clock 2024-10-15 10:44:52 +02:00
nxp-cbtx.c net: phy: use ethtool string helpers 2024-11-03 11:07:46 -08:00
nxp-tja11xx.c
open_alliance_helpers.c phy: Add Open Alliance helpers for the PHY framework 2024-08-16 10:16:26 -07:00
open_alliance_helpers.h phy: Add Open Alliance helpers for the PHY framework 2024-08-16 10:16:26 -07:00
phy-c45.c net: phy: fix phy_ethtool_set_eee() incorrectly enabling LPI 2024-11-28 09:26:13 +01:00
phy-core.c net: phy: convert eee_broken_modes to a linkmode bitmap 2024-11-14 18:01:37 -08:00
phy.c net: phy: fix phy_ethtool_set_eee() incorrectly enabling LPI 2024-11-28 09:26:13 +01:00
phy_device.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-11-19 13:56:02 +01:00
phy_led_triggers.c
phy_link_topology.c net: phy: Introduce ethernet link topology representation 2024-08-23 13:04:34 +01:00
phylink.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-11-14 11:29:15 -08:00
qsemi.c
qt2025.rs net: phy: qt2025: Fix warning: unused import DeviceId 2024-10-02 17:44:00 -07:00
realtek.c net: phy: realtek: add RTL8125D-internal PHY 2024-10-20 11:06:47 -05:00
rockchip.c
sfp-bus.c net: sfp: Add helper to return the SFP bus name 2024-08-23 13:04:34 +01:00
sfp.c net: sfp: change quirks for Alcatel Lucent G-010S-P 2024-10-21 10:33:22 +02:00
sfp.h
smsc.c net: phy: smsc: use devm_clk_get_optional_enabled_with_rate() 2024-10-08 15:36:28 -07:00
spi_ks8995.c
ste10Xp.c
stubs.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c net: phy: vitesse: implement MDI-X configuration in vsc73xx 2024-08-27 14:26:49 -07:00
xilinx_gmii2rgmii.c net: phy: xilinx-gmii2rgmii: Adopt clock support 2024-05-29 13:10:57 +01:00