net/mv643xx: don't disable the mib timer too early and lock properly
authorSebastian Siewior <sebastian@breakpoint.cc>
Mon, 16 Feb 2009 11:28:15 +0000 (11:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Feb 2009 01:37:09 +0000 (17:37 -0800)
commit57e8f26a10ac4af488292199bb0435555f6723f3
tree8a2a8a0e8f68729ec7531b733f82d8b666e8a3aa
parent82a5bd6a7b1b60b5d357e2e4b93b914f57314016
net/mv643xx: don't disable the mib timer too early and lock properly

mib_counters_update() also restarts the timer.
So the timer is dequeued, the stats are read and then the timer is
enqueued again. This is "okay" unless someone unloads the module.
The locking here is also broken:
mib_counters_update() grabs just a simple spinlock. The only thing the
lock is good for is to protect the timer func against other callers
namely mv643xx_eth_stop() && mv643xx_eth_get_ethtool_stats(). That means
if the spinlock is taken via the ethtool path and than the timer kicks
in then the box will lock up.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Acked-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mv643xx_eth.c