linux_dsm_epyc7002/drivers/net/wireless
Nick Kossifidis 7ff7c82ee4 ath5k: Switch from read-and-clear to write-to-clear method when handling PISR/SISR registers
Since card has 12 tx queues and we want to keep track of the interrupts
per queue we can't fit all these interrupt bits on a single register.
So we have 5 registers, the primary interrupt status register (PISR) and
the 4 secondary interupt status registers (SISRs).

In order to be able to read them all at once (atomic operation) Atheros
introduced the Read-And-Clear registers to make things easier. So when
reading RAC_PISR register, hw does a read on PISR and all SISRs, returns
the value of PISR, copies all SISR values to their shadow copies (RAC_SISRx)
and clears PISR and SISRs. This saves us from reading PISR/SISRs in a sequence.

So far we 've used this approach and MadWiFi/Windows driver etc also used it
for years.

It turns out this operation is not atomic after all (at least not on all cards)
That means it's possible to loose some interrupts because they came after the
copy step and hw cleared them on the clean step !

That's probably the reason we got missed beacons, got stuck queues etc and
couldn't figure out what was going on.

With this patch we switch from RaC operation to an alternative method (that
makes more sense IMHO anyway, I just chose to be on the safe side so far).
Instead of reading RAC registers, we read the normal PISR/SISR registers and
clear any bits we got by writing them back on the register. This will clear only
the bits we got on our read step and leave any new bits unaffected (at least
that's what docs say). So if any new interrupts come up we won't miss it.

I've tested this with an AR5213 and an AR2425 and it seems O.K.

Many thanks to Adrian Chadd for debuging this and reviewing the patch !

v2: Make sure we don't clear PISR bits that map to SISR generated interrupts
(added a comment on the code for this)

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28 14:44:10 -05:00
..
ath ath5k: Switch from read-and-clear to write-to-clear method when handling PISR/SISR registers 2011-11-28 14:44:10 -05:00
b43 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux 2011-11-22 14:05:46 -05:00
b43legacy Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
brcm80211 brcm80211: fmac: change function bus_stop parameter 2011-11-28 14:43:48 -05:00
hostap hostap_cs: add ID for Canon K30225 2011-11-28 14:44:00 -05:00
ipw2x00 wireless: use strlcpy routine in .get_drvinfo 2011-11-17 15:44:50 -05:00
iwlegacy Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux 2011-11-22 14:05:46 -05:00
iwlwifi Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux 2011-11-22 14:05:46 -05:00
iwmc3200wifi Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux 2011-11-22 14:05:46 -05:00
libertas wireless: Remove redundant spi driver bus initialization 2011-11-28 14:43:58 -05:00
libertas_tf drivers/net: change moduleparam.h to module.h as required. 2011-10-31 19:31:08 -04:00
mwifiex mwifiex: add support for Marvell sd8797 device 2011-11-17 15:45:19 -05:00
orinoco Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux 2011-11-22 14:05:46 -05:00
p54 wireless: Remove redundant spi driver bus initialization 2011-11-28 14:43:58 -05:00
prism54 wireless: use strlcpy routine in .get_drvinfo 2011-11-17 15:44:50 -05:00
rt2x00 rt2x00: Pass BlockAck and BlackAckReq frames to mac80211 in monitor mode 2011-11-28 14:43:55 -05:00
rtl818x drivers/net: Add module.h to drivers who were implicitly using it 2011-10-31 19:31:07 -04:00
rtlwifi rtlwifi: Fix incorrect return of IRQ_HANDLED 2011-11-28 14:43:53 -05:00
wl12xx wireless: Remove redundant spi driver bus initialization 2011-11-28 14:43:58 -05:00
wl1251 wireless: Remove redundant spi driver bus initialization 2011-11-28 14:43:58 -05:00
zd1211rw drivers/net: Add module.h to drivers who were implicitly using it 2011-10-31 19:31:07 -04:00
adm8211.c drivers/net: Add module.h to drivers who were implicitly using it 2011-10-31 19:31:07 -04:00
adm8211.h
airo_cs.c
airo.c
airo.h
at76c50x-usb.c wireless: at76c50x: follow rename pack_hex_byte to hex_byte_pack 2011-10-31 17:30:57 -07:00
at76c50x-usb.h
atmel_cs.c
atmel_pci.c
atmel.c
atmel.h
Kconfig net: wireless: add brcm80211 drivers 2011-10-11 15:55:30 -04:00
mac80211_hwsim.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux 2011-11-22 14:05:46 -05:00
mac80211_hwsim.h
Makefile iwlegacy: rename remaining IWLs to ILs 2011-11-15 11:25:42 +01:00
mwl8k.c mac80211: pass vif param to conf_tx() callback 2011-10-03 15:22:41 -04:00
ray_cs.c
ray_cs.h
rayctl.h
rndis_wlan.c rndis_wlan: remove unused macro 2011-11-21 16:22:09 -05:00
wl3501_cs.c wl3501_cs: min_t() cast truncates high bits 2011-09-27 14:36:04 -04:00
wl3501.h
zd1201.c
zd1201.h