]> www.infradead.org Git - users/hch/misc.git/commit
net: stmmac: move tx_lpi_timer tracking to phylib
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 8 Jan 2025 16:47:38 +0000 (16:47 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Jan 2025 01:51:00 +0000 (17:51 -0800)
commit1991819debaa22ee75f4163f3b17f9e545f3ae98
tree9ec22acb7eac99a1a942789888f7a6282671be13
parentcf337105ad38564d7855151889a7315da73119d0
net: stmmac: move tx_lpi_timer tracking to phylib

When stmmac_ethtool_op_get_eee() is called, stmmac sets the tx_lpi_timer
and tx_lpi_enabled members, and then calls into phylink and thus phylib.
phylib overwrites these members.

phylib will also cause a link down/link up transition when settings
that impact the MAC have been changed.

Convert stmmac to use the tx_lpi_timer setting in struct phy_device,
updating priv->tx_lpi_timer each time when the link comes up, rather
than trying to maintain this user setting itself. We initialise the
phylib tx_lpi_timer setting by doing a get_ee-modify-set_eee sequence
with the last known priv->tx_lpi_timer value. In order for this to work
correctly, we also need this member to be initialised earlier.

As stmmac_eee_init() is no longer called outside of stmmac_main.c, make
it static.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1tVZDW-0002Jr-W3@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c