Netdev List
 help / color / mirror / Atom feed
* [PATCH net] octeontx2-af: mcs: Clear stale X2P calibration state before calibration
@ 2026-09-01  9:43 nshettyj
  2026-09-04 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: nshettyj @ 2026-09-01  9:43 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: Viswajith Murali, Nitin Shetty J, Sunil Goutham, Ratheesh Kannoth,
	Geetha sowjanya, Subbaraya Sundeep, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vamsi Attunuru

From: Viswajith Murali <viswajithm@marvell.com>

Some firmware versions leave MCSX_MIL_GLOBAL bit 5 set on boot.
If the bit is already set when the driver attempts X2P calibration,
the hardware sees no rising edge and calibration never triggers.
Clear the bit and wait briefly before starting calibration to ensure
a clean rising edge.

Fixes: ca7f49ff8846 ("octeontx2-af: cn10k: Introduce driver for macsec block.")
Signed-off-by: Nitin Shetty J <nshettyj@marvell.com>
Signed-off-by: Viswajith Murali <viswajithm@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/mcs.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs.c
index a07e0b3d8d00..211c10aa5880 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/mcs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs.c
@@ -1417,6 +1417,16 @@ static int mcs_x2p_calibration(struct mcs *mcs)
 	int i, err = 0;
 	u64 val;
 
+	/* Clear any stale calibration state left by firmware/bootloader.
+	 * Some firmware versions may leave MCSX_MIL_GLOBAL bit 5 set,
+	 * preventing the hardware from detecting the rising edge needed to
+	 * trigger X2P calibration.
+	 */
+	val = mcs_reg_read(mcs, MCSX_MIL_GLOBAL);
+	val &= ~BIT_ULL(5);
+	mcs_reg_write(mcs, MCSX_MIL_GLOBAL, val);
+	usleep_range(100, 200);
+
 	/* set X2P calibration */
 	val = mcs_reg_read(mcs, MCSX_MIL_GLOBAL);
 	val |= BIT_ULL(5);
-- 
2.48.1


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

* Re: [PATCH net] octeontx2-af: mcs: Clear stale X2P calibration state before calibration
  2026-09-01  9:43 [PATCH net] octeontx2-af: mcs: Clear stale X2P calibration state before calibration nshettyj
@ 2026-09-04 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-04 22:50 UTC (permalink / raw)
  To: Nitin Shetty J
  Cc: netdev, linux-kernel, viswajithm, sgoutham, rkannoth, gakula,
	sbhatta, andrew+netdev, davem, edumazet, kuba, pabeni, vattunuru

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 1 Sep 2026 15:13:17 +0530 you wrote:
> From: Viswajith Murali <viswajithm@marvell.com>
> 
> Some firmware versions leave MCSX_MIL_GLOBAL bit 5 set on boot.
> If the bit is already set when the driver attempts X2P calibration,
> the hardware sees no rising edge and calibration never triggers.
> Clear the bit and wait briefly before starting calibration to ensure
> a clean rising edge.
> 
> [...]

Here is the summary with links:
  - [net] octeontx2-af: mcs: Clear stale X2P calibration state before calibration
    https://git.kernel.org/netdev/net/c/1f29543126dd

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-09-04 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01  9:43 [PATCH net] octeontx2-af: mcs: Clear stale X2P calibration state before calibration nshettyj
2026-09-04 22:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox