Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Octeontx2-af: Fix an issue in firmware shared data reserved space

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hariprasad Kelam and committed by
David S. Miller
b8b85d04 c2a22688

+4 -1
+2
drivers/net/ethernet/marvell/octeontx2/af/rvu.c
··· 817 817 err = cgx_get_fwdata_base(&fwdbase); 818 818 if (err) 819 819 goto fail; 820 + 821 + BUILD_BUG_ON(offsetof(struct rvu_fwdata, cgx_fw_data) > FWDATA_CGX_LMAC_OFFSET); 820 822 rvu->fwdata = ioremap_wc(fwdbase, sizeof(struct rvu_fwdata)); 821 823 if (!rvu->fwdata) 822 824 goto fail;
+2 -1
drivers/net/ethernet/marvell/octeontx2/af/rvu.h
··· 469 469 u32 ptp_ext_clk_rate; 470 470 u32 ptp_ext_tstamp; 471 471 struct channel_fwdata channel_data; 472 - #define FWDATA_RESERVED_MEM 1014 472 + #define FWDATA_RESERVED_MEM 958 473 473 u64 reserved[FWDATA_RESERVED_MEM]; 474 474 #define CGX_MAX 9 475 475 #define CGX_LMACS_MAX 4 476 476 #define CGX_LMACS_USX 8 477 + #define FWDATA_CGX_LMAC_OFFSET 10536 477 478 union { 478 479 struct cgx_lmac_fwdata_s 479 480 cgx_fw_data[CGX_MAX][CGX_LMACS_MAX];