1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-21 07:15:49 +00:00
freebsd/sys/dev
Adrian Chadd 842a2c1ad3 uath: flush data/commands to the firmware before changing channel / state
The driver wasn't stable - it would start fine, but during scan
it would eventually hang and no further command endpoint transfers
would complete.

After adding some debugging and looking at the logs I noticed that
things went sideways once a /data/ frame was sent.  The channel
change config happened between the data frame being sent and
being completed.

My guess is that the firmware doesn't like a channel change
and reset whilst there's pending data frames.  Checking the Linux
driver I found that it was doing a flush before a channel change,
and we're doing it afterwards.  This acts like a fence around
ensuring scheduled TX work has completed.  In net80211 the
transmit path and the control path aren't serialised, so it's
very often the case that ioctls, state changes, etc occur
whilst in parallel there are frame transmits being scheduled.

This seems to happen more frequently on a more recent, high core
(8) machine with XHCI.  I remember testing this driver years ago
on single and dual core CPU laptops with no problems.

So, add some flushes - before a channel change, and during
a transition to AUTH when the BSS config is being programmed into
the firmware.  These two fences seem enough to reliably
associate as a 2GHz and 5GHz STA.

Note that this isn't entirely blocking all newly queued
transmit work from occuring until after the NIC has finished
configuration.  That will need some further investigation.

Locally tested:

  * Wistron NuWeb AR5523 dual-band NIC, STA mode, 2/5GHz

Differential Revision:	https://reviews.freebsd.org/D47655
2024-11-18 20:50:41 -08:00
..
aac
aacraid
acpi_support
acpica Use the correct idle routine on recent AMD EPYC servers 2024-11-08 17:10:44 -05:00
adb Use bus_generic_detach directly instead of a wrapper 2024-11-04 20:30:13 -05:00
adlink
ae
age
agp
ahci
aic7xxx
al_eth
alc
ale
alpm
altera
amd_ecc_inject
amdgpio
amdpm
amdsbwd
amdsmb
amdsmn
amdtemp
arcmsr
asmc
ata
ath net80211: add IEEE80211_IS_QOS_NULL() 2024-11-18 20:50:17 -08:00
atkbdc
atopcase
axgbe
backlight
bce
beri
bfe
bge
bhnd
bnxt bnxt: Use IfAPI accessors where able 2024-11-13 14:30:58 -05:00
bwi
bwn
bxe
cadence
cardbus
cas
cesa
cfe
cfi
chromebook_platform
ciss
clk riscv: Allwinner D1 clock and reset driver 2024-11-16 15:04:04 -04:00
coretemp
cpuctl
cpufreq
cxgb
cxgbe
cyapa
dc
dcons
dialog/da9063
dpaa
dpaa2 dpaa2_mc: Check for error the first time bus_generic_detach is called 2024-11-04 20:30:53 -05:00
dpms
drm2
dwc
dwwdt Check for errors when detaching children first, not last 2024-11-04 20:30:33 -05:00
e1000 e1000: Improve igb(4) SFP support 2024-11-06 23:10:14 -07:00
efidev
ena Check for errors when detaching children first, not last 2024-11-04 20:30:33 -05:00
enetc
enic
eqos
et
etherswitch
evdev
exca
fb
fdc
fdt Check for errors when detaching children first, not last 2024-11-04 20:30:33 -05:00
ffec
filemon
firewire
firmware
flash
ftgpio
ftwd
fxp
gem
glxiic
glxsb
goldfish
gpio gpiospi: Fix module dependencies. 2024-11-15 06:55:14 +01:00
gve gve: Fix TX livelock 2024-11-06 15:06:41 +00:00
hdmi
hid hidraw(4): update hgd_actlen in HIDRAW_GET_REPORT ioctl 2024-11-18 07:31:39 +03:00
hifn hifn/safe: Remove dummy calls to bus_generic_detach 2024-11-04 20:31:30 -05:00
hpt27xx
hptiop
hptmv
hptnr
hptrr
hwpmc
hwreset
hyperv
iavf
ic
ice ice(4): properly use kernel option RSS 2024-11-04 11:01:37 -04:00
ichiic ig4(4): Add Meteor Lake PCI IDs 2024-11-09 08:11:09 +03:00
ichsmb
ichwd
ida
igc
iicbus iichid(4): Do not power down opened device in attach handler 2024-11-09 08:11:09 +03:00
imcsmb
intel
intpm
io
ioat
iommu iommu: eliminate iommu_free_ctx() 2024-11-03 21:38:19 +02:00
ipmi
ips
ipw net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macros 2024-11-17 09:53:04 -08:00
irdma
isci
iscsi
iser
isl
ismt
isp
ispfw
itwd
iwi
iwm
iwn net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macros 2024-11-17 09:53:04 -08:00
ixgbe ixgbe: Add support for 1Gbit DAC links 2024-11-14 00:11:08 -07:00
ixl
jedec_dimm
jme
kbd
kbdmux
ksyms
kvm_clock
le
led
lge
liquidio
mailbox/arm
malo net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macros 2024-11-17 09:53:04 -08:00
mana Check for errors when detaching children first, not last 2024-11-04 20:30:33 -05:00
mbox
md
mdio Use bus_generic_detach directly instead of a wrapper 2024-11-04 20:30:13 -05:00
mem
mfi
mgb
mge
mii
mlx
mlx4
mlx5 mlx5en: improve reporting of kernel TLS, IPSEC offload, and ratelimit caps 2024-11-14 00:56:11 +02:00
mlxfw
mmc
mmcnull
mpi3mr
mpr
mps
mpt
mrsas
msk
mthca
mvs
mwl net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macros 2024-11-17 09:53:04 -08:00
mxge
my
nctgpio
ncthwm
neta
netmap
nfe
nfsmb
nge
nmdm
ntb
null
nvd
nvdimm
nvme nvme: Pass malloc flags to request allocation functions 2024-11-09 17:34:12 +00:00
nvmem
nvmf nvmf: Track SQ flow control 2024-11-11 11:39:05 -05:00
nvram
oce
ocs_fc
ofw
otus net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macros 2024-11-17 09:53:04 -08:00
ow
p2sb
pbio
pccard
pccbb
pcf
pci pci_user.c: Cosmetic fixes 2024-11-13 11:10:27 -05:00
phy
pms
powermac_nvram
ppbus
ppc
proto
psci
pst
pty
puc
pwm
qat
qat_c2xxx
qcom_clk
qcom_dwc3
qcom_gcc
qcom_mdio
qcom_qup
qcom_rnd
qcom_tcsr
qcom_tlmm
qlnx qlnx: Convert recent changes to IfAPI 2024-11-13 14:30:59 -05:00
qlxgb
qlxgbe
qlxge
quicc
ral net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macros 2024-11-17 09:53:04 -08:00
random
rccgpio
re
regulator
rl
rndtest
rtsx
rtwn rtwn: ensure TX work isn't scheduled during reset / abort 2024-11-08 08:26:05 -08:00
safe hifn/safe: Remove dummy calls to bus_generic_detach 2024-11-04 20:31:30 -05:00
safexcel
sbni
scc
sdhci
sdio
sec
sff Remove bogus detach routines 2024-11-04 20:31:16 -05:00
sfxge
sge
siis
sis
sk
smartpqi
smbios
smbus
smc
snp
sound sound: Include ai2s and davbus for PowerPC 2024-11-10 02:44:14 +00:00
speaker
spibus
sram
ste
stge
sume
superio
sym
syscon
syscons
tcp_log
tdfx
ti
tpm
tsec
tws
uart
usb uath: flush data/commands to the firmware before changing channel / state 2024-11-18 20:50:41 -08:00
veriexec
vge
viapm
viawd
video
videomode
virtio
vkbd
vmd
vmgenc
vmm vmm: Add a device file interface for creating and destroying VMs 2024-11-05 01:40:41 +00:00
vmware
vnic
vr
vt
vte
watchdog
wbwd
wdatwd
wg
wpi
wtap
xdma
xen
xilinx
xl
xz
zlib