Skip to content

Commit 7f0b8a5

Browse files
Hariprasad Shenaidavem330
authored andcommitted
cxgb4: Fix MC1 memory offset calculation
Commit 6559a7e ("cxgb4: Cleanup macros so they follow the same style and look consistent") introduced a regression where reading MC1 memory in adapters where MC0 isn't present or MC0 size is not equal to MC1 size caused the adapter to crash due to incorrect computation of memoffset. Fix is to read the size of MC0 instead of MC1 for offset calculation Signed-off-by: Steve Wise <[email protected]> Signed-off-by: Hariprasad Shenai <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 12a8541 commit 7f0b8a5

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/chelsio/cxgb4

1 file changed

+1
-1
lines changed

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ int t4_memory_rw(struct adapter *adap, int win, int mtype, u32 addr,
492492
memoffset = (mtype * (edc_size * 1024 * 1024));
493493
else {
494494
mc_size = EXT_MEM0_SIZE_G(t4_read_reg(adap,
495-
MA_EXT_MEMORY1_BAR_A));
495+
MA_EXT_MEMORY0_BAR_A));
496496
memoffset = (MEM_MC0 * edc_size + mc_size) * 1024 * 1024;
497497
}
498498

0 commit comments

Comments
 (0)