linux_dsm_epyc7002/drivers/net/wireless/marvell
Amitkumar Karwar ec815dd2a5 mwifiex: prevent register accesses after host is sleeping
Following is mwifiex driver-firmware host sleep handshake.
It involves three threads. suspend handler, interrupt handler, interrupt
processing in main work queue.

1) Enter suspend handler
2) Download HS_CFG command
3) Response from firmware for HS_CFG
4) Suspend thread waits until handshake completes(i.e hs_activate becomes
   true)
5) SLEEP from firmware
6) SLEEP confirm downloaded to firmware.
7) SLEEP confirm response from firmware
8) Driver processes SLEEP confirm response and set hs_activate to wake up
suspend thread
9) Exit suspend handler
10) Read sleep cookie in loop and wait until it indicates firmware is
sleep.
11) After processing SLEEP confirm response, we are at the end of interrupt
processing routine. Recheck if there are interrupts received while we were
processing them.

During suspend-resume stress test, it's been observed that we may end up
acessing PCIe hardware(in 10 and 11) when PCIe bus is closed which leads
to a kernel crash.

This patch solves the problem with below changes.
a) action 10 above can be done before 8
b) Skip 11 if hs_activated is true. SLEEP confirm response
is the last interrupt from firmware. No need to recheck for
pending interrupts.
c) Add flush_workqueue() in suspend handler.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-09 03:33:24 +02:00
..
libertas net: deprecate eth_change_mtu, remove usage 2016-10-13 09:36:57 -04:00
libertas_tf net: wireless: marvell: libertas_tf: if_usb: don't print error when allocating urb fails 2016-08-13 14:53:41 -07:00
mwifiex mwifiex: prevent register accesses after host is sleeping 2016-11-09 03:33:24 +02:00
Kconfig
Makefile
mwl8k.c cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00