Skip to content

Commit

Permalink
net: stmmac: xgmac: fix incorrect XGMAC_VLAN_TAG register writting
Browse files Browse the repository at this point in the history
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 <boon.leong.ong@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ong Boon Leong authored and David S. Miller committed Feb 7, 2020
1 parent 9eeeb3c commit 907a076
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,9 @@ static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash,

writel(value, ioaddr + XGMAC_PACKET_FILTER);

value = XGMAC_VLAN_VTHM | XGMAC_VLAN_ETV;
value = readl(ioaddr + XGMAC_VLAN_TAG);

value |= XGMAC_VLAN_VTHM | XGMAC_VLAN_ETV;
if (is_double) {
value |= XGMAC_VLAN_EDVLP;
value |= XGMAC_VLAN_ESVL;
Expand All @@ -584,7 +586,9 @@ static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash,

writel(value, ioaddr + XGMAC_PACKET_FILTER);

value = XGMAC_VLAN_ETV;
value = readl(ioaddr + XGMAC_VLAN_TAG);

value |= XGMAC_VLAN_ETV;
if (is_double) {
value |= XGMAC_VLAN_EDVLP;
value |= XGMAC_VLAN_ESVL;
Expand Down

0 comments on commit 907a076

Please sign in to comment.