Skip to content

Commit

Permalink
via-velocity: Take spinlock on set coalesce
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Simon Kagstrom authored and David S. Miller committed Feb 10, 2010
1 parent d6cade0 commit 39c2ff4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -3362,13 +3363,15 @@ 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);

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;
}
Expand Down

0 comments on commit 39c2ff4

Please sign in to comment.