Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3694157ybv; Mon, 10 Feb 2020 04:51:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxZKE/+EwPyGdhVJiq5oKnKAzV51U4cOOYIMVMgyR5DkL077norJnfRpFD0Ko4/T1vj9nRt X-Received: by 2002:a9d:68c8:: with SMTP id i8mr978425oto.34.1581339066763; Mon, 10 Feb 2020 04:51:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339066; cv=none; d=google.com; s=arc-20160816; b=ZSWZgKfHJG27g5GZ1iZZQy6B6lLSPRZR9JQJE7PLQEYqEsUeQzM6yIO5V7xxTXZGDz DYJIpo1IqE+wsv5Rq8nC4pRncuTVRBpLJ29MF/lnKteXyERytypP6X5HqL4LNDVBAM1S mNskA5Dkd30mKSfFpY+asU6yippaXw8bYcReazwaJhLPmPrKtWfiBglGmZeddI7soHs9 2lS/4YVD1JZddDX7bpMvWrHsX1YBuDxSmsahFWnzKI/Ad5HhwrQE0bghPwsCzRlVJbPB 6xjcY690344Sd5iDmJo+g05fRE/m6OIHE77uN4GFzP2rGaHNUWiNWgJ0UFZGl4bErjh0 hCTw== 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=lGVqA1wPvwu0kAfZR+DBT9WredX5MP3tReJHVf8Gm0A=; b=mmi5wXmVFM+8YGT9bNtp96meW1IcaBQ6nMzJiPC3qlb9ydi6qIVdBaS6FxcxAusN6b TZbOfLcAv2R78xORUYsXcsNYzPtdMLGzu4u/My7ear4EZLeoIc0X08T9rEmODhZaM+J2 Ul+htwx/ajSr8nI/bVobbYK798s69lA9dSsT4gbU56MkWURjDMn+p2vAkesXOQFT0aVL xB/hohlkm9H60B6mnE/oyrtDYe0q/OgtOKxYbQDV0QsXvavqE8BujscrWWJA/mmrU2Fj ZEyf5DDMk08K9uRfnhxXUGZw9kAP97SbPZ5Vk16S1VxvafQpyX99JOhsC850m+R0N9Lb mgDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ps6U8YtN; 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 c67si120541oib.276.2020.02.10.04.50.55; Mon, 10 Feb 2020 04:51:06 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ps6U8YtN; 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 S1728559AbgBJMux (ORCPT + 99 others); Mon, 10 Feb 2020 07:50:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:47986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730559AbgBJMoF (ORCPT ); Mon, 10 Feb 2020 07:44:05 -0500 Received: from localhost (unknown [209.37.97.194]) (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 F0E4B20838; Mon, 10 Feb 2020 12:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338645; bh=4RxWrXFSQdTkrR1juUCh6siioEpSe+Z6z4xFwcI79j4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ps6U8YtNpbq0iQI0yxc+JMkh0jJ5jZH5xOjUWc/jYdQ6ljg3n+B660MsL/PT+N+OD wcqK7ygMTAGO3rZIGN0TF8Gl0+Edl+7YsHv9eB89TRx43VRG+nByOtg+cqzKK6zROt eydd2zmmgMFyyFb1y33jBNRQHmbDzHQlzNqRghfY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Tan, Tee Min" , Ong Boon Leong , "David S. Miller" Subject: [PATCH 5.5 330/367] net: stmmac: fix incorrect GMAC_VLAN_TAG register writting in GMAC4+ Date: Mon, 10 Feb 2020 04:34:03 -0800 Message-Id: <20200210122453.332494552@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@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 From: "Tan, Tee Min" [ Upstream commit 9eeeb3c9de4e3aeaa2bec097162f09305dd9f4c3 ] 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- 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(stru __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(stru 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;