Skip to content

Commit 8c25d08

Browse files
Yellow-Paydavem330
authored andcommitted
net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
As spin_unlock_irq will enable interrupts. Function tsi108_stat_carry is called from interrupt handler tsi108_irq. Interrupts are enabled in interrupt handler. Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq in IRQ context to avoid this. Signed-off-by: Fuqian Huang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 227f2f0 commit 8c25d08

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/tundra/tsi108_eth.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,10 @@ tsi108_stat_carry_one(int carry, int carry_bit, int carry_shift,
371371
static void tsi108_stat_carry(struct net_device *dev)
372372
{
373373
struct tsi108_prv_data *data = netdev_priv(dev);
374+
unsigned long flags;
374375
u32 carry1, carry2;
375376

376-
spin_lock_irq(&data->misclock);
377+
spin_lock_irqsave(&data->misclock, flags);
377378

378379
carry1 = TSI_READ(TSI108_STAT_CARRY1);
379380
carry2 = TSI_READ(TSI108_STAT_CARRY2);
@@ -441,7 +442,7 @@ static void tsi108_stat_carry(struct net_device *dev)
441442
TSI108_STAT_TXPAUSEDROP_CARRY,
442443
&data->tx_pause_drop);
443444

444-
spin_unlock_irq(&data->misclock);
445+
spin_unlock_irqrestore(&data->misclock, flags);
445446
}
446447

447448
/* Read a stat counter atomically with respect to carries.

0 commit comments

Comments
 (0)