Skip to content
/ linux Public

Commit 0a02e28

Browse files
dthompsokuba-moo
authored andcommitted
mlxbf_gige: increase MDIO polling rate to 5us
This patch increases the polling rate used by the mlxbf_gige driver on the MDIO bus. The previous polling rate was every 100us, and the new rate is every 5us. With this change the amount of time spent waiting for the MDIO BUSY signal to de-assert drops from ~100us to ~27us for each operation. Signed-off-by: David Thompson <davthompson@nvidia.com> Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com> Link: https://lore.kernel.org/r/20220505162309.20050-1-davthompson@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 53e2cb3 commit 0a02e28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ static int mlxbf_gige_mdio_read(struct mii_bus *bus, int phy_add, int phy_reg)
105105
writel(cmd, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET);
106106

107107
ret = readl_poll_timeout_atomic(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET,
108-
val, !(val & MLXBF_GIGE_MDIO_GW_BUSY_MASK), 100, 1000000);
108+
val, !(val & MLXBF_GIGE_MDIO_GW_BUSY_MASK),
109+
5, 1000000);
109110

110111
if (ret) {
111112
writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET);
@@ -137,7 +138,8 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add,
137138

138139
/* If the poll timed out, drop the request */
139140
ret = readl_poll_timeout_atomic(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET,
140-
temp, !(temp & MLXBF_GIGE_MDIO_GW_BUSY_MASK), 100, 1000000);
141+
temp, !(temp & MLXBF_GIGE_MDIO_GW_BUSY_MASK),
142+
5, 1000000);
141143

142144
return ret;
143145
}

0 commit comments

Comments
 (0)