Revert "FROMGIT: ath10k: pci: use mutex for diagnostic window CE polling"

This reverts commit beadfa9e79e72bdd3e0ac131405d2c51887502a9.

Reason for revert: caused regressions during firmware crashes.
See chromium:945504

Original change's description:
> FROMGIT: 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 39501ea64116 ("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: 39501ea64116 ("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>
> (cherry picked from commit 25733c4e67df7f29a599bbd9ed313c172d72a02b
>  https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next)
>
> BUG=chromium:925959
> TEST=QCA6174A and WCN3990 -- suite:wifi_matfunc; reboot and
>      suspend/resume tests (watching firmware initialization time)
> TEST=benchmark msleep()/softirq delays
>
> Change-Id: I9cee7f421d309e20042e93908fd24004a1acc90d
> Reviewed-on: https://chromium-review.googlesource.com/1455264
> Commit-Ready: Brian Norris <briannorris@chromium.org>
> Tested-by: Brian Norris <briannorris@chromium.org>
> Reviewed-by: Sean Paul <seanpaul@chromium.org>
> Reviewed-by: Brian Norris <briannorris@chromium.org>

BUG=chromium:925959, chromium:945504
TEST=force a firmware crash; e.g.,
     dd if=/sys/kernel/debug/ieee80211/phy0/ath10k/mem_value bs=4K \
       count=1 of=/dev/null

Change-Id: I3a4c2f8bcd6f43dc205d3978f3d648b87a091b50
Reviewed-on: https://chromium-review.googlesource.com/1540255
Commit-Ready: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
(cherry picked from commit 6eeb36db25fad0699aa471b51436d6950ad5b093)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1546053
Commit-Queue: Brian Norris <briannorris@chromium.org>
2 files changed