Skip to content

Commit

Permalink
iwlwifi: fix PCI-E transport "inta" race
Browse files Browse the repository at this point in the history
When an interrupt comes in, we read the reason
bits and collect them into "trans_pcie->inta".
This happens with the spinlock held. However,
there's a bug resetting this variable -- that
happens after the spinlock has been released.
This means that it is possible for interrupts
to be missed if the reset happens after some
other interrupt reasons were already added to
the variable.

I found this by code inspection, looking for a
reason that we sometimes see random commands
time out. It seems possible that this causes
such behaviour, but I can't say for sure right
now since it happens extremely infrequently on
my test systems.

Cc: stable@vger.kernel.org [3.2]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jan 24, 2012
1 parent 405385f commit b49ba04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,11 +972,11 @@ void iwl_irq_tasklet(struct iwl_trans *trans)
}
#endif

spin_unlock_irqrestore(&trans->shrd->lock, flags);

/* saved interrupt in inta variable now we can reset trans_pcie->inta */
trans_pcie->inta = 0;

spin_unlock_irqrestore(&trans->shrd->lock, flags);

/* Now service all interrupt bits discovered above. */
if (inta & CSR_INT_BIT_HW_ERR) {
IWL_ERR(trans, "Hardware error detected. Restarting.\n");
Expand Down

0 comments on commit b49ba04

Please sign in to comment.