Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp330866pxb; Wed, 13 Jan 2021 04:58:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRXeyu72JQRlZ9ckYnW3tqZZ0TlQ4ONP+ZLvIlFvWys+LN9OFNaTHE99szdTeU5JIboIvf X-Received: by 2002:a05:6402:17:: with SMTP id d23mr1679538edu.341.1610542729344; Wed, 13 Jan 2021 04:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610542729; cv=none; d=google.com; s=arc-20160816; b=GO16F7l2MRAIzm4UDSwX2nxMIZ4hux75q9l21LSq8cNmMjMXwZo+V9hMk7aTz2KGne fXYGjngTJ53LrcawsGJyA/Jo+wubVyscBL9a0DrL2YP/YVT+9agUZzMt2wAeiq7UI8wG vKAmgrY0oPAsz1sWr/LXlR8cQleNeKw+Vu+uSZECrkn4etmETwFVwADNglYOKSgJ1l3Y toVXHsj0gW4pbB7nYmbkS5GUlxBv8bWgRmgcIaJSZ0t7+asT6vtq0uV8uHgihLdEhZrt ElWXEWjGYYyREZf62mdpGfbT2MOBA68dhlGa6b8/nk90YA1oMrR1/Py/jYTCwbJI0h/H +u3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/XUHpjO1bwKTgXfm/hEbdc7hhVzn/tn46D3Qy88RWHo=; b=kAJiLoIuYQiCDncvq9fB7A+blWKwe08TSDuV/RVcuz+gNCPochwyjsAXmZn+VxDhd9 QrX34xBoTVNpvemNs0JzUQNTaiilZDo32StNu+xAnsakaGkbo3fsQ0tDz3zA32aUoWXO BL0C4+HfQDnm/qmLcyWXzJCOsd02V/LigN9aaLBbIhTTgBBWv2OZJxQANonx58ZHlHWr MGNhPrrsyC7fXtoLeN56v9rsrnpKC33reL3qxPlr1WyCiZbZhzNl0EGSv/CzpP/3tWfL BBDSm+c1yuEWGwwzVWVwK2Kmbqk5jwPjMOaixdOj6Tb3/v4dneLuNPa1r1sNS5EI79Ot OCyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si1077400edv.597.2021.01.13.04.58.25; Wed, 13 Jan 2021 04:58:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727262AbhAMMzx (ORCPT + 99 others); Wed, 13 Jan 2021 07:55:53 -0500 Received: from mail.savoirfairelinux.com ([208.88.110.44]:39120 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbhAMMzu (ORCPT ); Wed, 13 Jan 2021 07:55:50 -0500 X-Greylist: delayed 575 seconds by postgrey-1.27 at vger.kernel.org; Wed, 13 Jan 2021 07:55:49 EST Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 9FFB99C0DD7; Wed, 13 Jan 2021 07:45:44 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id PF0KqBo2V4kf; Wed, 13 Jan 2021 07:45:44 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 45CF39C0DD3; Wed, 13 Jan 2021 07:45:44 -0500 (EST) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yoNQApLFomgm; Wed, 13 Jan 2021 07:45:44 -0500 (EST) Received: from gdo-desktop.home (pop.92-184-98-96.mobile.abo.orange.fr [92.184.98.96]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 47E8F9C0DCC; Wed, 13 Jan 2021 07:45:42 -0500 (EST) From: Gilles DOFFE To: netdev@vger.kernel.org Cc: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org Subject: [PATCH net 5/6] net: dsa: ksz: fix wrong pvid Date: Wed, 13 Jan 2021 13:45:21 +0100 Message-Id: <4d34da2534c912e290d77d4296a4aa68229fd6e6.1610540603.git.gilles.doffe@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A logical 'or' was performed until now. So if vlan 1 is the current pvid and vlan 20 is set as the new one, vlan 21 is the new pvid. This commit fixes this by setting the right mask to set the new pvid. Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz8795.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microc= hip/ksz8795.c index b55fb2761993..44306a7e297a 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -868,8 +868,8 @@ static void ksz8795_port_vlan_add(struct dsa_switch *= ds, int port, =20 if (new_pvid) { ksz_pread16(dev, port, REG_PORT_CTRL_VID, &vid); - vid &=3D 0xfff; - vid |=3D new_pvid; + vid &=3D ~0xfff; + vid |=3D (new_pvid & 0xfff); ksz_pwrite16(dev, port, REG_PORT_CTRL_VID, vid); } =20 --=20 2.25.1