netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: dsa: mv88e6xxx: Fix deadlock by double lock
@ 2015-06-04 23:10 Andrew Lunn
  2015-06-07 19:19 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Lunn @ 2015-06-04 23:10 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Andrew Lunn

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")
---
 drivers/net/dsa/mv88e6xxx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 4f2b8b7565b0..261a0301e403 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -758,8 +758,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;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: dsa: mv88e6xxx: Fix deadlock by double lock
  2015-06-04 23:10 [PATCH] net: dsa: mv88e6xxx: Fix deadlock by double lock Andrew Lunn
@ 2015-06-07 19:19 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-06-07 19:19 UTC (permalink / raw)
  To: andrew; +Cc: netdev

From: Andrew Lunn <andrew@lunn.ch>
Date: Fri,  5 Jun 2015 01:10:09 +0200

> 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")

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-07 19:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-04 23:10 [PATCH] net: dsa: mv88e6xxx: Fix deadlock by double lock Andrew Lunn
2015-06-07 19:19 ` David Miller

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).