From patchwork Thu Jun 20 17:57:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 167347 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2388861ilk; Thu, 20 Jun 2019 11:10:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoASOS+Fhd4ZYwNPSdn1JOOf+AlBGYQBzrisBtgpO0UYsxspqwex60u+l9t8jQFogBslBX X-Received: by 2002:a62:b503:: with SMTP id y3mr9901228pfe.4.1561054226484; Thu, 20 Jun 2019 11:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054226; cv=none; d=google.com; s=arc-20160816; b=cTIDBPQUpQv193xt5LjsACYbqBnkskXk392wC6Ga1fL1RMqKIpNgJocYt84xSqEEHk 9QN7sBhDjrgKxg1l6S+vMnl4Q/VyP6q4/uyU6Y5Hu8UmyrzPmzQv0OFIkJbn73t5yXT9 RrRtGz1k2OdQ7sNxJpyGlnwQXG52R/c8QTDPnZzJC4Dc0+VkBsrduKtXAt+P7rN0Z0Z5 TOLizhlGPEgvKpusHCbvOw9uLEBbMRdXUGkNpkmF4PQ5LJqUEYoe+4/l16ZsEdP4vMFK 3tDUOWGUrE55NDtQ1QbozfUfMHTNodDWhDVVpp5UuWO9Zkq6thX8mMS3704s2YaitMWK W3Ag== 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=luK2HBBHAMfb1Ca7UN0KgwXTdtJRzmvWOk+/o1PjOZI=; b=gvq59ORuKMCt4R9yGf6f+le8Q4Zzwux1oA3zrihfWr2FljrIScGU/yP79NRDLgL+5j CiysfdqmrGXOIxrxUWJMAJH7mxy7BYDtp5KkGy0XQsQCWCkFYbu9qkVepF5kObS59EjE gr0Cs+27bZG9rQhjtbs8JIABEL1TUICFPumDTNptTAwdoegweBAbRo0vuOMowbekHRZz iJTpAqCS+kcoFRaF55sfUdVYGippEHYLAZI/ZKQKnW4hsF1n1ehX01UNKa8U6U7CHL3Z Z5h9mP3pWRUwThI7wtsLOCG4FyuL5a5fByHs1qsW4KrKk7JrUu57mW1d974xgjH17xVf 4ylg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=skm4ODib; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 q1si178664pgp.301.2019.06.20.11.10.25; Thu, 20 Jun 2019 11:10:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=skm4ODib; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728388AbfFTSKY (ORCPT + 14 others); Thu, 20 Jun 2019 14:10:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:37916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728799AbfFTSKU (ORCPT ); Thu, 20 Jun 2019 14:10:20 -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 D9FAC2082C; Thu, 20 Jun 2019 18:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054220; bh=SjfTpmvzvuQZ9JZgKZvtzkAgoLB4u3yXSE2feqq0kUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=skm4ODibmPXABGUdekoFOZ7G2orcr9/iECBeveWCggQ35tLQOexXQ1L7dlc2T5EqG sT1hRJSPfQBgjxts54dsWE/J7kimDCnrSDVz7jc6NcPa00sNgq8QnPJLCXG7KMNKex GNhfFYUUJWEn2JukpZRp4qBzfiMENtniYsLSwXnQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , "David S. Miller" Subject: [PATCH 4.19 07/61] net: dsa: rtl8366: Fix up VLAN filtering Date: Thu, 20 Jun 2019 19:57:02 +0200 Message-Id: <20190620174338.691124752@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174336.357373754@linuxfoundation.org> References: <20190620174336.357373754@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit 760c80b70bed2cd01630e8595d1bbde910339f31 ] We get this regression when using RTL8366RB as part of a bridge with OpenWrt: WARNING: CPU: 0 PID: 1347 at net/switchdev/switchdev.c:291 switchdev_port_attr_set_now+0x80/0xa4 lan0: Commit of attribute (id=7) failed. (...) realtek-smi switch lan0: failed to initialize vlan filtering on this port This is because it is trying to disable VLAN filtering on VLAN0, as we have forgot to add 1 to the port number to get the right VLAN in rtl8366_vlan_filtering(): when we initialize the VLAN we associate VLAN1 with port 0, VLAN2 with port 1 etc, so we need to add 1 to the port offset. Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver") Signed-off-by: Linus Walleij Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/rtl8366.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/net/dsa/rtl8366.c +++ b/drivers/net/dsa/rtl8366.c @@ -307,7 +307,8 @@ int rtl8366_vlan_filtering(struct dsa_sw struct rtl8366_vlan_4k vlan4k; int ret; - if (!smi->ops->is_vlan_valid(smi, port)) + /* Use VLAN nr port + 1 since VLAN0 is not valid */ + if (!smi->ops->is_vlan_valid(smi, port + 1)) return -EINVAL; dev_info(smi->dev, "%s filtering on port %d\n", @@ -318,12 +319,12 @@ int rtl8366_vlan_filtering(struct dsa_sw * The hardware support filter ID (FID) 0..7, I have no clue how to * support this in the driver when the callback only says on/off. */ - ret = smi->ops->get_vlan_4k(smi, port, &vlan4k); + ret = smi->ops->get_vlan_4k(smi, port + 1, &vlan4k); if (ret) return ret; /* Just set the filter to FID 1 for now then */ - ret = rtl8366_set_vlan(smi, port, + ret = rtl8366_set_vlan(smi, port + 1, vlan4k.member, vlan4k.untag, 1);