ath5k: fix SWI calibration interrupt storm
authorBob Copeland <me@bobcopeland.com>
Tue, 22 Dec 2009 03:26:48 +0000 (22:26 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Jan 2010 23:04:10 +0000 (15:04 -0800)
commitd5086b90c5986d33308b1ee99546a86ff1571d07
tree06e125541e5c4c19508e8b20f04e88060aeef51d
parent477702056912abc2120a18e8494fb2204ccdd958
ath5k: fix SWI calibration interrupt storm

commit 242ab7ad689accafd5e87ffd22b85cf1bf7fbbef upstream.

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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/ath5k/base.c