Skip to content

Commit

Permalink
Revert "net: dsa: mv88e6xxx: flush switchdev FDB workqueue before rem…
Browse files Browse the repository at this point in the history
…oving VLAN"

This reverts commit 2566a89 which is
commit a261414 upstream.

The above change depends on upstream commit 0faf890 ("net: dsa:
drop rtnl_lock from dsa_slave_switchdev_event_work"), which is not
present in linux-5.15.y. Without that change, waiting for the switchdev
workqueue causes deadlocks on the rtnl_mutex.

Backporting the dependency commit isn't trivial/desirable, since it
requires that the following dependencies of the dependency are also
backported:

df40591 net: dsa: sja1105: wait for dynamic config command completion on writes too
eb016af net: dsa: sja1105: serialize access to the dynamic config interface
2468346 net: mscc: ocelot: serialize access to the MAC table
f7eb4a1 net: dsa: b53: serialize access to the ARL table
cf231b4 net: dsa: lantiq_gswip: serialize access to the PCE registers
338a3a4 net: dsa: introduce locking for the address lists on CPU and DSA ports

and then this bugfix on top:

8940e6b ("net: dsa: avoid call to __dev_set_promiscuity() while rtnl_mutex isn't held")

Reported-by: Daniel Suchy <danny@danysek.cz>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Vladimir Oltean authored and Greg Kroah-Hartman committed Mar 16, 2022
1 parent 69b8058 commit caf18e4
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
7 changes: 0 additions & 7 deletions drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2291,13 +2291,6 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port,
if (!mv88e6xxx_max_vid(chip))
return -EOPNOTSUPP;

/* The ATU removal procedure needs the FID to be mapped in the VTU,
* but FDB deletion runs concurrently with VLAN deletion. Flush the DSA
* switchdev workqueue to ensure that all FDB entries are deleted
* before we remove the VLAN.
*/
dsa_flush_workqueue();

mv88e6xxx_reg_lock(chip);

err = mv88e6xxx_port_get_pvid(chip, port, &pvid);
Expand Down
1 change: 0 additions & 1 deletion include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,6 @@ void dsa_unregister_switch(struct dsa_switch *ds);
int dsa_register_switch(struct dsa_switch *ds);
void dsa_switch_shutdown(struct dsa_switch *ds);
struct dsa_switch *dsa_switch_find(int tree_index, int sw_index);
void dsa_flush_workqueue(void);
#ifdef CONFIG_PM_SLEEP
int dsa_switch_suspend(struct dsa_switch *ds);
int dsa_switch_resume(struct dsa_switch *ds);
Expand Down
1 change: 0 additions & 1 deletion net/dsa/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ void dsa_flush_workqueue(void)
{
flush_workqueue(dsa_owq);
}
EXPORT_SYMBOL_GPL(dsa_flush_workqueue);

int dsa_devlink_param_get(struct devlink *dl, u32 id,
struct devlink_param_gset_ctx *ctx)
Expand Down
1 change: 1 addition & 0 deletions net/dsa/dsa_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ void dsa_tag_driver_put(const struct dsa_device_ops *ops);
const struct dsa_device_ops *dsa_find_tagger_by_name(const char *buf);

bool dsa_schedule_work(struct work_struct *work);
void dsa_flush_workqueue(void);
const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops);

static inline int dsa_tag_protocol_overhead(const struct dsa_device_ops *ops)
Expand Down

0 comments on commit caf18e4

Please sign in to comment.