Skip to contentSkip to conversation

net: mvpp2: TCAM entry enable should be written after SRAM data

PATCH Applied [email protected] 2 participants 2 messages Feb 1, 2021 – Feb 2, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvpp2: TCAM entry enable should be written after SRAM data

From: Stefan Chulski <[email protected]>

Last TCAM data contains TCAM enable bit.
It should be written after SRAM data before entry enabled.

Fixes 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c +5 -5
index 0b2ff08..f4a905f 100644
@@ -29,16 +29,16 @@ static int mvpp2_prs_hw_write(struct mvpp2 *priv, struct mvpp2_prs_entry *pe)
 	/* Clear entry invalidation bit */
 	pe->tcam[MVPP2_PRS_TCAM_INV_WORD] &= ~MVPP2_PRS_TCAM_INV_MASK;
 
-	/* Write tcam index - indirect access */
-	mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index);
-	for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++)
-		mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]);
-
 	/* Write sram index - indirect access */
 	mvpp2_write(priv, MVPP2_PRS_SRAM_IDX_REG, pe->index);
 	for (i = 0; i < MVPP2_PRS_SRAM_WORDS; i++)
 		mvpp2_write(priv, MVPP2_PRS_SRAM_DATA_REG(i), pe->sram[i]);
 
+	/* Write tcam index - indirect access */
+	mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index);
+	for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++)
+		mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]);
+
 	return 0;
 }
 
Signature · 1 line
1.9.1
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 9 lines · On Mon, 1 Feb 2021 11:35:39 +0200 you wrote:

From: Stefan Chulski <[email protected]>

Last TCAM data contains TCAM enable bit.
It should be written after SRAM data before entry enabled.

Fixes 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")

[...]

Here is the summary with links:
- [net] net: mvpp2: TCAM entry enable should be written after SRAM data

    https://git.kernel.org/netdev/net/c/43f4a20a1266

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