mbox series

[v3,00/11] wifi: ath9k: add support for QCN550x

Message ID 20230629231625.951744-1-wlooi@ucalgary.ca
Headers show
Series wifi: ath9k: add support for QCN550x | expand

Message

Wenli Looi June 29, 2023, 11:16 p.m. UTC
This patchset adds support for QCN550x. Compared to previous versions of
this patchset:

- Removed hidden dependencies on ah macro
  (see commit b3a663f0037d20e77bbafd9271a3d9dd0351059d)
- Done significantly more testing and performance improvements. In my
  informal testing, the 3x3 performance of this driver generally meets
  or exceeds the performance of stock firmwares, which was not the case
  for previous patchsets. The main source of the improvement was
  enabling the clock doubler.

Notes:

- While QCN5502 is a 4-stream device, ath9k only supports 3 streams, and
  that is unchanged.
- The QCN550x EEPROM format is different from other AR9003 devices due
  to the 4th stream. An abstraction layer has been added over the EEPROM
  to support both formats.
- This driver has been tested on the following devices:
  - Asus RT-ACRH12 (FCC ID: MSQ-RTACRH01)
    QCN5502 4x4 RX mode 1 (no XLNA) TX mode 1 (no XPA)
  - Netgear EX6400v2 (FCC ID: PY318300422)
    QCN5502 3x3 RX mode 1 (no XLNA) TX mode 1 (no XPA)
  - Netgear EX7300v2 (FCC ID: PY318300422)
    QCN5502 4x4 RX mode 1 (no XLNA) TX mode 1 (no XPA)
  - TP-Link Archer A9 v6 (FCC ID: TE7A9V6)
    QCN5502 4x4 RX mode 0 (XLNA) TX mode 1 (no XPA)
  - Netgear EX7300v1: QCA9558 (no obvious regression observed)
- No device has been tested that uses QCN5502 with XPA or 5GHz. I don't
  know if such devices exists.

Wenli Looi (11):
  wifi: ath9k: group some ar9300 eeprom functions at the top
  wifi: ath9k: delete some unused/duplicate macros
  wifi: ath9k: add _ah parameter to certain macros
  Revert "ath9k_hw: fall back to OTP ROM when platform data has no valid
    eeprom data"
  wifi: ath9k: add QCN550x device IDs
  wifi: ath9k: basic support for QCN550x
  wifi: ath9k: add QCN550x initvals
  wifi: ath9k: implement QCN550x rx
  wifi: ath9k: implement QCN550x tx
  wifi: ath9k: add abstractions over ar9300 eeprom
  wifi: ath9k: add QCN550x eeprom

 drivers/net/wireless/ath/ath9k/ahb.c          |    4 +
 drivers/net/wireless/ath/ath9k/ani.c          |    2 +-
 .../net/wireless/ath/ath9k/ar550x_initvals.h  | 1539 +++++++++++++++++
 drivers/net/wireless/ath/ath9k/ar9003_aic.c   |   52 +-
 drivers/net/wireless/ath/ath9k/ar9003_calib.c |   98 +-
 .../net/wireless/ath/ath9k/ar9003_eeprom.c    | 1069 ++++++++----
 .../net/wireless/ath/ath9k/ar9003_eeprom.h    |  112 ++
 drivers/net/wireless/ath/ath9k/ar9003_hw.c    |   65 +
 drivers/net/wireless/ath/ath9k/ar9003_mac.c   |   92 +-
 drivers/net/wireless/ath/ath9k/ar9003_mac.h   |   10 +
 drivers/net/wireless/ath/ath9k/ar9003_mci.c   |    4 +-
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c |  120 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c   |  370 ++--
 drivers/net/wireless/ath/ath9k/ar9003_phy.h   |  598 ++++---
 drivers/net/wireless/ath/ath9k/ar9003_rtt.c   |   32 +-
 drivers/net/wireless/ath/ath9k/hw.c           |   43 +-
 drivers/net/wireless/ath/ath9k/hw.h           |    2 +
 drivers/net/wireless/ath/ath9k/mac.c          |    2 +-
 drivers/net/wireless/ath/ath9k/mac.h          |   13 +
 drivers/net/wireless/ath/ath9k/recv.c         |    2 +-
 drivers/net/wireless/ath/ath9k/reg.h          |   13 +-
 drivers/net/wireless/ath/ath9k/reg_aic.h      |   44 +-
 drivers/net/wireless/ath/ath9k/rng.c          |    4 +-
 23 files changed, 3232 insertions(+), 1058 deletions(-)
 create mode 100644 drivers/net/wireless/ath/ath9k/ar550x_initvals.h

Comments

Toke Høiland-Jørgensen Aug. 10, 2023, 4:51 p.m. UTC | #1
I've started looking at this now. A few initial questions:

> This patchset adds support for QCN550x. Compared to previous versions of
> this patchset:
>
> - Removed hidden dependencies on ah macro
>   (see commit b3a663f0037d20e77bbafd9271a3d9dd0351059d)
> - Done significantly more testing and performance improvements. In my
>   informal testing, the 3x3 performance of this driver generally meets
>   or exceeds the performance of stock firmwares, which was not the case
>   for previous patchsets. The main source of the improvement was
>   enabling the clock doubler.

Did you do any regression tests on other types of ar9300 hardware to
ensure these patches don't negatively affect existing systems?

>   Revert "ath9k_hw: fall back to OTP ROM when platform data has no valid
>     eeprom data"

This revert seems a bit dodgy; the commit message states "Users
currently relying on this silent fallback will need to stop providing
invalid EEPROM data to the driver." - which kinda sounds like a
kernel-to-userspace regression to me? Do any such systems actually
exist?

-Toke
Wenli Looi Aug. 17, 2023, 11:20 p.m. UTC | #2
> Did you do any regression tests on other types of ar9300 hardware to
> ensure these patches don't negatively affect existing systems?

I've tried this new driver on a QCA9558 SoC (Netgear EX7300v1) which is
another ar9300 device, and the access point performance didn't seem to
be affected. I could do more detailed tests if desired.

> 
> >   Revert "ath9k_hw: fall back to OTP ROM when platform data has no valid
> >     eeprom data"
> 
> This revert seems a bit dodgy; the commit message states "Users
> currently relying on this silent fallback will need to stop providing
> invalid EEPROM data to the driver." - which kinda sounds like a
> kernel-to-userspace regression to me? Do any such systems actually
> exist?

I'm not sure if such systems exist. They shouldn't for the SoC devices
like QCA9558, because i don't think they support EEPROM at all. It's
possible that they exist for pcie devices, but I expect the vast
majority of users would not be overriding the eeprom. Arguably, if they
are setting qca,no-eeprom and this silent fallback ignores and uses
eeprom anyways, that could be considered a bug that is fixed here? We
could also choose to keep the fallback except for this new device.

I cc'ed Felix Fietkau here. If you remember the context for this change,
that would probably be helpful.
Wenli Looi Nov. 13, 2023, 5:12 a.m. UTC | #3
I've updated the following github pull request to show how this patch can be incorporated into OpenWrt to provide 2.4GHz wifi support for all QCN5502 devices: https://github.com/openwrt/openwrt/pull/9389

There are prebuilt images for all existing QCN5502 devices, and it is also possible to build from source for any device.

Hopefully this can provide some context on how this driver can be useful, and can be a source of feedback from others who try out the driver.