* [net-next] Octeontx2-af: Fix an issue in firmware shared data reserved space
@ 2024-03-01 11:03 Hariprasad Kelam
2024-03-04 10:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Hariprasad Kelam @ 2024-03-01 11:03 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: kuba, davem, sgoutham, gakula, jerinj, lcherian, sbhatta, hkelam,
naveenm, edumazet, pabeni
The last patch which added support to extend the firmware shared
data to add channel data information has introduced a bug due to
the reserved space not adjusted accordingly.
This patch fixes the issue and also adds BUILD_BUG to avoid this
regression error.
Fixes: 997814491cee ("Octeontx2-af: Fetch MAC channel info from firmware")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 2 ++
drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
index edd12d09dc89..07d4859de53a 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
@@ -817,6 +817,8 @@ static int rvu_fwdata_init(struct rvu *rvu)
err = cgx_get_fwdata_base(&fwdbase);
if (err)
goto fail;
+
+ BUILD_BUG_ON(offsetof(struct rvu_fwdata, cgx_fw_data) > FWDATA_CGX_LMAC_OFFSET);
rvu->fwdata = ioremap_wc(fwdbase, sizeof(struct rvu_fwdata));
if (!rvu->fwdata)
goto fail;
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
index de8eba902276..f390525a6217 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
@@ -469,11 +469,12 @@ struct rvu_fwdata {
u32 ptp_ext_clk_rate;
u32 ptp_ext_tstamp;
struct channel_fwdata channel_data;
-#define FWDATA_RESERVED_MEM 1014
+#define FWDATA_RESERVED_MEM 958
u64 reserved[FWDATA_RESERVED_MEM];
#define CGX_MAX 9
#define CGX_LMACS_MAX 4
#define CGX_LMACS_USX 8
+#define FWDATA_CGX_LMAC_OFFSET 10536
union {
struct cgx_lmac_fwdata_s
cgx_fw_data[CGX_MAX][CGX_LMACS_MAX];
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net-next] Octeontx2-af: Fix an issue in firmware shared data reserved space
2024-03-01 11:03 [net-next] Octeontx2-af: Fix an issue in firmware shared data reserved space Hariprasad Kelam
@ 2024-03-04 10:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-04 10:20 UTC (permalink / raw)
To: Hariprasad Kelam
Cc: netdev, linux-kernel, kuba, davem, sgoutham, gakula, jerinj,
lcherian, sbhatta, naveenm, edumazet, pabeni
Hello:
This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Fri, 1 Mar 2024 16:33:14 +0530 you wrote:
> The last patch which added support to extend the firmware shared
> data to add channel data information has introduced a bug due to
> the reserved space not adjusted accordingly.
>
> This patch fixes the issue and also adds BUILD_BUG to avoid this
> regression error.
>
> [...]
Here is the summary with links:
- [net-next] Octeontx2-af: Fix an issue in firmware shared data reserved space
https://git.kernel.org/netdev/net-next/c/b8b85d048936
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:[~2024-03-04 10:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-01 11:03 [net-next] Octeontx2-af: Fix an issue in firmware shared data reserved space Hariprasad Kelam
2024-03-04 10:20 ` 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