Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3902813ybi; Mon, 29 Jul 2019 15:01:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaiy3N93Q7ZIXJZbyv4lIOxMLx11VFE8xFCshqiRHCEI0CsoJ2eHN36c5k1sDkOMwWA9NU X-Received: by 2002:a17:90a:2244:: with SMTP id c62mr116753155pje.29.1564437689106; Mon, 29 Jul 2019 15:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564437689; cv=none; d=google.com; s=arc-20160816; b=ZwDonJvCTexqGD5ioh0iceG2LLFgJnEW5M3Wtn50zZpHju+XCNAf4nKrTkzZWRjcCm ubIWD0bHz7jg1kS54y07pRDt3uDHMA1Cc9uU6AOEku17sXy1XZRq04ehakDTHc041Onl ZP1UH0re/jPH2HGZXtIGH35D8aWGZfFKaCkmfMmtFyxlJROEhKs2h9pvaiFPfpdFGPwe 73fWdc9LH7vEF5GcbqXy/3F+RBb12eSil0+/h73FLmAcSKRLfiVHqdQ11kTmq+yqgZaG jc6+ju3tQsF4JqGfFiL/qyhq9pTqgIaV5Buu6oU+1vSNnHYZj5q080QA2JP+X8c/i+CR F2DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T1cglAgnPrkmlLe4UkzIOL3CEU7KC5/njNjRXT/DG9o=; b=MY/CQDX45WU5mkt4+dVIm/6kOa38uVZVlDVo9GXET7ool1RJteedTKQgt9Wo01ntQm hA4o0qvrZco1qEB9xiweAk1gCBQASTYPwgEldHbbhBBzk/EPOpXvH3QZilhN7LSc6X6s BOXGv6W6mrDV8Zp7Ou638ljBGeL3aW76Aeb+vPlkCXi3Sy5EDmkVKELYcslES10V04pV Kd1Aras62KzgNM5Whj5L2/B+O19IvoBITmSL/z+35p/unlZ/8Y80xoJemvYgCclHHl6G wvRHVePwQ8sP2q6uVBLSg9kladQwEKEoDiJ1/vBMZXlVLkUE5w5ho1fkbpQMXOz/Vto/ +KTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R+CO5HmP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y70si28576754pfg.184.2019.07.29.15.01.13; Mon, 29 Jul 2019 15:01:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R+CO5HmP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729700AbfG2TZr (ORCPT + 99 others); Mon, 29 Jul 2019 15:25:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:38122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727527AbfG2TZq (ORCPT ); Mon, 29 Jul 2019 15:25:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2357521655; Mon, 29 Jul 2019 19:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428345; bh=n/wL2MZU1O/szMaSqv8soXoXlI+OSfvc8wjNJMYDpg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R+CO5HmPCSHwTCHT0PpGy4rmmIJJJTXAMUNq/Uyji0kSV98KJ4kW6k9W1z+lHiBSH VmFTOFaPT+4rutPdRDtqllRxwbAZw39lhcPhszpQiBoVrg10Bg36JwkwmaaLfa5v/V 0oNveHCgaP1qMjc9EvUxA2Xsx7U3toHUOWPj8kII= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jose Abreu , Joao Pinto , "David S. Miller" , Giuseppe Cavallaro , Alexandre Torgue , Sasha Levin Subject: [PATCH 4.14 019/293] net: stmmac: dwmac4/5: Clear unused address entries Date: Mon, 29 Jul 2019 21:18:30 +0200 Message-Id: <20190729190822.178985692@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 0620ec6c62a5a07625b65f699adc5d1b90394ee6 ] 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 Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 55ae14a6bb8c..ed5fcd4994f2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -443,14 +443,20 @@ static void dwmac4_set_filter(struct mac_device_info *hw, * are required */ value |= GMAC_PACKET_FILTER_PR; - } else if (!netdev_uc_empty(dev)) { - int reg = 1; + } else { struct netdev_hw_addr *ha; + int reg = 1; netdev_for_each_uc_addr(ha, dev) { dwmac4_set_umac_addr(hw, ha->addr, 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); -- 2.20.1