Commit 41efaf58 authored by Xinming Hu's avatar Xinming Hu Committed by Kalle Valo

mwifiex: wait firmware dump complete during card remove process

Wait for firmware dump complete in card remove function.
For sdio interface, there are two diffenrent cases,
card reset trigger sdio_work and firmware dump trigger sdio_work.
Do code rearrangement for distinguish between these two cases.
Signed-off-by: default avatarXinming Hu <huxm@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Reviewed-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent d27121fc
...@@ -51,6 +51,9 @@ static int mwifiex_pcie_probe_of(struct device *dev) ...@@ -51,6 +51,9 @@ static int mwifiex_pcie_probe_of(struct device *dev)
return 0; return 0;
} }
static void mwifiex_pcie_work(struct work_struct *work);
static DECLARE_WORK(pcie_work, mwifiex_pcie_work);
static int static int
mwifiex_map_pci_memory(struct mwifiex_adapter *adapter, struct sk_buff *skb, mwifiex_map_pci_memory(struct mwifiex_adapter *adapter, struct sk_buff *skb,
size_t size, int flags) size_t size, int flags)
...@@ -254,6 +257,8 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev) ...@@ -254,6 +257,8 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev)
if (!adapter || !adapter->priv_num) if (!adapter || !adapter->priv_num)
return; return;
cancel_work_sync(&pcie_work);
if (user_rmmod && !adapter->mfg_mode) { if (user_rmmod && !adapter->mfg_mode) {
mwifiex_deauthenticate_all(adapter); mwifiex_deauthenticate_all(adapter);
...@@ -2732,7 +2737,6 @@ static void mwifiex_pcie_work(struct work_struct *work) ...@@ -2732,7 +2737,6 @@ static void mwifiex_pcie_work(struct work_struct *work)
mwifiex_pcie_device_dump_work(save_adapter); mwifiex_pcie_device_dump_work(save_adapter);
} }
static DECLARE_WORK(pcie_work, mwifiex_pcie_work);
/* This function dumps FW information */ /* This function dumps FW information */
static void mwifiex_pcie_device_dump(struct mwifiex_adapter *adapter) static void mwifiex_pcie_device_dump(struct mwifiex_adapter *adapter)
{ {
......
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
*/ */
static u8 user_rmmod; static u8 user_rmmod;
static void mwifiex_sdio_work(struct work_struct *work);
static DECLARE_WORK(sdio_work, mwifiex_sdio_work);
static struct mwifiex_if_ops sdio_ops; static struct mwifiex_if_ops sdio_ops;
static unsigned long iface_work_flags; static unsigned long iface_work_flags;
...@@ -218,7 +221,7 @@ static int mwifiex_sdio_resume(struct device *dev) ...@@ -218,7 +221,7 @@ static int mwifiex_sdio_resume(struct device *dev)
* This function removes the interface and frees up the card structure. * This function removes the interface and frees up the card structure.
*/ */
static void static void
mwifiex_sdio_remove(struct sdio_func *func) __mwifiex_sdio_remove(struct sdio_func *func)
{ {
struct sdio_mmc_card *card; struct sdio_mmc_card *card;
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
...@@ -247,6 +250,13 @@ mwifiex_sdio_remove(struct sdio_func *func) ...@@ -247,6 +250,13 @@ mwifiex_sdio_remove(struct sdio_func *func)
mwifiex_remove_card(adapter); mwifiex_remove_card(adapter);
} }
static void
mwifiex_sdio_remove(struct sdio_func *func)
{
cancel_work_sync(&sdio_work);
__mwifiex_sdio_remove(func);
}
/* /*
* SDIO suspend. * SDIO suspend.
* *
...@@ -2222,7 +2232,7 @@ static void mwifiex_recreate_adapter(struct sdio_mmc_card *card) ...@@ -2222,7 +2232,7 @@ static void mwifiex_recreate_adapter(struct sdio_mmc_card *card)
* discovered and initializes them from scratch. * discovered and initializes them from scratch.
*/ */
mwifiex_sdio_remove(func); __mwifiex_sdio_remove(func);
/* /*
* Normally, we would let the driver core take care of releasing these. * Normally, we would let the driver core take care of releasing these.
...@@ -2569,7 +2579,6 @@ static void mwifiex_sdio_work(struct work_struct *work) ...@@ -2569,7 +2579,6 @@ static void mwifiex_sdio_work(struct work_struct *work)
mwifiex_sdio_card_reset_work(save_adapter); mwifiex_sdio_card_reset_work(save_adapter);
} }
static DECLARE_WORK(sdio_work, mwifiex_sdio_work);
/* This function resets the card */ /* This function resets the card */
static void mwifiex_sdio_card_reset(struct mwifiex_adapter *adapter) static void mwifiex_sdio_card_reset(struct mwifiex_adapter *adapter)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment