freebsd-skq/sys/dev/ath/ath_hal/ar5416
Adrian Chadd 6f5fe81e02 Fix a corner-case of interrupt handling which resulted in potentially
spurious (and fatal) interrupt errors.

One user reported seeing this:

Apr 22 18:04:24 ceres kernel: ar5416GetPendingInterrupts: fatal error,
  ISR_RAC 0x0 SYNC_CAUSE 0x2000

SYNC_CAUSE of 0x2000 is AR_INTR_SYNC_LOCAL_TIMEOUT which is a bus timeout;
this shouldn't cause HAL_INT_FATAL to be set.

After checking out ath9k, ath9k_ar9002_hw_get_isr() clears (*masked)
before continuing, regardless of whether any bits in the ISR registers
are set. So if AR_INTR_SYNC_CAUSE is set to something that isn't
treated as fatal, and AR_ISR isn't read or is read and is 0, then
(*masked) wouldn't be cleared. Thus any of the existing bits set
that were passed in would be preserved in the output.

The caller in if_ath - ath_intr() - wasn't setting the masked value
to 0 before calling ath_hal_getisr(), so anything that was present
in that uninitialised variable would be preserved in the case above
of AR_ISR=0, AR_INTR_SYNC_CAUSE != 0; and if the HAL_INT_FATAL bit
was set, a fatal condition would be interpreted and the chip was
reset.

This patch does the following:

* ath_intr() - set masked to 0 before calling ath_hal_getisr();
* ar5416GetPendingInterrupts() - clear (*masked) before processing
  continues; so if the interrupt source is AR_INTR_SYNC_CAUSE
  and it isn't fatal, the hardware isn't reset via returning
  HAL_INT_FATAL.

This doesn't fix any underlying errors which trigger
AR_INTR_SYNC_LOCAL_TIMEOUT - which is a bus timeout of some
sort - so that likely should be further investigated.
2011-04-23 06:37:09 +00:00
..
ar2133.c Add some more debugging 2011-04-02 00:24:13 +00:00
ar5416_ani.c The AR5416+ chips all have MIB counters (which the AR5416 ANI code assumes) 2011-03-23 03:58:55 +00:00
ar5416_attach.c Add a HAL capability bit for supporting self-linked RX descriptors and disable it for the 11n chipsets. 2011-04-04 14:52:31 +00:00
ar5416_beacon.c
ar5416_cal_adcdc.c
ar5416_cal_adcgain.c
ar5416_cal_iq.c Fix the calibration logic to correctly clamp the calculated coefficient. 2010-08-14 15:28:15 +00:00
ar5416_cal.c Export the per-chain ctl/ext noise floor values, raw and uncut, to the 2011-04-08 06:58:01 +00:00
ar5416_cal.h Introduce methods for the initial calibration and the new PA calibration 2011-03-11 11:35:36 +00:00
ar5416_eeprom.c
ar5416_gpio.c Add support for the AR9285 chipset, which is found on many netbooks 2010-01-29 10:10:14 +00:00
ar5416_interrupts.c Fix a corner-case of interrupt handling which resulted in potentially 2011-04-23 06:37:09 +00:00
ar5416_keycache.c
ar5416_misc.c Add global TX timeout handling. 2011-04-18 12:15:43 +00:00
ar5416_phy.c Modify the AR5416 11na rate table to use 24mb OFDM 11a for control traffic, 2011-02-21 05:10:34 +00:00
ar5416_power.c
ar5416_recv.c Add a HAL capability bit for supporting self-linked RX descriptors and disable it for the 11n chipsets. 2011-04-04 14:52:31 +00:00
ar5416_reset.c Fix the merlin LNA configuration code - these are bit flags, not raw values to be 2011-04-22 17:57:13 +00:00
ar5416_xmit.c Bring over a few queue changes from ath9k: 2011-03-22 00:14:17 +00:00
ar5416.h Remove some duplicate code from the AR9285 TX power configuration path. 2011-04-16 11:59:37 +00:00
ar5416.ini Bring over ar5416 inivals from Linux-2.6.34. 2010-08-10 07:48:13 +00:00
ar5416desc.h
ar5416phy.h Add in some AR9280 specific board configuration options. 2011-02-07 22:00:31 +00:00
ar5416reg.h The right commit - add a couple more AR_PCU_MISC_MODE2 register bits - 2011-03-25 00:06:58 +00:00