diff options
author | Brian Norris <briannorris@chromium.org> | 2016-11-18 19:30:29 +0530 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-11-19 09:18:49 +0200 |
commit | b42dbb27e3260badaf540351889a1ebd6797575b (patch) | |
tree | dfbc4d02665a714a221fc69dce75538c7211f507 /drivers/net/wireless/marvell/mwifiex/pcie.c | |
parent | 7ccdf72f9128104fb1dd1cf46856562380ef8f44 (diff) | |
download | lwn-b42dbb27e3260badaf540351889a1ebd6797575b.tar.gz lwn-b42dbb27e3260badaf540351889a1ebd6797575b.zip |
mwifiex: resolve suspend() race with async FW init failure
Signed-off-by: Brian Norris <briannorris@chromium.org>
Tested-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex/pcie.c')
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/pcie.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index cecf1a076640..6176cb78d9d6 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -118,12 +118,20 @@ static int mwifiex_pcie_suspend(struct device *dev) struct pci_dev *pdev = to_pci_dev(dev); card = pci_get_drvdata(pdev); - if (!card || !card->adapter) { - pr_err("Card or adapter structure is not valid\n"); + if (!card) { + dev_err(dev, "card structure is not valid\n"); return 0; } + /* Might still be loading firmware */ + wait_for_completion(&card->fw_done); + adapter = card->adapter; + if (!adapter) { + dev_err(dev, "adapter is not valid\n"); + return 0; + } + mwifiex_enable_wake(adapter); /* Enable the Host Sleep */ |