From 43ba6b9f2f5e8090f16e8efe19d17cc8ce291d22 Mon Sep 17 00:00:00 2001 From: Amitkumar Karwar Date: Mon, 22 Jul 2013 19:17:47 -0700 Subject: [PATCH] mwifiex: add PCIe shutdown handler to avoid system hang on reboot 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 Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- drivers/net/wireless/mwifiex/pcie.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index 4a57eb45f9a8..dce648682694 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -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, }; /* -- 2.30.2