Skip to content

Commit

Permalink
ath5k: fix SWI calibration interrupt storm
Browse files Browse the repository at this point in the history
The calibration period is now invoked by triggering a software
interrupt from within the ISR by ath5k_hw_calibration_poll()
instead of via a timer.

However, the calibration interval isn't initialized before
interrupts are enabled, so we can have a situation where an
interrupt occurs before the interval is assigned, so the
interval is actually negative.  As a result, the ISR will
arm a software interrupt to schedule the tasklet, and then
rearm it when the SWI is processed, and so on, leading to a
softlockup at modprobe time.

Move the initialization order around so the calibration interval
is set before interrupts are active.  Another possible fix
is to schedule the tasklet directly from the poll routine,
but I think there are additional plans for the SWI.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Bob Copeland authored and John W. Linville committed Dec 28, 2009
1 parent 2e10d33 commit 242ab7a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,9 @@ ath5k_init(struct ath5k_softc *sc)
*/
ath5k_stop_locked(sc);

/* Set PHY calibration interval */
ah->ah_cal_intval = ath5k_calinterval;

/*
* The basic interface to setting the hardware in a good
* state is ``reset''. On return the hardware is known to
Expand Down Expand Up @@ -2408,10 +2411,6 @@ ath5k_init(struct ath5k_softc *sc)

/* Set ack to be sent at low bit-rates */
ath5k_hw_set_ack_bitrate_high(ah, false);

/* Set PHY calibration inteval */
ah->ah_cal_intval = ath5k_calinterval;

ret = 0;
done:
mmiowb();
Expand Down

0 comments on commit 242ab7a

Please sign in to comment.