Skip to contentSkip to conversation

eth: fbnic: fix csr boundary for RPM RAM section

PATCH Applied Mohsin Bashir 5 participants 5 messages Dec 18, 2024 – Dec 23, 2024

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

PATCH 1/1 eth: fbnic: fix csr boundary for RPM RAM section

The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end condition for each section by adding an offset of 1. However, the RPC RAM section, which is dumped differently from other sections, does not rely on this macro and instead directly uses end boundary address. Hence, subtracting 1 from the end address results in skipping a register.

Fixes 3d12862b216d (“eth: fbnic: Add support to dump registers”)

---
 drivers/net/ethernet/meta/fbnic/fbnic_csr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/meta/fbnic/fbnic_csr.c +1 -1
index 2118901b25e9..aeb9f333f4c7 100644
@@ -64,7 +64,7 @@ static void fbnic_csr_get_regs_rpc_ram(struct fbnic_dev *fbd, u32 **data_p)
 	u32 i, j;
 
 	*(data++) = start;
-	*(data++) = end - 1;
+	*(data++) = end;
 
 	/* FBNIC_RPC_TCAM_ACT */
 	for (i = 0; i < FBNIC_RPC_TCAM_ACT_NUM_ENTRIES; i++) {
Signature · 1 line
2.43.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Mohsin Bashir

The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end condition for each section by adding an offset of 1. However, the RPC RAM section, which is dumped differently from other sections, does not rely on this macro and instead directly uses end boundary address. Hence, subtracting 1 from the end address results in skipping a register.

Fixes 3d12862b216d (âeth: fbnic: Add support to dump registersâ)

---
 drivers/net/ethernet/meta/fbnic/fbnic_csr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/meta/fbnic/fbnic_csr.c +0 -0
index 2118901b25e9..aeb9f333f4c7 100644

drivers/net/ethernet/meta/fbnic/fbnic_csr.c static void fbnic_csr_get_regs_rpc_ram(struct fbnic_dev *fbd, u32 **data_p) · line 70

Quoted 8 lines
drivers/net/ethernet/meta/fbnic/fbnic_csr.c +1 -1
@@ -64,7 +64,7 @@ static void fbnic_csr_get_regs_rpc_ram(struct fbnic_dev *fbd, u32 **data_p)
 	u32 i, j;
 
 	*(data++) = start;
-	*(data++) = end - 1;
+	*(data++) = end;
 
 	/* FBNIC_RPC_TCAM_ACT */
 	for (i = 0; i < FBNIC_RPC_TCAM_ACT_NUM_ENTRIES; i++) {

Thanks,

Quoted 1 line

2.43.5

#2 lore raw
In reply to Mohsin Bashir
Quoted 5 lines · Mohsin Bashir

The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end condition for each section by adding an offset of 1. However, the RPC RAM section, which is dumped differently from other sections, does not rely on this macro and instead directly uses end boundary address. Hence, subtracting 1 from the end address results in skipping a register.

Maybe it would be better to actually use FBNIC_BOUNDS macro, to make it the same as all the others, and so avoid errors like this because it is special?

Andrew

maintainer
#3 lore raw
Quoted 10 lines · On Thu, 19 Dec 2024 09:25:41 +0100 Andrew Lunn wrote:
Quoted 5 lines · Mohsin Bashir

The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end condition for each section by adding an offset of 1. However, the RPC RAM section, which is dumped differently from other sections, does not rely on this macro and instead directly uses end boundary address. Hence, subtracting 1 from the end address results in skipping a register.

Maybe it would be better to actually use FBNIC_BOUNDS macro, to make it the same as all the others, and so avoid errors like this because it is special?

That may require changing the format / contents of the dump a bit to include unimplemented registers (which would read as ff). Note that the subject is incorrect, the patch is for net, so the one-liner fix is more appealing at this stage. But I may be biased...

#4 lore raw
In reply to Mohsin Bashir
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Wed, 18 Dec 2024 15:25:58 -0800 you wrote:

The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end condition for each section by adding an offset of 1. However, the RPC RAM section, which is dumped differently from other sections, does not rely on this macro and instead directly uses end boundary address. Hence, subtracting 1 from the end address results in skipping a register.

Fixes 3d12862b216d (“eth: fbnic: Add support to dump registers”)

[...]

Here is the summary with links:
- [net-next] eth: fbnic: fix csr boundary for RPM RAM section

    https://git.kernel.org/netdev/net/c/a072ffd896ef

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html