mirror of https://gitee.com/openkylin/linux.git
mwifiex: use generic 'iface_work' workqueue for SDIO interface
Existing dedicated card_reset work queue is replaced with the interface specific workqueue pointer provided by mwifiex module. Also new work flag is added for card reset task. 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>
This commit is contained in:
parent
92c2538f55
commit
8915d73870
|
@ -431,6 +431,7 @@ enum rdwr_status {
|
||||||
|
|
||||||
enum mwifiex_iface_work_flags {
|
enum mwifiex_iface_work_flags {
|
||||||
MWIFIEX_IFACE_WORK_FW_DUMP,
|
MWIFIEX_IFACE_WORK_FW_DUMP,
|
||||||
|
MWIFIEX_IFACE_WORK_CARD_RESET,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mwifiex_adapter;
|
struct mwifiex_adapter;
|
||||||
|
|
|
@ -179,6 +179,8 @@ mwifiex_sdio_remove(struct sdio_func *func)
|
||||||
if (!adapter || !adapter->priv_num)
|
if (!adapter || !adapter->priv_num)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
cancel_work_sync(&adapter->iface_work);
|
||||||
|
|
||||||
if (user_rmmod) {
|
if (user_rmmod) {
|
||||||
if (adapter->is_suspended)
|
if (adapter->is_suspended)
|
||||||
mwifiex_sdio_resume(adapter->dev);
|
mwifiex_sdio_resume(adapter->dev);
|
||||||
|
@ -1915,7 +1917,7 @@ mwifiex_update_mp_end_port(struct mwifiex_adapter *adapter, u16 port)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mmc_host *reset_host;
|
static struct mmc_host *reset_host;
|
||||||
static void sdio_card_reset_worker(struct work_struct *work)
|
static void mwifiex_sdio_card_reset_work(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct mmc_host *target = reset_host;
|
struct mmc_host *target = reset_host;
|
||||||
|
|
||||||
|
@ -1933,15 +1935,29 @@ static void sdio_card_reset_worker(struct work_struct *work)
|
||||||
mdelay(20);
|
mdelay(20);
|
||||||
mmc_add_host(target);
|
mmc_add_host(target);
|
||||||
}
|
}
|
||||||
static DECLARE_WORK(card_reset_work, sdio_card_reset_worker);
|
|
||||||
|
static void mwifiex_sdio_work(struct work_struct *work)
|
||||||
|
{
|
||||||
|
struct mwifiex_adapter *adapter =
|
||||||
|
container_of(work, struct mwifiex_adapter, iface_work);
|
||||||
|
|
||||||
|
if (test_and_clear_bit(MWIFIEX_IFACE_WORK_CARD_RESET,
|
||||||
|
&adapter->iface_work_flags))
|
||||||
|
mwifiex_sdio_card_reset_work(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)
|
||||||
{
|
{
|
||||||
struct sdio_mmc_card *card = adapter->card;
|
struct sdio_mmc_card *card = adapter->card;
|
||||||
|
|
||||||
|
if (test_bit(MWIFIEX_IFACE_WORK_CARD_RESET, &adapter->iface_work_flags))
|
||||||
|
return;
|
||||||
|
|
||||||
|
set_bit(MWIFIEX_IFACE_WORK_CARD_RESET, &adapter->iface_work_flags);
|
||||||
|
|
||||||
reset_host = card->func->card->host;
|
reset_host = card->func->card->host;
|
||||||
schedule_work(&card_reset_work);
|
schedule_work(&adapter->iface_work);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mwifiex_if_ops sdio_ops = {
|
static struct mwifiex_if_ops sdio_ops = {
|
||||||
|
@ -1964,6 +1980,7 @@ static struct mwifiex_if_ops sdio_ops = {
|
||||||
.cmdrsp_complete = mwifiex_sdio_cmdrsp_complete,
|
.cmdrsp_complete = mwifiex_sdio_cmdrsp_complete,
|
||||||
.event_complete = mwifiex_sdio_event_complete,
|
.event_complete = mwifiex_sdio_event_complete,
|
||||||
.card_reset = mwifiex_sdio_card_reset,
|
.card_reset = mwifiex_sdio_card_reset,
|
||||||
|
.iface_work = mwifiex_sdio_work,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2001,7 +2018,6 @@ mwifiex_sdio_cleanup_module(void)
|
||||||
/* Set the flag as user is removing this module. */
|
/* Set the flag as user is removing this module. */
|
||||||
user_rmmod = 1;
|
user_rmmod = 1;
|
||||||
|
|
||||||
cancel_work_sync(&card_reset_work);
|
|
||||||
sdio_unregister_driver(&mwifiex_sdio);
|
sdio_unregister_driver(&mwifiex_sdio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue