Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3768600ybl; Mon, 13 Jan 2020 02:15:22 -0800 (PST) X-Google-Smtp-Source: APXvYqz/OcKUzzq4BJmV/9plk9AeT2blHhqN9MsITGpxLkTN/4dtTBQLIWaKBQcQWmJ7CqK/o/yk X-Received: by 2002:a05:6808:3d9:: with SMTP id o25mr12512874oie.126.1578910522374; Mon, 13 Jan 2020 02:15:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578910522; cv=none; d=google.com; s=arc-20160816; b=DIdR1G7caIyNWFUrY/eiZtW0H2ybcgdVmzFc4zjyHuEElilnxJ9nf6d3dN1Iic6EhT MP6EB2DG53HdSKIVUhd+/rOdGxJrky2psf8GyK7KzYEf/oKR7Lx8XSIS2LvyMPDZ1bWZ m4+2aHPjBied6GipiwrBi5xodYGqPNf+t9dx8nAwMwJM0TLWqiOlMRKLnCBf52Ldg4XS r5wOydBg9ZKLKzPx364dXUwNvbQ6Ik3fDuQRKVZBo0LRo8N/PYWxz2XwVuiBRcHF+ULD bHehQd1wlP56pULxFktQUZlSUTc7Y3w4GQcnkkQRoLOo/vPEy4tJaBQcTCgQzeKZp1Wn P5bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=bUj8Lfa/ZBCdsoncg4KLIay1J+h09BIRtfD8xLQB5Wo=; b=xzuJ+tbLuCatg5gpoDK4ptNTBwoJ3aowd8jRz6zA6hHVzmHKrVmUNDDVqyouNwW6Ee OZ0Wig31Sm2oJWJBc8dLWjW9BiYLlxRXRqTDzheHRAq1lhBAzSbGpfRGighFxncs5DHx FpqBW/99Xk9uKXz3VhNrJ4KcRE0gENsNEk4AgBb68FnVs3gQXw4l6gQDGWVVVXsXGk5L cihdqKeL8ydQL4UtuovFhLHU+aCwqz9GDH7FTba+9dRZ6cAxE+sdhBBLd0kj40Eb3Qd6 jbhsnlxUqW0v49GnVudRm2cX17c92EKT2OlN5OP8QtuU8yUGqVAgtfGxxNWqJ2LCKyS2 ByTg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w202si5108440oiw.194.2020.01.13.02.15.10; Mon, 13 Jan 2020 02:15:22 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728836AbgAMKNo (ORCPT + 99 others); Mon, 13 Jan 2020 05:13:44 -0500 Received: from mga03.intel.com ([134.134.136.65]:10161 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728809AbgAMKNm (ORCPT ); Mon, 13 Jan 2020 05:13:42 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116822" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:38 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Cc: Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , "David S . Miller" , Maxime Coquelin , Ong Boon Leong , Tan Tee Min , Voon Weifeng , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net 5/7] net: stmmac: fix incorrect GMAC_VLAN_TAG register writting implementation Date: Tue, 14 Jan 2020 10:01:14 +0800 Message-Id: <1578967276-55956-6-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Tan, Tee Min" It should always do a read of current value of GMAC_VLAN_TAG instead of directly overwriting the register value. Fixes: c1be0022df0d ("net: stmmac: Add VLAN HASH filtering support in GMAC4+") Signed-off-by: Tan, Tee Min Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 40ca00e..6e3d0ab 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -736,11 +736,14 @@ static void dwmac4_update_vlan_hash(struct mac_device_info *hw, u32 hash, __le16 perfect_match, bool is_double) { void __iomem *ioaddr = hw->pcsr; + u32 value; writel(hash, ioaddr + GMAC_VLAN_HASH_TABLE); + value = readl(ioaddr + GMAC_VLAN_TAG); + if (hash) { - u32 value = GMAC_VLAN_VTHM | GMAC_VLAN_ETV; + value |= GMAC_VLAN_VTHM | GMAC_VLAN_ETV; if (is_double) { value |= GMAC_VLAN_EDVLP; value |= GMAC_VLAN_ESVL; @@ -759,8 +762,6 @@ static void dwmac4_update_vlan_hash(struct mac_device_info *hw, u32 hash, writel(value | perfect_match, ioaddr + GMAC_VLAN_TAG); } else { - u32 value = readl(ioaddr + GMAC_VLAN_TAG); - value &= ~(GMAC_VLAN_VTHM | GMAC_VLAN_ETV); value &= ~(GMAC_VLAN_EDVLP | GMAC_VLAN_ESVL); value &= ~GMAC_VLAN_DOVLTC; -- 2.7.4