linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] atl1c: improve reliability of mdio ops on Mikrotik 10/25G NIC
@ 2021-06-17 12:25 Gatis Peisenieks
  2021-06-17 14:35 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Gatis Peisenieks @ 2021-06-17 12:25 UTC (permalink / raw)
  To: chris.snook, davem, kuba, hkallweit1, jesse.brandeburg,
	dchickles, tully, eric.dumazet
  Cc: netdev, linux-kernel, Gatis Peisenieks

MDIO ops on Mikrotik 10/25G NIC can occasionally take longer
to complete. This increases the timeout from 1.2 to 12ms.

Signed-off-by: Gatis Peisenieks <gatis@mikrotik.com>
---
 drivers/net/ethernet/atheros/atl1c/atl1c_hw.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
index c567c920628f..15523077490f 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
@@ -290,7 +290,7 @@ void atl1c_post_phy_linkchg(struct atl1c_hw *hw, u16 link_speed);
 #define MDIO_CTRL_REG_SHIFT		16
 #define MDIO_CTRL_DATA_MASK		0xFFFFUL
 #define MDIO_CTRL_DATA_SHIFT		0
-#define MDIO_MAX_AC_TO			120	/* 1.2ms timeout for slow clk */
+#define MDIO_MAX_AC_TO			1200	/* 12ms timeout for slow clk */
 
 /* for extension reg access */
 #define REG_MDIO_EXTN			0x1448
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] atl1c: improve reliability of mdio ops on Mikrotik 10/25G NIC
  2021-06-17 12:25 [PATCH net] atl1c: improve reliability of mdio ops on Mikrotik 10/25G NIC Gatis Peisenieks
@ 2021-06-17 14:35 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2021-06-17 14:35 UTC (permalink / raw)
  To: Gatis Peisenieks
  Cc: chris.snook, davem, kuba, hkallweit1, jesse.brandeburg,
	dchickles, tully, eric.dumazet, netdev, linux-kernel

On Thu, Jun 17, 2021 at 03:25:53PM +0300, Gatis Peisenieks wrote:
> MDIO ops on Mikrotik 10/25G NIC can occasionally take longer
> to complete. This increases the timeout from 1.2 to 12ms.

That seems a very long time. A C22 transaction is 64 bits, and it is
clocked out at 2.5MHz. So it should take (1/2.5*1000*1000)*64 =
0.0000256s, i.e. 0.0256ms. 1.2ms is already 50 times longer than
needed, and now you are suggesting to make it 500 times longer than
needed?

Are you sure there is not something else going on here?  I notice
atl1c_stop_phy_polling() does not check the return from
atl1c_wait_mdio_idle(). Maybe this is your problem, you are not
waiting long enough for the MAC to stop directly accessing the PHY?

	Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-17 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 12:25 [PATCH net] atl1c: improve reliability of mdio ops on Mikrotik 10/25G NIC Gatis Peisenieks
2021-06-17 14:35 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).