aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/via-velocity.c
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@netinsight.net>2010-02-09 18:38:07 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-10 13:55:01 -0500
commit39c2ff43ea3830ccc693f965abdace96e514b1c5 (patch)
tree58ce2926f63980d4a23a227ccc9ef2a6937d4e15 /drivers/net/via-velocity.c
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>
Diffstat (limited to 'drivers/net/via-velocity.c')
-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 133069738ba0..54bafdab1f9d 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,
3341{ 3341{
3342 struct velocity_info *vptr = netdev_priv(dev); 3342 struct velocity_info *vptr = netdev_priv(dev);
3343 int max_us = 0x3f * 64; 3343 int max_us = 0x3f * 64;
3344 unsigned long flags;
3344 3345
3345 /* 6 bits of */ 3346 /* 6 bits of */
3346 if (ecmd->tx_coalesce_usecs > max_us) 3347 if (ecmd->tx_coalesce_usecs > max_us)
@@ -3362,6 +3363,7 @@ static int velocity_set_coalesce(struct net_device *dev,
3362 ecmd->tx_coalesce_usecs); 3363 ecmd->tx_coalesce_usecs);
3363 3364
3364 /* Setup the interrupt suppression and queue timers */ 3365 /* Setup the interrupt suppression and queue timers */
3366 spin_lock_irqsave(&vptr->lock, flags);
3365 mac_disable_int(vptr->mac_regs); 3367 mac_disable_int(vptr->mac_regs);
3366 setup_adaptive_interrupts(vptr); 3368 setup_adaptive_interrupts(vptr);
3367 setup_queue_timers(vptr); 3369 setup_queue_timers(vptr);
@@ -3369,6 +3371,7 @@ static int velocity_set_coalesce(struct net_device *dev,
3369 mac_write_int_mask(vptr->int_mask, vptr->mac_regs); 3371 mac_write_int_mask(vptr->int_mask, vptr->mac_regs);
3370 mac_clear_isr(vptr->mac_regs); 3372 mac_clear_isr(vptr->mac_regs);
3371 mac_enable_int(vptr->mac_regs); 3373 mac_enable_int(vptr->mac_regs);
3374 spin_unlock_irqrestore(&vptr->lock, flags);
3372 3375
3373 return 0; 3376 return 0;
3374} 3377}