Skip to content

Commit 107b871

Browse files
jason77-wangKalle Valo
authored andcommitted
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 <[email protected]> Cc: Hante Meuleman <[email protected]> Cc: Franky (Zhenhui) Lin <[email protected]> Cc: Pieter-Paul Giesberts <[email protected]> Cc: Arend van Spriel <[email protected]> Signed-off-by: Hui Wang <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 3691ac4 commit 107b871

File tree

1 file changed

+2
-4
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

1 file changed

+2
-4
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,8 @@ static void brcmf_pcie_handle_mb_data(struct brcmf_pciedev_info *devinfo)
677677
brcmf_dbg(PCIE, "D2H_MB_DATA: DEEP SLEEP EXIT\n");
678678
if (dtoh_mb_data & BRCMF_D2H_DEV_D3_ACK) {
679679
brcmf_dbg(PCIE, "D2H_MB_DATA: D3 ACK\n");
680-
if (waitqueue_active(&devinfo->mbdata_resp_wait)) {
681-
devinfo->mbdata_completed = true;
682-
wake_up(&devinfo->mbdata_resp_wait);
683-
}
680+
devinfo->mbdata_completed = true;
681+
wake_up(&devinfo->mbdata_resp_wait);
684682
}
685683
}
686684

0 commit comments

Comments
 (0)