linux/drivers/net/wireless/broadcom/brcm80211/brcmfmac
Hui Wang 107b871333 brcmfmac: Remove waitqueue_active check
We met a problem of pm_suspend  when repeated closing/opening the lid
on a Lenovo laptop (1/20 reproduce rate), below is the log:

[ 199.735876] PM: Entering mem sleep
[ 199.750516] e1000e: EEE TX LPI TIMER: 00000011
[ 199.856638] Trying to free nonexistent resource <000000000000d000-000000000000d0ff>
[ 201.753566] brcmfmac: brcmf_pcie_suspend: Timeout on response for entering D3 substate
[ 201.753581] pci_legacy_suspend(): brcmf_pcie_suspend+0x0/0x1f0 [brcmfmac] returns -5
[ 201.753585] dpm_run_callback(): pci_pm_suspend+0x0/0x160 returns -5
[ 201.753589] PM: Device 0000:04:00.0 failed to suspend async: error -5

Through debugging, we found when problem happens, it is not the device
fails to enter D3, but the signal D3_ACK comes too early to pass the
waitqueue_active() check.

Just like this:
brcmf_pcie_send_mb_data(devinfo, BRCMF_H2D_HOST_D3_INFORM);
// signal is triggered here
wait_event_timeout(devinfo->mbdata_resp_wait, devinfo->mbdata_completed,
		   BRCMF_PCIE_MBDATA_TIMEOUT);

So far I think it is safe to remove waitqueue_active check since there
is only one place to trigger this signal (sending
BRCMF_H2D_HOST_D3_INFORM). And it is not a problem calling wake_up
event earlier than calling wait_event.

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Cc: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 14:57:56 +02:00
..
bcdc.c brcmfmac: Simplify and fix usage of brcmf_ifname. 2015-11-26 13:53:08 +02:00
bcdc.h
bcmsdh.c brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
btcoex.c brcmfmac: use jiffies for timeout in btcoex 2016-01-08 10:44:46 +02:00
btcoex.h
bus.h brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
cfg80211.c brcmfmac: add 802.11w management frame protection support 2016-03-07 14:15:59 +02:00
cfg80211.h brcmfmac: add 802.11w management frame protection support 2016-03-07 14:15:59 +02:00
chip.c brcmfmac: access PMU registers using standalone PMU core if available 2016-02-06 13:52:47 +02:00
chip.h brcmfmac: access PMU registers using standalone PMU core if available 2016-02-06 13:52:47 +02:00
common.c brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
common.h brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
commonring.c
commonring.h
core.c brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
core.h brcmfmac: move module init and exit to common 2016-03-07 14:14:56 +02:00
debug.c brcmfmac: Use consistent naming for bsscfgidx. 2015-11-26 13:55:18 +02:00
debug.h brcmfmac: assure net_ratelimit() is declared before use 2015-11-30 14:46:45 +02:00
feature.c brcmfmac: add 802.11w management frame protection support 2016-03-07 14:15:59 +02:00
feature.h brcmfmac: add 802.11w management frame protection support 2016-03-07 14:15:59 +02:00
firmware.c brcmfmac: treat NULL character in NVRAM as separator 2016-02-06 13:55:53 +02:00
firmware.h brcmfmac: fix BRCMF_FW_NVRAM_DEF macro for older gcc compilers 2016-01-18 11:20:52 -05:00
flowring.c brcmfmac: Increase nr of supported flowrings. 2016-02-25 11:59:22 +02:00
flowring.h brcmfmac: Increase nr of supported flowrings. 2016-02-25 11:59:22 +02:00
fweh.c brcmfmac: Add length checks on firmware events 2016-03-07 14:14:45 +02:00
fweh.h brcmfmac: Add length checks on firmware events 2016-03-07 14:14:45 +02:00
fwil_types.h brcmfmac: add 802.11w management frame protection support 2016-03-07 14:15:59 +02:00
fwil.c brcmfmac: Return actual error by fwil. 2015-11-30 14:46:38 +02:00
fwil.h brcmfmac: Add get_station support for IBSS 2016-01-07 11:21:11 +02:00
fwsignal.c brcmfmac: Move all module parameters to one place 2016-01-07 11:21:15 +02:00
fwsignal.h
Makefile
msgbuf.c brcmfmac: Increase nr of supported flowrings. 2016-02-25 11:59:22 +02:00
msgbuf.h brcmfmac: Increase nr of supported flowrings. 2016-02-25 11:59:22 +02:00
of.c brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
of.h brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
p2p.c brcmfmac: Add length checks on firmware events 2016-03-07 14:14:45 +02:00
p2p.h brcmfmac: Cleanup ssid storage. 2015-11-30 14:46:37 +02:00
pcie.c brcmfmac: Remove waitqueue_active check 2016-03-10 14:57:56 +02:00
pcie.h
proto.c
proto.h
sdio.c brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
sdio.h brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
tracepoint.c
tracepoint.h
usb.c brcmfmac: merge platform data and module paramaters 2016-03-07 14:15:56 +02:00
usb.h
vendor.c
vendor.h