opnsense-src/sys/dev/ath
Adrian Chadd a100c050eb [ath] Hopefully recover better-er upon RX restart on AR9380.
This is all very long-standing bug stuff that is touchy and still poorly
documented. Ok, here goes.

The basic bug:

* deleting a VAP causes the RX path (and TX path too) to be restarted
  without a full chip reset, which causes RX hangs on the AR9380 and later.
  (ie, the ones with the newer DMA engine.)

The basic fix:

* do an RX flush when stopping RX in ath_vap_delete() to match what happens
  when RX is stopped elsewhere.  This ensures any pending frames are completed
  and we restart at the right spot; it also ensures we don't push new RX buffers
  into the hardware if we're stopping receive.

The other issues I found:

* Don't bother checking the RX packet ring in the deferred read taskqueue;
  that's specifically supposed to be for completing frames rather than
  just yanking them off the receive ring.

* Cancel/drain any pending deferred read taskqueue.  This isn't done inside
  any locks so we should be super careful here.  This stops the hardware
  being reprogrammed at the same time in another thread/CPU whilst we're
  stopping RX.

* .. (yes, this should be better serialised, but that's for another day. maybe.)

* Add more debugging to trace what's going on here.

And the fun bit:

* Reinitialise the RX FIFO ONLY if we've been reset or stopped, rather than just
  reset.  I noticed that after all the above was done I was STILL seeing RXEOL.
  RXEOL isn't enabled on the AR9380 so I'd only see it if I was sending TX frames
  (ie a ping where it'd be transmitted but never received) so I was not being
  spammed by RXEOL.  So, as long as stuff is stopped, restart it.

This seems to be doing the right thing in both AP and STA modes.

What I should do next, if I ever get time:

* as I said above, serialise the receive stop/start to include taskqueues
* monitor RXEOL on the AR9380 and I keep seeing it spammed / lockups, just
  go do a full chip reset to get things back on track. It sucks, but it
  is better than nothing.

Tested:

* AR9380 AP/STA mode, adding/deleting a hostap VAP to trigger the TX/RX
  queue stop/start; whilst also running an iperf through it.  Lots of times.
  Lots.  Of.. Times.
2020-05-21 04:35:12 +00:00
..
ath_dfs/null
ath_hal [ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and aggregates. 2020-05-15 18:51:20 +00:00
ath_rate [ath_rate_sample] Obey the maximum frame length even when using static rates. 2020-05-21 03:53:45 +00:00
ah_osdep.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
ah_osdep.h
ah_osdep_ar5210.c
ah_osdep_ar5211.c
ah_osdep_ar5212.c
ah_osdep_ar5416.c
ah_osdep_ar9300.c
if_ath.c [ath] Hopefully recover better-er upon RX restart on AR9380. 2020-05-21 04:35:12 +00:00
if_ath_ahb.c
if_ath_alq.c
if_ath_alq.h
if_ath_beacon.c [net80211] convert all of the WME use over to a temporary copy of WME info. 2018-01-02 00:07:28 +00:00
if_ath_beacon.h
if_ath_btcoex.c ath: fix memory disclosure from ath_btcoex_ioctl 2018-01-02 19:29:30 +00:00
if_ath_btcoex.h
if_ath_btcoex_mci.c
if_ath_btcoex_mci.h
if_ath_debug.c
if_ath_debug.h
if_ath_descdma.c
if_ath_descdma.h
if_ath_dfs.c
if_ath_drv.c
if_ath_ioctl.c Use an accessor function to access ifr_data. 2018-03-30 18:50:13 +00:00
if_ath_ioctl.h
if_ath_keycache.c
if_ath_keycache.h
if_ath_led.c
if_ath_led.h
if_ath_lna_div.c ath: fix possible memory disclosures in ioctl handlers 2018-01-02 19:34:23 +00:00
if_ath_lna_div.h
if_ath_misc.h [ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and aggregates. 2020-05-15 18:51:20 +00:00
if_ath_pci.c Fix PCI_SUBDEV call 2018-07-07 15:55:58 +00:00
if_ath_pci_devlist.h Switch to using new PCI_MATCH stuff. 2018-07-07 15:25:16 +00:00
if_ath_rate.c
if_ath_rx.c [ath] Attempt to fix epoch handling. 2020-02-20 07:12:43 +00:00
if_ath_rx.h
if_ath_rx_edma.c [ath] Hopefully recover better-er upon RX restart on AR9380. 2020-05-21 04:35:12 +00:00
if_ath_rx_edma.h
if_ath_spectral.c ath: fix possible memory disclosures in ioctl handlers 2018-01-02 19:34:23 +00:00
if_ath_spectral.h
if_ath_sysctl.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
if_ath_sysctl.h
if_ath_tdma.c
if_ath_tdma.h
if_ath_tsf.h
if_ath_tx.c [ath] reset hardware if this particular mac bug is seen. 2020-05-21 04:26:20 +00:00
if_ath_tx.h
if_ath_tx_edma.c [ath] [ath_rate] Fix ANI calibration during non-ACTIVE states; start poking at rate control 2019-05-05 04:56:37 +00:00
if_ath_tx_edma.h
if_ath_tx_ht.c [ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and aggregates. 2020-05-15 18:51:20 +00:00
if_ath_tx_ht.h
if_athdfs.h
if_athioctl.h Fix ieee80211_radiotap(9) usage in wireless drivers: 2019-03-11 01:27:01 +00:00
if_athrate.h [ath_rate_sample] Limit the tx schedules for A-MPDU ; don't take short retries 2020-05-16 05:07:45 +00:00
if_athvar.h [ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and aggregates. 2020-05-15 18:51:20 +00:00