Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10522645ybi; Thu, 25 Jul 2019 00:51:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgiCBbAvg5t7GWmAlofOadRVkhnKHfrKkLh6XtAiXRmsVhou2WzK9Tk7aRPMA3hS2LARNv X-Received: by 2002:aa7:8dcc:: with SMTP id j12mr15450445pfr.137.1564041069949; Thu, 25 Jul 2019 00:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564041069; cv=none; d=google.com; s=arc-20160816; b=FEEJc+tn5rGqS1+Xr9/+6jfkWknJPFBGj6q55gJvf36ZXFxe6u6dm4MA0fng+nSnGM L32CHsrYIHp0KO+PfIbSiSDyQ7jPU5rS4iZ/ycxYypg3aj5Xp+BopQ1NoDJYFqRnrcYF 2zmI9YKHdmyGw78Be/OA6piDcuz7TulDadTslrxyg7ltX3Vrt+y67cFgSX/xD7Lk9NCE niTy5m0KjfE9AZqzxYHcfgtlcjctAqnkznkIM9JA24GTQGNHG4yR7BMIqIMNNV7mKrhT BXLgBAKkOAAeV0p7lYWCpVNKTny2qiYFfuCfLFHW0ebU8HMcXSk6wyNp7vtsHg/iqmca 8Z2Q== 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=fYgAzsHN7XlOUnF1ZFmmVOlpK77xaAbDPntBs9V3reU=; b=lODDHq/5WIM9KCekK/C2GVFswwDlY1bqv1mADmWcnek9rMxTes4e0Z5rQ4OfVc0E+l Tg84HYQqVt86dCj8r97Crjj0ia9h2yDE1W96sRHVI0rxW6Xv7J7JjCRagwidIe64ze/2 gdhUz73osy8S5cPvVDP0yKsnZRqzVLC9DLAIsfkJIiLbz5LRtY/0nbJraEfOHLAecOau MmGozRmEoH7YNWBEhbJ9OqN5isKj+9HwD8BHfFx/kRuof1Gcu06vTJdOWoefYwW6VZa3 /lMdKBQ/yHy6yyYSOv80rqalbahtPTkoUw+2ASHpZT2rwayUD1RcgJ0wOcydHkXFIgEH OHag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mSuopzIt; 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 j36si15203697plb.77.2019.07.25.00.50.50; Thu, 25 Jul 2019 00:51:09 -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=mSuopzIt; 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 S2405056AbfGXUCG (ORCPT + 99 others); Wed, 24 Jul 2019 16:02:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:51406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404996AbfGXUCD (ORCPT ); Wed, 24 Jul 2019 16:02:03 -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 5153120665; Wed, 24 Jul 2019 20:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998522; bh=VmdVzvNLDWTZS6jg+c0EZupz56i7q1ENXH+Qqd8hAjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mSuopzIt3DZJuz7YnuN5n/dZgnQFA0DOMRdoabUr4lFFHkliHTRgrVXdhbX48yWqD SCpYfuFgQQb9j3/Y5XJ2jOXHYWwRJI/DFRgV5ZWDnLMyJInHtBKZ0ZQTan1JLidTJN 57W0SgeZ5kVhEVvsM+aJzjygsPJhm4AmFhZPAetM= 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.19 023/271] net: stmmac: dwmac4/5: Clear unused address entries Date: Wed, 24 Jul 2019 21:18:12 +0200 Message-Id: <20190724191657.203178536@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 7e5d5db0d516..a2f3db39221e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -444,14 +444,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