[PATCH 0/7] rtlwifi: PCIe capability access fix + improvements

From: Ilpo Järvinen
Date: Fri Nov 17 2023 - 04:47:42 EST


The rtlwifi driver has code fragments that are using old interface or
custom code to access PCIe capabilities.

The use of old interfaces causes an issue with LNKCTL register that
requires locking during RMW operations. Standard PCIe capability
accessors provide the necessary locking so they should be always used.
The first patch of the series addresses that problem.

The rest of the patches cleanup PCIe capability related code.

Additional note: This series provides only a stop-gap solution to the
RMW concurrency issue, the overall plan is to migrate all ASPM related
handling into the ASPM service driver in order for it to accurately
track ASPM state [1].

[1] https://lore.kernel.org/linux-pci/20230918131103.24119-1-ilpo.jarvinen@xxxxxxxxxxxxxxx/

Ilpo Järvinen (7):
wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors
wifi: rtlwifi: Convert to use PCIe capability accessors
rtlwifi: rtl8821ae: Remove unnecessary PME_Status bit set
rtlwifi: rtl8821ae: Reverse PM capability exists check
rtlwifi: rtl8821ae: Use pci_find_capability()
rtlwifi: rtl8821ae: Add pdev into _rtl8821ae_clear_pci_pme_status()
rtlwifi: rtl8821ae: Access full PMCS reg and use pci_regs.h

drivers/net/wireless/realtek/rtlwifi/pci.c | 69 ++++++++---------
drivers/net/wireless/realtek/rtlwifi/pci.h | 3 -
.../wireless/realtek/rtlwifi/rtl8821ae/hw.c | 76 +++++--------------
3 files changed, 48 insertions(+), 100 deletions(-)

--
2.30.2