iwl3945: fix wakeup interrupt
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 19 Feb 2014 08:15:09 +0000 (09:15 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 Feb 2014 20:21:55 +0000 (15:21 -0500)
We have only 5 tx queues on 3945, updating il->txq[5] results in
writing random value to HBUS_TARG_WRPTR register.

Additionally use spin lock to protect txq->write_ptr and
txq->need_update fields also modified in TX path.

Tested-by: Pedro Francisco <pedrogfrancisco@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlegacy/3945-mac.c

index 0487461ae4da22053607bb49178e296787e18dc3..46b32d41aa2f3287016647d8ad509dea02283dc7 100644 (file)
@@ -1495,12 +1495,14 @@ il3945_irq_tasklet(struct il_priv *il)
        if (inta & CSR_INT_BIT_WAKEUP) {
                D_ISR("Wakeup interrupt\n");
                il_rx_queue_update_write_ptr(il, &il->rxq);
+
+               spin_lock_irqsave(&il->lock, flags);
                il_txq_update_write_ptr(il, &il->txq[0]);
                il_txq_update_write_ptr(il, &il->txq[1]);
                il_txq_update_write_ptr(il, &il->txq[2]);
                il_txq_update_write_ptr(il, &il->txq[3]);
                il_txq_update_write_ptr(il, &il->txq[4]);
-               il_txq_update_write_ptr(il, &il->txq[5]);
+               spin_unlock_irqrestore(&il->lock, flags);
 
                il->isr_stats.wakeup++;
                handled |= CSR_INT_BIT_WAKEUP;