aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@netinsight.net>2010-02-09 23:38:07 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-10 10:55:01 -0800
commit39c2ff43ea3830ccc693f965abdace96e514b1c5 (patch)
tree58ce2926f63980d4a23a227ccc9ef2a6937d4e15
parentd6cade0f7f40834ff3b48f2469d00b1be0ea0db6 (diff)
via-velocity: Take spinlock on set coalesce
velocity_set_coalesce touches ISR and some other sensitive registers not covered by the rtnl lock, so take the velocity spinlock. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/via-velocity.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 133069738ba..54bafdab1f9 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -3341,6 +3341,7 @@ static int velocity_set_coalesce(struct net_device *dev,
{
struct velocity_info *vptr = netdev_priv(dev);
int max_us = 0x3f * 64;
+ unsigned long flags;
/* 6 bits of */
if (ecmd->tx_coalesce_usecs > max_us)
@@ -3362,6 +3363,7 @@ static int velocity_set_coalesce(struct net_device *dev,
ecmd->tx_coalesce_usecs);
/* Setup the interrupt suppression and queue timers */
+ spin_lock_irqsave(&vptr->lock, flags);
mac_disable_int(vptr->mac_regs);
setup_adaptive_interrupts(vptr);
setup_queue_timers(vptr);
@@ -3369,6 +3371,7 @@ static int velocity_set_coalesce(struct net_device *dev,
mac_write_int_mask(vptr->int_mask, vptr->mac_regs);
mac_clear_isr(vptr->mac_regs);
mac_enable_int(vptr->mac_regs);
+ spin_unlock_irqrestore(&vptr->lock, flags);
return 0;
}