diff options
author | Xinming Hu <huxm@marvell.com> | 2016-11-16 16:09:08 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-01-12 17:44:30 +0300 |
commit | 41efaf5824e7cb16c54bbec1273d86d80cdac283 (patch) | |
tree | a4bcc3fbfe3782d49698358e40a08979e52d04d0 /drivers/net/wireless/marvell/mwifiex/sdio.c | |
parent | d27121fca12957036077ef56ee0146c99b8a92f7 (diff) | |
download | linux-41efaf5824e7cb16c54bbec1273d86d80cdac283.tar.xz |
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: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex/sdio.c')
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/sdio.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index 3abc1dfb0ec4..159ac8037cdc 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -46,6 +46,9 @@ */ 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 unsigned long iface_work_flags; @@ -218,7 +221,7 @@ static int mwifiex_sdio_resume(struct device *dev) * This function removes the interface and frees up the card structure. */ static void -mwifiex_sdio_remove(struct sdio_func *func) +__mwifiex_sdio_remove(struct sdio_func *func) { struct sdio_mmc_card *card; struct mwifiex_adapter *adapter; @@ -247,6 +250,13 @@ mwifiex_sdio_remove(struct sdio_func *func) mwifiex_remove_card(adapter); } +static void +mwifiex_sdio_remove(struct sdio_func *func) +{ + cancel_work_sync(&sdio_work); + __mwifiex_sdio_remove(func); +} + /* * SDIO suspend. * @@ -2222,7 +2232,7 @@ static void mwifiex_recreate_adapter(struct sdio_mmc_card *card) * 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. @@ -2569,7 +2579,6 @@ static void mwifiex_sdio_work(struct work_struct *work) mwifiex_sdio_card_reset_work(save_adapter); } -static DECLARE_WORK(sdio_work, mwifiex_sdio_work); /* This function resets the card */ static void mwifiex_sdio_card_reset(struct mwifiex_adapter *adapter) { |