linux/drivers/net/wireless/ath/ath10k
Brian Norris 25733c4e67 ath10k: pci: use mutex for diagnostic window CE polling
The DIAG copy engine is only used via polling, but it holds a spinlock
with softirqs disabled. Each iteration of our read/write loops can
theoretically take 20ms (two 10ms timeout loops), and this loop can be
run an unbounded number of times while holding the spinlock -- dependent
on the request size given by the caller.

As of commit 39501ea641 ("ath10k: download firmware via diag Copy
Engine for QCA6174 and QCA9377."), we transfer large chunks of firmware
memory using this mechanism. With large enough firmware segments, this
becomes an exceedingly long period for disabling soft IRQs. For example,
with a 500KiB firmware segment, in testing QCA6174A, I see 200 loop
iterations of about 50-100us each, which can total about 10-20ms.

In reality, we don't really need to block softirqs for this duration.
The DIAG CE is only used in polling mode, and we only need to hold
ce_lock to make sure any CE bookkeeping is done without screwing up
another CE. Otherwise, we only need to ensure exclusion between
ath10k_pci_diag_{read,write}_mem() contexts.

This patch moves to use fine-grained locking for the shared ce_lock,
while adding a new mutex just to ensure mutual exclusion of diag
read/write operations.

Tested on QCA6174A, firmware version WLAN.RM.4.4.1-00132-QCARMSWPZ-1.

Fixes: 39501ea641 ("ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377.")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-11 18:31:55 +02:00
..
ahb.c ath10k: add device type enum to ath10k_bus_params 2018-09-06 19:13:58 +03:00
ahb.h
bmi.c ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377. 2018-09-06 19:10:05 +03:00
bmi.h ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377. 2018-09-06 19:10:05 +03:00
ce.c Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2019-02-08 14:10:35 +02:00
ce.h ath10k: Set DMA address mask to 35 bit for WCN3990 2019-02-04 17:49:11 +02:00
core.c ath10k: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
core.h ath10k: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
coredump.c ath10k: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
coredump.h ath10k: assign proper firmware crash dump structure 2018-11-05 12:10:55 +02:00
debug.c ath10k: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
debug.h ath10k: add debug mask for QMI layer 2018-10-13 20:31:47 +03:00
debugfs_sta.c ath10k: fix peer stats null pointer dereference 2018-12-20 19:08:35 +02:00
hif.h ath10k: change swap mail box check after htc ready 2019-02-07 16:51:58 +02:00
htc.c ath10k: request credit report if flow control enabled on ep 2019-02-11 18:29:59 +02:00
htc.h ath10k: sdio: allocate correct size for RECV_1MORE_BLOCK rx packets 2018-07-02 17:21:37 +03:00
htt_rx.c ath10k: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
htt_tx.c ath10k: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
htt.c ath10k: Add support for extended HTT aggr msg support 2019-02-04 17:51:39 +02:00
htt.h ath10k: Add support for extended HTT aggr msg support 2019-02-04 17:51:39 +02:00
hw.c ath10k: Set DMA address mask to 35 bit for WCN3990 2019-02-04 17:49:11 +02:00
hw.h ath10k: reduce transmit msdu count 2019-02-07 16:56:09 +02:00
Kconfig ath10k: remove work in progress logs from snoc driver 2018-12-20 19:03:15 +02:00
mac.c ath10k: update GCMP & GCMP-256 cipher suite number for WCN3990 2019-02-11 18:26:04 +02:00
mac.h ath10k: add waiting htt tx complete before wow enable 2018-09-03 19:57:03 +03:00
Makefile ath10k: add QMI message handshake for wcn3990 client 2018-10-13 20:31:56 +03:00
p2p.c
p2p.h
pci.c ath10k: pci: use mutex for diagnostic window CE polling 2019-02-11 18:31:55 +02:00
pci.h ath10k: pci: use mutex for diagnostic window CE polling 2019-02-11 18:31:55 +02:00
qmi_wlfw_v01.c ath10k: update HOST capability qmi message 2019-02-07 16:27:20 +02:00
qmi_wlfw_v01.h ath10k: update HOST capability qmi message 2019-02-07 16:27:20 +02:00
qmi.c ath10k: fix a NULL vs IS_ERR() check 2018-12-20 19:05:19 +02:00
qmi.h ath10k: add QMI message handshake for wcn3990 client 2018-10-13 20:31:56 +03:00
rx_desc.h ath10k: fix warning due to msdu limit error 2018-12-20 19:02:18 +02:00
sdio.c ath10k: sdio: add .owner field 2019-02-07 16:53:01 +02:00
sdio.h ath10k: rename HTC_HOST_MAX_MSG_PER_BUNDLE define 2018-06-28 12:56:05 +03:00
snoc.c ath10k: enable bus layer suspend/resume for WCN3990 2019-02-11 18:29:40 +02:00
snoc.h ath10k: ath10k_snoc_{read,write}32() should be static 2018-11-06 18:18:24 +02:00
spectral.c ath10k: do not return invalid pointers as a *dentry 2019-02-07 16:55:12 +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: support extended board data download for dual-band QCA9984 2018-09-06 18:54:11 +03:00
testmode_i.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
testmode.c ath10k: re-enable the firmware fallback mechanism for testmode 2018-05-14 16:44:41 +02:00
testmode.h
thermal.c ath10k: skip sending quiet mode cmd for WCN3990 2018-12-19 15:37: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: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
txrx.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00
usb.c ath10k: add device type enum to ath10k_bus_params 2018-09-06 19:13:58 +03:00
usb.h
wmi-ops.h ath10k: implement set_base_macaddr to fix rx-bssid mask in multiple APs conf 2019-02-11 18:27:49 +02:00
wmi-tlv.c ath10k: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
wmi-tlv.h ath10k: disable interface pause wow config for integrated chipset 2019-02-11 18:29:49 +02:00
wmi.c ath10k: implement set_base_macaddr to fix rx-bssid mask in multiple APs conf 2019-02-11 18:27:49 +02:00
wmi.h ath10k: implement set_base_macaddr to fix rx-bssid mask in multiple APs conf 2019-02-11 18:27:49 +02:00
wow.c ath10k: fix some typo 2018-11-06 18:00:40 +02:00
wow.h ath10k: update copyright year 2017-12-27 12:22:01 +02:00