]> Gentwo Git Trees - linux/.git/commit
net: phy: aquantia: use cached GLOBAL_CFG registers in aqr107_read_rate()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 21 Aug 2025 15:20:15 +0000 (18:20 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 25 Aug 2025 17:54:15 +0000 (10:54 -0700)
commit832b63c70ef0fa40747627c78c5b849dbe6e6615
tree829d98edfa0a44b165e8d62894e97c980256d8f0
parent6fa022088b60338cf995c9238fe16bcea5c27484
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>
drivers/net/phy/aquantia/aquantia_main.c