mirror_ubuntu-kernels/drivers/net/wireless/ath/ath10k
Thomas Hebb c848966806 ath10k: search all IEs for variant before falling back
commit f2593cb1b2 ("ath10k: Search SMBIOS for OEM board file
extension") added a feature to ath10k that allows Board Data File
(BDF) conflicts between multiple devices that use the same device IDs
but have different calibration requirements to be resolved by allowing
a "variant" string to be stored in SMBIOS [and later device tree, added
by commit d06f26c5c8 ("ath10k: search DT for qcom,ath10k-calibration-
variant")] that gets appended to the ID stored in board-2.bin.

This original patch had a regression, however. Namely that devices with
a variant present in SMBIOS that didn't need custom BDFs could no longer
find the default BDF, which has no variant appended. The patch was
reverted and re-applied with a fix for this issue in commit 1657b8f84e
("search SMBIOS for OEM board file extension").

But the fix to fall back to a default BDF introduced another issue: the
driver currently parses IEs in board-2.bin one by one, and for each one
it first checks to see if it matches the ID with the variant appended.
If it doesn't, it checks to see if it matches the "fallback" ID with no
variant. If a matching BDF is found at any point during this search, the
search is terminated and that BDF is used. The issue is that it's very
possible (and is currently the case for board-2.bin files present in the
ath10k-firmware repository) for the default BDF to occur in an earlier
IE than the variant-specific BDF. In this case, the current code will
happily choose the default BDF even though a better-matching BDF is
present later in the file.

This patch fixes the issue by first searching the entire file for the ID
with variant, and searching for the fallback ID only if that search
fails. It also includes some code cleanup in the area, as
ath10k_core_fetch_board_data_api_n() no longer does its own string
mangling to remove the variant from an ID, instead leaving that job to a
new flag passed to ath10k_core_create_board_name().

I've tested this patch on a QCA4019 and verified that the driver behaves
correctly for 1) both fallback and variant BDFs present, 2) only fallback
BDF present, and 3) no matching BDFs present.

Fixes: 1657b8f84e ("ath10k: search SMBIOS for OEM board file extension")
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19 19:18:15 +03:00
..
ahb.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
ahb.h ath10k: expose hif ops for ahb 2016-01-28 10:47:28 +02:00
bmi.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
bmi.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
ce.c ath10k: correct target assert problem due to CE5 stuck 2018-04-19 18:58:27 +03:00
ce.h ath10k: check all CE for data if irq summary is not retained 2018-04-19 18:52:57 +03:00
core.c ath10k: search all IEs for variant before falling back 2018-04-19 19:18:15 +03:00
core.h ath10k: Add tx ack signal support for management frames 2018-04-19 18:47:00 +03:00
coredump.c ath10k: add memory dump support QCA9984 2018-03-29 11:54:32 +03:00
coredump.h ath10k: add memory dump support QCA9984 2018-03-29 11:54:32 +03:00
debug.c ath10k: debugfs support to get final TPC stats for 10.4 variants 2018-03-26 18:08:56 +03:00
debug.h ath10k: debugfs support to get final TPC stats for 10.4 variants 2018-03-26 18:08:56 +03:00
debugfs_sta.c ath10k: add sta rx packet stats per tid 2018-03-26 18:06:44 +03:00
hif.h ath10k: add support to get target info from hif ops 2018-04-19 18:52:51 +03:00
htc.c ath10k: add HTC services for WCN3990 2018-04-19 18:52:12 +03:00
htc.h ath10k: add HTC services for WCN3990 2018-04-19 18:52:12 +03:00
htt_rx.c ath10k: Add tx ack signal support for management frames 2018-04-19 18:47:00 +03:00
htt_tx.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
htt.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
htt.h ath10k: Add tx ack signal support for management frames 2018-04-19 18:47:00 +03:00
hw.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
hw.h ath10k: check all CE for data if irq summary is not retained 2018-04-19 18:52:57 +03:00
Kconfig ath10k: platform driver for WCN3990 SNOC WLAN module 2018-04-19 18:51:52 +03:00
mac.c ath10k: advertize beacon_int_min_gcd 2018-03-29 12:01:19 +03:00
mac.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
Makefile ath10k: platform driver for WCN3990 SNOC WLAN module 2018-04-19 18:51:52 +03:00
p2p.c ath10k: remove ath10k_vif_to_arvif() 2017-02-14 19:38:15 +02:00
p2p.h ath10k: implement handling of p2p noa event 2015-03-07 09:57:42 +02:00
pci.c ath10k: modify hif tx paddr to dma_addr_t type 2018-04-19 18:52:44 +03:00
pci.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
rx_desc.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
sdio.c ath10k: sdio: fix memory leak for probe allocations 2018-04-10 17:30:50 +03:00
sdio.h ath10k: sdio: remove unused struct member 2017-08-31 15:14:18 +03:00
snoc.c ath10k: vote for hardware resources for WCN3990 2018-04-19 18:53:03 +03:00
snoc.h ath10k: vote for hardware resources for WCN3990 2018-04-19 18:53:03 +03:00
spectral.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
spectral.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
swap.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
swap.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
targaddrs.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
testmode_i.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
testmode.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
testmode.h
thermal.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
thermal.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
trace.c
trace.h ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait 2018-03-26 18:13:03 +03:00
txrx.c ath10k: Add tx ack signal support for management frames 2018-04-19 18:47:00 +03:00
txrx.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
usb.c ath10k: add initial USB support 2017-08-03 14:31:01 +03:00
usb.h ath10k: add initial USB support 2017-08-03 14:31:01 +03:00
wmi-ops.h ath10k: debugfs support to get final TPC stats for 10.4 variants 2018-03-26 18:08:56 +03:00
wmi-tlv.c ath10k: enable TDLS peer inactivity detection 2018-03-29 12:00:06 +03:00
wmi-tlv.h ath10k: enable TDLS peer inactivity detection 2018-03-29 12:00:06 +03:00
wmi.c ath10k: fix a typo in ath10k_wmi_set_wmm_param() 2018-04-19 18:59:30 +03:00
wmi.h ath10k: Add tx ack signal support for management frames 2018-04-19 18:47:00 +03:00
wow.c ath10k: update copyright year 2017-12-27 12:22:01 +02:00
wow.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00