Skip to content

Commit 907a076

Browse files
elvinongbldavem330
authored andcommitted
net: stmmac: xgmac: fix incorrect XGMAC_VLAN_TAG register writting
We should always do a read of current value of XGMAC_VLAN_TAG instead of directly overwriting the register value. Fixes: 3cd1cfc ("net: stmmac: Implement VLAN Hash Filtering in XGMAC") Signed-off-by: Ong Boon Leong <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9eeeb3c commit 907a076

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,9 @@ static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash,
569569

570570
writel(value, ioaddr + XGMAC_PACKET_FILTER);
571571

572-
value = XGMAC_VLAN_VTHM | XGMAC_VLAN_ETV;
572+
value = readl(ioaddr + XGMAC_VLAN_TAG);
573+
574+
value |= XGMAC_VLAN_VTHM | XGMAC_VLAN_ETV;
573575
if (is_double) {
574576
value |= XGMAC_VLAN_EDVLP;
575577
value |= XGMAC_VLAN_ESVL;
@@ -584,7 +586,9 @@ static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash,
584586

585587
writel(value, ioaddr + XGMAC_PACKET_FILTER);
586588

587-
value = XGMAC_VLAN_ETV;
589+
value = readl(ioaddr + XGMAC_VLAN_TAG);
590+
591+
value |= XGMAC_VLAN_ETV;
588592
if (is_double) {
589593
value |= XGMAC_VLAN_EDVLP;
590594
value |= XGMAC_VLAN_ESVL;

0 commit comments

Comments
 (0)