Loading
net: phy: aquantia: use cached GLOBAL_CFG registers in aqr107_read_rate()
aqr107_read_rate() - called from aqr107_read_status() even periodically if there is no PHY IRQ - currently reads GLOBAL_CFG registers to determine what kind of rate adaptation is in use for the current phydev->speed. However, GLOBAL_CFG registers are runtime invariants, so accessing the slow MDIO bus is unnecessary. Reimplement aqr107_read_rate() by reading from the priv->global_cfg[i].rade_adapt variables (where i is the entry corresponding to the current phydev->speed). Making this change also helps disentangle the code delta between aqr105_read_rate() and aqr107_read_rate(). They are now identical up to the code snippet which iterates over priv->global_cfg[]. This will help eliminate the duplicate code in the upcoming patch. Signed-off-by:Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-9-vladimir.oltean@nxp.com Signed-off-by:
Jakub Kicinski <kuba@kernel.org>