Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255731
b: refs/heads/master
c: 9a821f5
h: refs/heads/master
i:
  255729: b9b2658
  255727: b78cdda
v: v3
  • Loading branch information
Daniel Drake authored and John W. Linville committed Jun 10, 2011
1 parent 00cbb52 commit 1494dfa
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 43a1c2721acd792aea370ee68ef054e18c944373
refs/heads/master: 9a821f5d0fc36425e95f0f4ade4bbca8f0ebff4d
34 changes: 34 additions & 0 deletions trunk/drivers/net/wireless/libertas/if_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,37 @@ static int if_sdio_reset_deep_sleep_wakeup(struct lbs_private *priv)

}

static struct mmc_host *reset_host;

static void if_sdio_reset_card_worker(struct work_struct *work)
{
/*
* The actual reset operation must be run outside of lbs_thread. This
* is because mmc_remove_host() will cause the device to be instantly
* destroyed, and the libertas driver then needs to end lbs_thread,
* leading to a deadlock.
*
* We run it in a workqueue totally independent from the if_sdio_card
* instance for that reason.
*/

pr_info("Resetting card...");
mmc_remove_host(reset_host);
mmc_add_host(reset_host);
}
static DECLARE_WORK(card_reset_work, if_sdio_reset_card_worker);

static void if_sdio_reset_card(struct lbs_private *priv)
{
struct if_sdio_card *card = priv->card;

if (work_pending(&card_reset_work))
return;

reset_host = card->func->card->host;
schedule_work(&card_reset_work);
}

/*******************************************************************/
/* SDIO callbacks */
/*******************************************************************/
Expand Down Expand Up @@ -1065,6 +1096,7 @@ static int if_sdio_probe(struct sdio_func *func,
priv->enter_deep_sleep = if_sdio_enter_deep_sleep;
priv->exit_deep_sleep = if_sdio_exit_deep_sleep;
priv->reset_deep_sleep_wakeup = if_sdio_reset_deep_sleep_wakeup;
priv->reset_card = if_sdio_reset_card;

sdio_claim_host(func);

Expand Down Expand Up @@ -1301,6 +1333,8 @@ static void __exit if_sdio_exit_module(void)
/* Set the flag as user is removing this module. */
user_rmmod = 1;

cancel_work_sync(&card_reset_work);

sdio_unregister_driver(&if_sdio_driver);

lbs_deb_leave(LBS_DEB_SDIO);
Expand Down

0 comments on commit 1494dfa

Please sign in to comment.