]> git.baikalelectronics.ru Git - kernel.git/commit
mwifiex: reset timeout flag when resetting device
authorBrian Norris <briannorris@chromium.org>
Fri, 14 Apr 2017 21:51:18 +0000 (14:51 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 20 Apr 2017 07:21:52 +0000 (10:21 +0300)
commitdaa1a81e41e3b1dd9bb69e153a67e919226e31ee
treea532673eb0e16ca58cf3c28d7ff07177457bb476
parent7360b7152094ad58ba4dac6e377bbac0c8d18562
mwifiex: reset timeout flag when resetting device

If we reset because of a command timeout, we should reset this flag.
Otherwise, we might erroneously think the next command after reset is
timing out, and trigger another reset.

The above behavior effectively neuters the automatic card_reset()
behavior, as it means we will never recover from a command timeout
properly (and in fact, we might enter an infinite loop:

  timeout -> reset -> (fake) timeout -> reset -> ...

This fixes a bug introduced with introduction of PCIe function level
reset support, but it was carried into the SDIO driver when it was
converted to use the same codepaths. And this is currently mostly a
problem only in the SDIO driver, because it's the only one with
automatic card_reset() support (e.g., on command timeout). But it will
be a problem for PCIe too, as I'm working on supporting automatic
card_reset() for PCIe.

Fixes: 82b9e988908b ("mwifiex: sdio card reset enhancement")
Fixes: 5abd020f51a5 ("mwifiex: add PCIe function level reset support")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/main.c