aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/pcie.c
diff options
context:
space:
mode:
authorMaithili Hinge <maithili@marvell.com>2015-03-23 02:01:25 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-03-30 04:32:56 -0400
commit2f5872b60146eadf74b8d349a3596f5aaf687401 (patch)
treed9ad816df4eda516ab95e8080b94b5d9d7f0488f /drivers/net/wireless/mwifiex/pcie.c
parenteaa4059d56fdbeb1633c94e82d54849688d96777 (diff)
mwifiex: Fix issue in the SDIO reset path of mwifiex.
SDIO reset was not happening properly on mwifiex as cancel_work_sync in mwifiex_sdio_remove used to kill the calling work function itself. Due to this, the interface was not getting removed and card was not getting added again. Reset work function has been made independent of adapter variable and cancel_work_sync has been moved to cleanup function. Signed-off-by: Maithili Hinge <maithili@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex/pcie.c')
-rw-r--r--drivers/net/wireless/mwifiex/pcie.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index b31c9a70ffaa..bcc7751d883c 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -234,8 +234,6 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev)
234 if (!adapter || !adapter->priv_num) 234 if (!adapter || !adapter->priv_num)
235 return; 235 return;
236 236
237 cancel_work_sync(&adapter->iface_work);
238
239 if (user_rmmod) { 237 if (user_rmmod) {
240#ifdef CONFIG_PM_SLEEP 238#ifdef CONFIG_PM_SLEEP
241 if (adapter->is_suspended) 239 if (adapter->is_suspended)
@@ -2373,25 +2371,26 @@ done:
2373 adapter->curr_mem_idx = 0; 2371 adapter->curr_mem_idx = 0;
2374} 2372}
2375 2373
2374static unsigned long iface_work_flags;
2375static struct mwifiex_adapter *save_adapter;
2376static void mwifiex_pcie_work(struct work_struct *work) 2376static void mwifiex_pcie_work(struct work_struct *work)
2377{ 2377{
2378 struct mwifiex_adapter *adapter =
2379 container_of(work, struct mwifiex_adapter, iface_work);
2380
2381 if (test_and_clear_bit(MWIFIEX_IFACE_WORK_FW_DUMP, 2378 if (test_and_clear_bit(MWIFIEX_IFACE_WORK_FW_DUMP,
2382 &adapter->iface_work_flags)) 2379 &iface_work_flags))
2383 mwifiex_pcie_fw_dump_work(adapter); 2380 mwifiex_pcie_fw_dump_work(save_adapter);
2384} 2381}
2385 2382
2383static DECLARE_WORK(pcie_work, mwifiex_pcie_work);
2386/* This function dumps FW information */ 2384/* This function dumps FW information */
2387static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter) 2385static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
2388{ 2386{
2389 if (test_bit(MWIFIEX_IFACE_WORK_FW_DUMP, &adapter->iface_work_flags)) 2387 save_adapter = adapter;
2388 if (test_bit(MWIFIEX_IFACE_WORK_FW_DUMP, &iface_work_flags))
2390 return; 2389 return;
2391 2390
2392 set_bit(MWIFIEX_IFACE_WORK_FW_DUMP, &adapter->iface_work_flags); 2391 set_bit(MWIFIEX_IFACE_WORK_FW_DUMP, &iface_work_flags);
2393 2392
2394 schedule_work(&adapter->iface_work); 2393 schedule_work(&pcie_work);
2395} 2394}
2396 2395
2397/* 2396/*
@@ -2619,7 +2618,6 @@ static struct mwifiex_if_ops pcie_ops = {
2619 .init_fw_port = mwifiex_pcie_init_fw_port, 2618 .init_fw_port = mwifiex_pcie_init_fw_port,
2620 .clean_pcie_ring = mwifiex_clean_pcie_ring_buf, 2619 .clean_pcie_ring = mwifiex_clean_pcie_ring_buf,
2621 .fw_dump = mwifiex_pcie_fw_dump, 2620 .fw_dump = mwifiex_pcie_fw_dump,
2622 .iface_work = mwifiex_pcie_work,
2623}; 2621};
2624 2622
2625/* 2623/*
@@ -2665,6 +2663,7 @@ static void mwifiex_pcie_cleanup_module(void)
2665 /* Set the flag as user is removing this module. */ 2663 /* Set the flag as user is removing this module. */
2666 user_rmmod = 1; 2664 user_rmmod = 1;
2667 2665
2666 cancel_work_sync(&pcie_work);
2668 pci_unregister_driver(&mwifiex_pcie); 2667 pci_unregister_driver(&mwifiex_pcie);
2669} 2668}
2670 2669