From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
andrew@lunn.ch, vivien.didelot@gmail.com, davem@davemloft.net,
kuba@kernel.org, dan.carpenter@oracle.com
Subject: [PATCH net-next v2 2/9] net: dsa: b53: Restore VLAN entries upon (re)configuration
Date: Mon, 30 Mar 2020 14:38:47 -0700 [thread overview]
Message-ID: <20200330213854.4856-3-f.fainelli@gmail.com> (raw)
In-Reply-To: <20200330213854.4856-1-f.fainelli@gmail.com>
The first time b53_configure_vlan() is called we have not configured any
VLAN entries yet, since that happens later when interfaces get brought
up. When b53_configure_vlan() is called again from suspend/resume we
need to restore all VLAN entries though.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 39ae4ed87d1d..5cb678e8b9cd 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -681,7 +681,9 @@ int b53_configure_vlan(struct dsa_switch *ds)
{
struct b53_device *dev = ds->priv;
struct b53_vlan vl = { 0 };
+ struct b53_vlan *v;
int i, def_vid;
+ u16 vid;
def_vid = b53_default_pvid(dev);
@@ -699,6 +701,19 @@ int b53_configure_vlan(struct dsa_switch *ds)
b53_write16(dev, B53_VLAN_PAGE,
B53_VLAN_PORT_DEF_TAG(i), def_vid);
+ /* Upon initial call we have not set-up any VLANs, but upon
+ * system resume, we need to restore all VLAN entries.
+ */
+ for (vid = def_vid; vid < dev->num_vlans; vid++) {
+ v = &dev->vlans[vid];
+
+ if (!v->members)
+ continue;
+
+ b53_set_vlan_entry(dev, vid, v);
+ b53_fast_age_vlan(dev, vid);
+ }
+
return 0;
}
EXPORT_SYMBOL(b53_configure_vlan);
--
2.17.1
next prev parent reply other threads:[~2020-03-30 21:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 21:38 [PATCH net-next v2 0/9] net: dsa: b53 & bcm_sf2 updates for 7278 Florian Fainelli
2020-03-30 21:38 ` [PATCH net-next v2 1/9] net: dsa: bcm_sf2: Fix overflow checks Florian Fainelli
2020-03-30 21:38 ` Florian Fainelli [this message]
2020-03-30 21:38 ` [PATCH net-next v2 3/9] net: dsa: b53: Prevent tagged VLAN on port 7 for 7278 Florian Fainelli
2020-03-30 21:38 ` [PATCH net-next v2 4/9] net: dsa: b53: Deny enslaving port 7 for 7278 into a bridge Florian Fainelli
2020-03-30 21:38 ` [PATCH net-next v2 5/9] net: dsa: bcm_sf2: Disable learning for ASP port Florian Fainelli
2020-03-30 21:38 ` [PATCH net-next v2 6/9] net: dsa: bcm_sf2: Check earlier for FLOW_EXT and FLOW_MAC_EXT Florian Fainelli
2020-03-30 21:38 ` [PATCH net-next v2 7/9] net: dsa: bcm_sf2: Move writing of CFP_DATA(5) into slicing functions Florian Fainelli
2020-03-30 21:38 ` [PATCH net-next v2 8/9] net: dsa: bcm_sf2: Add support for matching VLAN TCI Florian Fainelli
2020-03-30 21:38 ` [PATCH net-next v2 9/9] net: dsa: bcm_sf2: Support specifying VLAN tag egress rule Florian Fainelli
2020-03-31 2:56 ` [PATCH net-next v2 0/9] net: dsa: b53 & bcm_sf2 updates for 7278 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200330213854.4856-3-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).