]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mwifiex: report error to PCIe for suspend failure
authorAmitkumar Karwar <akarwar@marvell.com>
Wed, 28 Sep 2016 12:48:22 +0000 (18:18 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 9 Nov 2016 01:33:25 +0000 (03:33 +0200)
When host_sleep_config command fails, we should return an error to
PCIe, instead of continuing (and possibly panicking, when we try to keep
processing a timed-out ioctl after we return "successfully" from
suspend).

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>
drivers/net/wireless/marvell/mwifiex/pcie.c

index 2833d47304911e22c87ca2bde49d46796218ac07..063c707844d39342186b4e2bae5ffe7a87483292 100644 (file)
@@ -101,7 +101,6 @@ static int mwifiex_pcie_suspend(struct device *dev)
 {
        struct mwifiex_adapter *adapter;
        struct pcie_service_card *card;
-       int hs_actived;
        struct pci_dev *pdev = to_pci_dev(dev);
 
        if (pdev) {
@@ -117,7 +116,14 @@ static int mwifiex_pcie_suspend(struct device *dev)
 
        adapter = card->adapter;
 
-       hs_actived = mwifiex_enable_hs(adapter);
+       /* Enable the Host Sleep */
+       if (!mwifiex_enable_hs(adapter)) {
+               mwifiex_dbg(adapter, ERROR,
+                           "cmd: failed to suspend\n");
+               adapter->hs_enabling = false;
+               return -EFAULT;
+       }
+
        flush_workqueue(adapter->workqueue);
 
        /* Indicate device suspended */