Commit 80edb722 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

net: dsa: mv88e6xxx: Fix deadlock by double lock

ethtool -S on a DSA interface can deadlock for some switches because
the same lock is taken twice. Use the register read function which
expects the lock to be already held.
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Fixes: 31888234 ("net: dsa: mv88e6xxx: Replace stats mutex with SMI mutex")
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d691f9e8
...@@ -703,8 +703,8 @@ static void _mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, ...@@ -703,8 +703,8 @@ static void _mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds,
u32 high = 0; u32 high = 0;
if (s->reg >= 0x100) { if (s->reg >= 0x100) {
ret = mv88e6xxx_reg_read(ds, REG_PORT(port), ret = _mv88e6xxx_reg_read(ds, REG_PORT(port),
s->reg - 0x100); s->reg - 0x100);
if (ret < 0) if (ret < 0)
goto error; goto error;
low = ret; low = ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment