]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: stmmac: xgmac: fix incorrect XGMAC_VLAN_TAG register writting
authorOng Boon Leong <boon.leong.ong@intel.com>
Fri, 7 Feb 2020 07:33:40 +0000 (15:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:37:24 +0000 (04:37 -0800)
[ Upstream commit 907a076881f171254219faad05f46ac5baabedfb ]

We should always do a read of current value of XGMAC_VLAN_TAG instead of
directly overwriting the register value.

Fixes: 3cd1cfcba26e2 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

index 082f5ee9e52566ae06fca10463fe69cd7af37257..9fb85faa8ed29816872241e958853488ee4c27aa 100644 (file)
@@ -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;
@@ -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;