Commit 3249b4fb authored by Jose Abreu's avatar Jose Abreu Committed by Greg Kroah-Hartman

net: stmmac: dwmac4/5: Clear unused address entries

[ Upstream commit 0620ec6c ]

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: default avatarJose 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: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d91f9a55
...@@ -444,14 +444,20 @@ static void dwmac4_set_filter(struct mac_device_info *hw, ...@@ -444,14 +444,20 @@ static void dwmac4_set_filter(struct mac_device_info *hw,
* are required * are required
*/ */
value |= GMAC_PACKET_FILTER_PR; value |= GMAC_PACKET_FILTER_PR;
} else if (!netdev_uc_empty(dev)) { } else {
int reg = 1;
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;
int reg = 1;
netdev_for_each_uc_addr(ha, dev) { netdev_for_each_uc_addr(ha, dev) {
dwmac4_set_umac_addr(hw, ha->addr, reg); dwmac4_set_umac_addr(hw, ha->addr, reg);
reg++; reg++;
} }
while (reg <= GMAC_MAX_PERFECT_ADDRESSES) {
writel(0, ioaddr + GMAC_ADDR_HIGH(reg));
writel(0, ioaddr + GMAC_ADDR_LOW(reg));
reg++;
}
} }
writel(value, ioaddr + GMAC_PACKET_FILTER); writel(value, ioaddr + GMAC_PACKET_FILTER);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment