net: dsa: mv88e6xxx: Fix deadlock by double lock
authorAndrew Lunn <andrew@lunn.ch>
Thu, 4 Jun 2015 23:10:09 +0000 (01:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Jun 2015 19:19:22 +0000 (12:19 -0700)
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: 31888234b736 ("net: dsa: mv88e6xxx: Replace stats mutex with SMI mutex")
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx.c

index 7fba330ce702824a21b7e2d1197f20c849843131..39530fa142b012098971b523cf1194684440d075 100644 (file)
@@ -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;