aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/netcp_ethss.c
diff options
context:
space:
mode:
authorWingMan Kwok <w-kwok2@ti.com>2015-07-23 15:57:19 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-27 03:18:39 -0400
commitc0f54edbe26fbe8194d7e72c24c49f7b1c9c547f (patch)
tree89277ca84708901c3855ff62e53df7c293fd0d87 /drivers/net/ethernet/ti/netcp_ethss.c
parentea6f82fe37319675e271dd6b55fb37731eef0e46 (diff)
net: netcp: Fixes the use of spin_lock_bh in timer function
This patch fixes a bug in which the timer routine synchronized against the ethtool-triggered statistics updates with spin_lock_bh(). A timer function is itself a bottom-half, so this should be spin_lock(). Signed-off-by: WingMan Kwok <w-kwok2@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/netcp_ethss.c')
-rw-r--r--drivers/net/ethernet/ti/netcp_ethss.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index 9b7e0a34c98b..cabf97728b2d 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -2189,14 +2189,15 @@ static void netcp_ethss_timer(unsigned long arg)
2189 netcp_ethss_update_link_state(gbe_dev, slave, NULL); 2189 netcp_ethss_update_link_state(gbe_dev, slave, NULL);
2190 } 2190 }
2191 2191
2192 spin_lock_bh(&gbe_dev->hw_stats_lock); 2192 /* A timer runs as a BH, no need to block them */
2193 spin_lock(&gbe_dev->hw_stats_lock);
2193 2194
2194 if (gbe_dev->ss_version == GBE_SS_VERSION_14) 2195 if (gbe_dev->ss_version == GBE_SS_VERSION_14)
2195 gbe_update_stats_ver14(gbe_dev, NULL); 2196 gbe_update_stats_ver14(gbe_dev, NULL);
2196 else 2197 else
2197 gbe_update_stats(gbe_dev, NULL); 2198 gbe_update_stats(gbe_dev, NULL);
2198 2199
2199 spin_unlock_bh(&gbe_dev->hw_stats_lock); 2200 spin_unlock(&gbe_dev->hw_stats_lock);
2200 2201
2201 gbe_dev->timer.expires = jiffies + GBE_TIMER_INTERVAL; 2202 gbe_dev->timer.expires = jiffies + GBE_TIMER_INTERVAL;
2202 add_timer(&gbe_dev->timer); 2203 add_timer(&gbe_dev->timer);