Skip to content

Commit a94bcd0

Browse files
wingmankwokdavem330
authored andcommitted
net: netcp: Fixes hw statistics module base setting error
This patch fixes error in the setting of the hw statistics module base for K2HK platform. In K2HK although there are 4 hw statistics modules, but only 2 are visible at a time. Thus when setting up the pointers to the base of the corresponding hw statistics modules, modules 0 and 2 should point to one base, while modules 1 and 3 should point to the other. Signed-off-by: WingMan Kwok <w-kwok2@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c0f54ed commit a94bcd0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/ti/netcp_ethss.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2675,10 +2675,14 @@ static int set_gbe_ethss14_priv(struct gbe_priv *gbe_dev,
26752675
gbe_dev->sgmii_port_regs = gbe_dev->ss_regs + GBE13_SGMII_MODULE_OFFSET;
26762676
gbe_dev->host_port_regs = gbe_dev->switch_regs + GBE13_HOST_PORT_OFFSET;
26772677

2678+
/* K2HK has only 2 hw stats modules visible at a time, so
2679+
* module 0 & 2 points to one base and
2680+
* module 1 & 3 points to the other base
2681+
*/
26782682
for (i = 0; i < gbe_dev->max_num_slaves; i++) {
26792683
gbe_dev->hw_stats_regs[i] =
26802684
gbe_dev->switch_regs + GBE13_HW_STATS_OFFSET +
2681-
(GBE_HW_STATS_REG_MAP_SZ * i);
2685+
(GBE_HW_STATS_REG_MAP_SZ * (i & 0x1));
26822686
}
26832687

26842688
gbe_dev->ale_reg = gbe_dev->switch_regs + GBE13_ALE_OFFSET;

0 commit comments

Comments
 (0)