]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: dwmac1000: Clear unused address entries
authorJose Abreu <Jose.Abreu@synopsys.com>
Fri, 24 May 2019 08:20:21 +0000 (10:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 May 2019 20:45:56 +0000 (13:45 -0700)
In case we don't use a given address entry we need to clear it because
it could contain previous values that are no longer valid.

Found out while running stmmac selftests.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c

index bc91af6c01b63ee6b920de809c99cd5b6e3bc981..ebe41dd09bab27774ea166b9de376ca89976cf01 100644 (file)
@@ -217,6 +217,12 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
                                            GMAC_ADDR_LOW(reg));
                        reg++;
                }
+
+               while (reg <= perfect_addr_number) {
+                       writel(0, ioaddr + GMAC_ADDR_HIGH(reg));
+                       writel(0, ioaddr + GMAC_ADDR_LOW(reg));
+                       reg++;
+               }
        }
 
 #ifdef FRAME_FILTER_DEBUG