Skip to content

wifi: ath9k: fix register access and spectral scan filter handling on ath9k_htc

Nerijus Bendžiūnas linux-wireless lkml stable 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest8 patches 11 repliesApplied

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/8wifi: ath9k: return an error from a failed multi-register readdrivers/net/wireless/ath/ath.h drivers/net/wireless/ath/ath9k/ani.c drivers/net/wireless/ath/ath9k/eeprom.c +6 more+27 -201 reply
2/8wifi: ath9k_htc: fix the byte count of a full RMW buffer flushdrivers/net/wireless/ath/ath9k/htc_drv_init.c drivers/net/wireless/ath/ath9k/wmi.h+2 -21 reply
3/8wifi: ath9k_htc: refuse a command that fills whole USB packetsdrivers/net/wireless/ath/ath9k/hif_usb.c+7 -01 reply
4/8wifi: ath9k: stop a failed register read from opening the RX filterdrivers/net/wireless/ath/ath9k/common-spectral.c drivers/net/wireless/ath/ath9k/hw.c drivers/net/wireless/ath/ath9k/hw.h+26 -51 reply
5/8wifi: ath9k: clear the PHY error filter when a spectral scan is disableddrivers/net/wireless/ath/ath9k/common-spectral.c drivers/net/wireless/ath/ath9k/hw.c drivers/net/wireless/ath/ath9k/hw.h+29 -01 reply
6/8wifi: ath9k: count spectral samples in the driver's own RX statsdrivers/net/wireless/ath/ath9k/common-spectral.c drivers/net/wireless/ath/ath9k/common-spectral.h drivers/net/wireless/ath/ath9k/debug.c +1 more+31 -141 reply
7/8wifi: ath9k_htc: pass CRC-tagged spectral samples to the FFT parserdrivers/net/wireless/ath/ath9k/htc_drv_txrx.c+29 -01 reply
8/8wifi: ath9k_htc: derive the PHY error filter bits from software statedrivers/net/wireless/ath/ath9k/htc_drv_txrx.c+5 -71 reply

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchToke Høiland-Jørgensen
1/8A-b
2/8A-b
3/8A-b
4/8A-b
5/8A-b
6/8A-b
7/8A-b
8/8A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH ath-next v4 0/8] wifi: ath9k: fix register access and spectral scan filter handling on ath9k_htc

Eight fixes for the AR9271 USB driver, resent as one series in dependency order as requested.

Patch 1 gives the multi-register read a return value and checks it.

Patches 2 and 3 belong together: 2 fixes the byte count of a full read-modify-write flush, which has truncated the AR9271 PA calibration since the buffer was added, and caps the buffer at 14 entries because the corrected 15-entry command fills whole USB packets and is never delivered; 3 refuses any such command.

Patches 4, 5 and 8 are one bug family: a timed-out register read returns all ones, and the spectral scan wrote it back into the RX filter (4); disabling the scan never cleared the PHY error bits (5); the ath9k_htc filter recalculation read the same registers back (8). 5 needs 4's helper, 8 needs both. 8 has a Fixes tag but no stable tag:
the failure has not been seen on that path.

Patch 6 fixes an out-of-bounds write in the shared spectral code on ath9k_htc. Patch 7 passes CRC-tagged spectral samples to the FFT parser, which the firmware reports as CRC errors. Both stand alone.

Testing, all on AR9271; ath9k (PCI) is build-tested only:

1: build; a timed-out multi-read was not provoked.
2, 3: 100 interface opens on two devices, also on the stock
firmware, no hang; the size fix without the cap hangs the device on the first open.
4: with a read fault injected the filter stays closed. 5: PHY error frames after a scan is disabled fall from about 2000/s
to tens/s.
6: a 7 hour scan soak with no memory corruption where the unpatched
driver faulted within a minute.
7: about 24 % more spectral samples per second at baseline. 8: filter recalculation issues no reads; the timeout it guards
against was not provoked.
All eight, on the series as sent: 965 interface up/down cycles with
spectral bursts, then 5 hours of continuous scanning under a 900 frame/s injected load; 657,426 WMI commands and 5,808 multi-register reads, none failed; taint unchanged.

Not in this series: the acked -EBUSY guard for spectral scan control while the hardware is disabled, and the ath9k_htc debugfs counters and round-trip work, which follow once these fixes are in.

Changes since the separate threads: patch 1 returns the error instead of filling the buffer with all ones, patch 3 returns -EMSGSIZE, kernel-doc for the RX filter helpers and no other code comments, one base, the git-blame authors on Cc, shorter commit messages, and the Assisted-by trailer in the documented form.

Nerijus Bendžiūnas (8):
wifi: ath9k: return an error from a failed multi-register read
wifi: ath9k_htc: fix the byte count of a full RMW buffer flush
wifi: ath9k_htc: refuse a command that fills whole USB packets
wifi: ath9k: stop a failed register read from opening the RX filter
wifi: ath9k: clear the PHY error filter when a spectral scan is
disabled
wifi: ath9k: count spectral samples in the driver's own RX stats
wifi: ath9k_htc: pass CRC-tagged spectral samples to the FFT parser
wifi: ath9k_htc: derive the PHY error filter bits from software state

 drivers/net/wireless/ath/ath.h                |  2 +-
 drivers/net/wireless/ath/ath9k/ani.c          |  4 +-
 .../net/wireless/ath/ath9k/common-spectral.c  | 41 +++++++++++------
 .../net/wireless/ath/ath9k/common-spectral.h  | 10 +++-
 drivers/net/wireless/ath/ath9k/debug.c        |  3 +-
 drivers/net/wireless/ath/ath9k/eeprom.c       | 10 ++--
 drivers/net/wireless/ath/ath9k/eeprom.h       |  2 +-
 drivers/net/wireless/ath/ath9k/eeprom_4k.c    |  4 +-
 drivers/net/wireless/ath/ath9k/eeprom_9287.c  |  7 ++-
 drivers/net/wireless/ath/ath9k/eeprom_def.c   |  5 +-
 drivers/net/wireless/ath/ath9k/hif_usb.c      |  7 +++
 .../net/wireless/ath/ath9k/htc_drv_debug.c    |  3 +-
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |  9 ++--
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 41 ++++++++++++++---
 drivers/net/wireless/ath/ath9k/hw.c           | 46 +++++++++++++++++++
 drivers/net/wireless/ath/ath9k/hw.h           |  2 +
 drivers/net/wireless/ath/ath9k/init.c         |  6 ++-
 drivers/net/wireless/ath/ath9k/wmi.h          |  2 +-
 18 files changed, 156 insertions(+), 48 deletions(-)

base-commit: c3bace8584ca707e34ba837f65c2e9d566af4c2c

Signature · 1 line
2.55.0