]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net: mv643xx_eth: update statistics timer from timer context only
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Wed, 2 Oct 2013 10:57:20 +0000 (12:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Oct 2013 21:11:37 +0000 (17:11 -0400)
Each port driver installs a periodic timer to update port statistics
by calling mib_counters_update. As mib_counters_update is also called
from non-timer context, we should not reschedule the timer there but
rather move it to timer-only context.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mv643xx_eth.c

index 7fb5677451f9fb7aee3ebccd31a82b476cfac4df..44a87e4469e03440eef2d9d681e34422257f1f79 100644 (file)
@@ -1131,15 +1131,13 @@ static void mib_counters_update(struct mv643xx_eth_private *mp)
        p->rx_discard += rdlp(mp, RX_DISCARD_FRAME_CNT);
        p->rx_overrun += rdlp(mp, RX_OVERRUN_FRAME_CNT);
        spin_unlock_bh(&mp->mib_counters_lock);
-
-       mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ);
 }
 
 static void mib_counters_timer_wrapper(unsigned long _mp)
 {
        struct mv643xx_eth_private *mp = (void *)_mp;
-
        mib_counters_update(mp);
+       mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ);
 }