]> git.baikalelectronics.ru Git - kernel.git/commit
mwifiex: pcie: clear outstanding work when resetting
authorBrian Norris <briannorris@chromium.org>
Fri, 14 Apr 2017 21:51:19 +0000 (14:51 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 20 Apr 2017 07:21:53 +0000 (10:21 +0300)
commitb0f68f0109e67a4d5fa6f82fd4957bf503f14616
tree1bfd8afbcb49f4d6780b7dcc11a8c5107dd7305a
parent62fd6de7ff657d60bfe06f374f413f14f4366102
mwifiex: pcie: clear outstanding work when resetting

When we shut down the device (i.e., during 'reset'), we cancel any
outstanding work, but we don't clear any work-related flags. This can
cause problems if, e.g., we begin to queue a new firmware dump or card
reset while the other one is in progress. That might leave work_flags
with a stale value, and we might begin one of these *after* we've
completely reset the device. That doesn't make sense, because all
firmware context will have been lost by then.

This fixes some forms of cascading failures, where I:

(a) force a firmware dump (cat /sys/kernel/debug/mwifiex/mlan0/device_dump)
(b) run a Wifi scan in parallel (iw mlan0 scan)
(c) the scan times out due to (a) hogging the interface
(d) the command timeout triggers another firmware dump and a reset [*]
(e) the 2nd firmware dump flag persists across the reset
(f) as soon as the interface comes back up, we trigger the pending
    firmware dump
(g) subsequent commands time out again, while we are processing the
    firmware dump; return to (d)

[*] Note that automatic card_reset() support is not yet implemented for
the mwifiex PCIe driver, so we won't hit *exactly* this behavior yet.
But we can see similarly-confusing behaviors today.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/pcie.c