Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: Fix deadlock by double lock
Browse files Browse the repository at this point in the history
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: Andrew Lunn <andrew@lunn.ch>
Fixes: 3188823 ("net: dsa: mv88e6xxx: Replace stats mutex with SMI mutex")
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Jun 7, 2015
1 parent d691f9e commit 80edb72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/dsa/mv88e6xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,8 @@ static void _mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds,
u32 high = 0;

if (s->reg >= 0x100) {
ret = mv88e6xxx_reg_read(ds, REG_PORT(port),
s->reg - 0x100);
ret = _mv88e6xxx_reg_read(ds, REG_PORT(port),
s->reg - 0x100);
if (ret < 0)
goto error;
low = ret;
Expand Down

0 comments on commit 80edb72

Please sign in to comment.