Message ID | 20200925124722.639625577@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=ikAt=DC=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 541BAC47420 for <stable@archiver.kernel.org>; Fri, 25 Sep 2020 12:55:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A05223772 for <stable@archiver.kernel.org>; Fri, 25 Sep 2020 12:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601038538; bh=3CxEedJgFMUT9aAxvc8DjPu3Fk3FQFyN00bflofktYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=W27+QvovGZOS9ehn9u32Rt0Arf0Bqq3Lzqrv51L+F6DyZTVk+Y6EOr+gzEKoZkCJB o+FM2AtwJo0z76O0NLxXCWCW8A6yaBEsUy+QUsZ/yANhN8kNxCp/bZDUdLQPtaY5Mo QdHv+mdRfB705uE6x4s4sffFwdbdQVSJGGp32O08= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728635AbgIYMzd (ORCPT <rfc822;stable@archiver.kernel.org>); Fri, 25 Sep 2020 08:55:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:34142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729616AbgIYMy6 (ORCPT <rfc822;stable@vger.kernel.org>); Fri, 25 Sep 2020 08:54:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 91ACF206DB; Fri, 25 Sep 2020 12:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601038498; bh=3CxEedJgFMUT9aAxvc8DjPu3Fk3FQFyN00bflofktYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WsFM/1J5A2HVt7UxNrN8aYofgVULSKjisF7c+oCNKaXloCsR1WXuXGC0TETREi+br lF9Iwu/87WM91p7uzEJw5ISXBEC+W4XILrYDoUBU3QFx4702/hiLjuUI+ZeJyrIjMp JvHR5NyR1N5+IdYTZNOWV1gcf5yKNJ6ZWZJjtxjw= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Florian Fainelli <f.fainelli@gmail.com>, Linus Walleij <linus.walleij@linaro.org>, Jakub Kicinski <kuba@kernel.org> Subject: [PATCH 4.19 11/37] net: dsa: rtl8366: Properly clear member config Date: Fri, 25 Sep 2020 14:48:39 +0200 Message-Id: <20200925124722.639625577@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200925124720.972208530@linuxfoundation.org> References: <20200925124720.972208530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/drivers/net/dsa/rtl8366.c +++ b/drivers/net/dsa/rtl8366.c @@ -452,13 +452,19 @@ int rtl8366_vlan_del(struct dsa_switch * return ret; if (vid == vlanmc.vid) { - /* clear VLAN member configurations */ - vlanmc.vid = 0; - vlanmc.priority = 0; - vlanmc.member = 0; - vlanmc.untag = 0; - vlanmc.fid = 0; - + /* Remove this port from the VLAN */ + vlanmc.member &= ~BIT(port); + vlanmc.untag &= ~BIT(port); + /* + * If no ports are members of this VLAN + * anymore then clear the whole member + * config so it can be reused. + */ + if (!vlanmc.member && vlanmc.untag) { + vlanmc.vid = 0; + vlanmc.priority = 0; + vlanmc.fid = 0; + } ret = smi->ops->set_vlan_mc(smi, i, &vlanmc); if (ret) { dev_err(smi->dev,