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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
ah_osdep_ar5210.c [ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL. 2017-05-25 04:18:46 +00:00
ah_osdep_ar5211.c [ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL. 2017-05-25 04:18:46 +00:00
ah_osdep_ar5212.c [ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL. 2017-05-25 04:18:46 +00:00
ah_osdep_ar5416.c [ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL. 2017-05-25 04:18:46 +00:00
ah_osdep_ar9300.c [ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL. 2017-05-25 04:18:46 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_alq.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_alq.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_btcoex.c ath: fix memory disclosure from ath_btcoex_ioctl 2018-01-02 19:29:30 +00:00
if_ath_btcoex.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_btcoex_mci.c Fix kernel build. Improper definition location of a variable. 2016-06-02 01:59:41 +00:00
if_ath_btcoex_mci.h [ath] commit initial bluetooth coexistence support for the MCI NICs. 2016-06-02 00:51:36 +00:00
if_ath_debug.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_debug.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_descdma.c [ath] migrate ioctl and busdma memory operations out into separate source files. 2015-11-24 03:42:58 +00:00
if_ath_descdma.h [ath] migrate ioctl and busdma memory operations out into separate source files. 2015-11-24 03:42:58 +00:00
if_ath_dfs.c [ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL. 2017-05-25 04:18:46 +00:00
if_ath_drv.c [ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL. 2017-05-25 04:18:46 +00:00
if_ath_ioctl.c Use an accessor function to access ifr_data. 2018-03-30 18:50:13 +00:00
if_ath_ioctl.h [ath] migrate ioctl and busdma memory operations out into separate source files. 2015-11-24 03:42:58 +00:00
if_ath_keycache.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_keycache.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_led.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_led.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 [ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL. 2017-05-25 04:18:46 +00:00
if_ath_rx.c [ath] Attempt to fix epoch handling. 2020-02-20 07:12:43 +00:00
if_ath_rx.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_spectral.c ath: fix possible memory disclosures in ioctl handlers 2018-01-02 19:34:23 +00:00
if_ath_spectral.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_tdma.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_tdma.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_ath_tsf.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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 sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
if_athdfs.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
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