linux_dsm_epyc7002/drivers
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
..
accessibility
acpi Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2016-10-12 11:05:23 -07:00
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
char net: use core MTU range checking in WAN drivers 2016-10-20 14:51:09 -04:00
clk
clocksource
connector
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma
dma-buf Merge tag 'drm-for-v4.9' of git://people.freedesktop.org/~airlied/linux 2016-10-11 18:12:22 -07:00
edac
eisa
extcon
firewire firewire: net: set initial MTU = 1500 unconditionally, fix IPv6 on some CardBus cards 2016-10-26 17:28:50 -04:00
firmware
fmc
fpga
gpio
gpu Merge tag 'drm-for-v4.9' of git://people.freedesktop.org/~airlied/linux 2016-10-11 18:12:22 -07:00
hid
hsi net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
hv
hwmon
hwspinlock
hwtracing
i2c
ide
idle
iio
infiniband net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
input
iommu
ipack
irqchip
isdn net: deprecate eth_change_mtu, remove usage 2016-10-13 09:36:57 -04:00
leds
lguest
lightnvm
macintosh
mailbox
mcb
md
media net: deprecate eth_change_mtu, remove usage 2016-10-13 09:36:57 -04:00
memory
memstick
message net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
mfd
misc net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
mmc
mtd
net mwifiex: prevent register accesses after host is sleeping 2016-11-09 03:33:24 +02:00
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
oprofile
parisc
parport
pci PCI changes for the v4.9 merge window: 2016-10-13 17:08:58 -07:00
pcmcia
perf
phy
pinctrl
platform platform-drivers-x86 for 4.9-1 2016-10-13 16:52:39 -07:00
pnp
power
powercap
pps
ps3
ptp drivers/ptp: Fix kernel memory disclosure 2016-10-13 10:20:06 -04:00
pwm
rapidio
ras
regulator Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2016-10-12 11:05:23 -07:00
remoteproc
reset
rpmsg
rtc
s390 s390/net: use net core MTU range checking 2016-10-20 14:51:10 -04:00
sbus
scsi
sfi
sh
sn
soc
spi
spmi
ssb
staging net: use core MTU range checking in virt drivers 2016-10-20 14:51:09 -04:00
target
tc
thermal Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2016-10-12 11:05:23 -07:00
thunderbolt
tty net: use core MTU range checking in WAN drivers 2016-10-20 14:51:09 -04:00
uio
usb net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
uwb
vfio
vhost
video fbdev changes for 4.9 2016-10-12 11:01:37 -07:00
virt
virtio
vlynq
vme
w1
watchdog Merge git://www.linux-watchdog.org/linux-watchdog 2016-10-13 16:44:20 -07:00
xen
zorro
Kconfig
Makefile