Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3697097ybv; Mon, 10 Feb 2020 04:54:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzMh39KU4etdzC5IUx8kBTv3CJtAre0vmtVTTZZNkJvlnNp+nNxN2R3TYLKrm/Mijtfz92j X-Received: by 2002:a9d:6196:: with SMTP id g22mr972556otk.204.1581339279502; Mon, 10 Feb 2020 04:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339279; cv=none; d=google.com; s=arc-20160816; b=L4nOYLhsXRJb2WmPD0o0zLnLpECCwQR3aABBuSnHl5K8XD6VFk0V4AXkhmI04p0e+Q mw+LJbR3iQuabKjzZDyA7dFkp3b4OGSgjI40jNHrBtS+Sxq/OkOW7ydN/X5PMceEJGE2 NMQ919FqMrhtWgM6NHjoUFDNG5ponA5EEkuIli2OlEPPoOBMtiHRIS+YeExNYZaOhtAy 9JDEPuG7yBvQG1VBrTuBolZ43r/5d/i/PKjNqd9EV2mnnDZUo47zQUpwYFK+ae8aqfN0 U9/YahZMcCcHdvdAc4+Dfc1dWvXA9iAVxU3zjuhEdfVhbECpC1LFLBQWUngj9Ro9K+i2 fEmA== 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=84UnIgmXS6lCnsS0+6VvJ8cJym5198BMVvFcZ9Ze/l0=; b=IGxGB8OQiqdcFhhe4TifMD1vWYjxWm4lKTznIOor80ZCZENc7edaci5YVNQPrkbyYs wvi6LRdr70LtzNtCD+Ao67nd8x6ooLfap8+QhVxLhy0xMQB6dZts4sOu1d2t/OOyxHep FqzTPKgxO4aw1+0ufh+LWJEuakWAnY/wqDPZhb/QpLZm3CrD4b6l3K79K9QYBX2afanW KO65uypuSyDLO/gGj/HtbacjjnEoXJdZdNtGSqk0nN/0/7vp2gCNKIkQfMaN6lkcMwx0 RuzYALIJhLrQR/tnNbrPuaa+ueejtZ0KDxccJMN+btOhRzGeWKvu5y2DUUQE2SPTn+Lo d0YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c8Ivk89A; 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 a25si149971otr.39.2020.02.10.04.54.28; Mon, 10 Feb 2020 04:54:39 -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=c8Ivk89A; 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 S1729615AbgBJMy0 (ORCPT + 99 others); Mon, 10 Feb 2020 07:54:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:45498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730121AbgBJMmA (ORCPT ); Mon, 10 Feb 2020 07:42:00 -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 E251D20842; Mon, 10 Feb 2020 12:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338520; bh=t4wbXBwwAt7MaSC0Q2NVeMfh7j7XNATXObDaJ5xrNpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c8Ivk89AhxXi4NoKmp+iPnEwSsw8W3luiB+PT7Wt7CAi732Fgh4CwFLXagUrrEWM9 37jii17gDy0zYhUAHtxv65ObpKcdYK+glqHs8ezPVJl4KGVgyj3i96A2D1xtpknDkX R79vijkWlBQpb8Wx3PWpadMyIBq06D9Y89jKg4a0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ong Boon Leong , "David S. Miller" Subject: [PATCH 5.5 331/367] net: stmmac: xgmac: fix incorrect XGMAC_VLAN_TAG register writting Date: Mon, 10 Feb 2020 04:34:04 -0800 Message-Id: <20200210122453.402692988@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: Ong Boon Leong [ Upstream commit 907a076881f171254219faad05f46ac5baabedfb ] We should always do a read of current value of XGMAC_VLAN_TAG instead of directly overwriting the register value. Fixes: 3cd1cfcba26e2 ("net: stmmac: Implement VLAN Hash Filtering in XGMAC") Signed-off-by: Ong Boon Leong Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -569,7 +569,9 @@ static void dwxgmac2_update_vlan_hash(st writel(value, ioaddr + XGMAC_PACKET_FILTER); - value = XGMAC_VLAN_VTHM | XGMAC_VLAN_ETV; + value = readl(ioaddr + XGMAC_VLAN_TAG); + + value |= XGMAC_VLAN_VTHM | XGMAC_VLAN_ETV; if (is_double) { value |= XGMAC_VLAN_EDVLP; value |= XGMAC_VLAN_ESVL; @@ -584,7 +586,9 @@ static void dwxgmac2_update_vlan_hash(st writel(value, ioaddr + XGMAC_PACKET_FILTER); - value = XGMAC_VLAN_ETV; + value = readl(ioaddr + XGMAC_VLAN_TAG); + + value |= XGMAC_VLAN_ETV; if (is_double) { value |= XGMAC_VLAN_EDVLP; value |= XGMAC_VLAN_ESVL;