mwifiex: add PCIe shutdown handler to avoid system hang on reboot
authorAmitkumar Karwar <akarwar@marvell.com>
Tue, 23 Jul 2013 02:17:47 +0000 (19:17 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 24 Jul 2013 15:02:07 +0000 (11:02 -0400)
If reboot command is issued when device is in connected state,
system hangs while booting. This issue is fixed by doing cleanup
in shutdown handler.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/pcie.c

index 4a57eb45f9a85361206fa244874a1c908d2548a0..dce6486826948407039e4740752beacfd94a2ca2 100644 (file)
@@ -235,6 +235,14 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev)
        kfree(card);
 }
 
+static void mwifiex_pcie_shutdown(struct pci_dev *pdev)
+{
+       user_rmmod = 1;
+       mwifiex_pcie_remove(pdev);
+
+       return;
+}
+
 static DEFINE_PCI_DEVICE_TABLE(mwifiex_ids) = {
        {
                PCIE_VENDOR_ID_MARVELL, PCIE_DEVICE_ID_MARVELL_88W8766P,
@@ -268,6 +276,7 @@ static struct pci_driver __refdata mwifiex_pcie = {
                .pm = &mwifiex_pcie_pm_ops,
        },
 #endif
+       .shutdown = mwifiex_pcie_shutdown,
 };
 
 /*