]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mwifiex: pcie: disable device DMA before unmapping/freeing buffers
authorBrian Norris <briannorris@chromium.org>
Tue, 25 Jul 2017 01:13:33 +0000 (18:13 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 28 Jul 2017 14:47:54 +0000 (17:47 +0300)
commit2f47150ab3efd338ccdf75bae9f91ec147d6d98b
tree0b06894507511d996f68bd00696286dfa451b37a
parent37680819c6e1f5f22c171cd76d1ac093528fae56
mwifiex: pcie: disable device DMA before unmapping/freeing buffers

In testing the mwifiex reset code path, I've noticed KASAN complaining
about some "overwritten poison values" in our RX buffer descriptors.
Because KASAN didn't notice this at the time of a CPU write, this seems
to suggest that the device is writing to this memory.

This makes a little sense, because when resetting, we don't necessarily
expect the device to be responsive, so we don't have a chance to disable
everything cleanly.

We can at least take the precaution of disabling DMA for the device
though, and in my testing that seems to clear up this particular issue.

This patch reorders the removal path so that we disable the device
*before* releasing our last PCIe buffers, and it clears/sets the bus
master feature from the PCI device when resetting.

Along the way, remove the insufficient (and confusing) error path in
mwifiex_pcie_up_dev() (it doesn't unwind things well enough, and it
doesn't propagate its errors upward anyway).

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