From patchwork Thu Jun 20 17:56:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 167348 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2392610ilk; Thu, 20 Jun 2019 11:13:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXaYuNvdYKwLT/am8MmM3Hxy9A2IDMPh6Tp0cnS2yplWu1S5N3RtxU1pZjN6Hrmj0x1lEI X-Received: by 2002:a63:a02:: with SMTP id 2mr14319376pgk.315.1561054414953; Thu, 20 Jun 2019 11:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054414; cv=none; d=google.com; s=arc-20160816; b=zsDy0Ugr0vOHi0dVU8i1LOtxDmaPeZgC80dogV/sZ4DKIV/bcsPMQgzoVrKmbV2Z/8 2ibhiI3Noi7GKR8D/l1EC7l6lJLyxgJHkpdJLS+oz2QP7yrEE9nsEg92d1NR7czV+g5w MykVKq5GEzoccyaHo6CSKTVpuDgtvgpTM8hYTMgs1xt+uIIbMtoRSFJNk4BijoWiKAtW T+mwbhudTL7VKKz7MF8TLE3Kxn1/2ckbc3Dbig93Yw3sEuNqP+RMkl23IgaBslUEWPO/ cC5VVsqjqYm+VUDCIuTFdD/PsOjsBg68+T0P5XHnX1Riu6wiI36sTakv/Gy4i7+BleVF Hcsw== 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=HL6D4irPquyow2SsEVy8iPJ1eBflSMAzIqaFAGsl0heIg1+ups9HDOWqje2B8Z1F56 nqdT4n7uH+zVXS48fXcA0Llo/kwHeu4nkw0/oiL4Cp5d1uK0drt8dx/3UCRK+P/rZj4n HdfgOfCKo3TM/o9rkqBF76uUPqQ3qJKQbuOVPvb1q5OYN2nCQDC4QFMrxfdgm3sDeh5g o8HP/2vNS9o60bW4v/QE0RXGj5hpEJ+3moX2sHdy8b4iIKdgyzz/FWXsmOEsg1fs9C90 7ZPlKKHT0bChsccTQNdRRgNEH2tg5DV+tqKNmtxERXovLRhEkK+b+hGBplpnKFT44Cx1 qCVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AcN+zS6q; 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 z13si403539pjr.76.2019.06.20.11.13.34; Thu, 20 Jun 2019 11:13:34 -0700 (PDT) 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=AcN+zS6q; 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 S1729281AbfFTSNd (ORCPT + 30 others); Thu, 20 Jun 2019 14:13:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:41410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728883AbfFTSN3 (ORCPT ); Thu, 20 Jun 2019 14:13:29 -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 01DC52082C; Thu, 20 Jun 2019 18:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054408; bh=SjfTpmvzvuQZ9JZgKZvtzkAgoLB4u3yXSE2feqq0kUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AcN+zS6qFgs8AYE7bJpEqNeR3bGpK2rBj3knf5DAXevsmBAJv8yIsvhFNt7C+xwak fKyRTToImnQd1uzti2a4wAMNeHg/zw3FiNfNaVVB+7BOqMp3fCxNZSisG4gDQgVqKo cbnMoD3vneS3gHn8YL1Le81bKiiFsj9ZOBFNYNzA= 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 5.1 08/98] net: dsa: rtl8366: Fix up VLAN filtering Date: Thu, 20 Jun 2019 19:56:35 +0200 Message-Id: <20190620174349.751989092@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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);