Skip to content

Commit

Permalink
mmc: delayed_work was never cancelled
Browse files Browse the repository at this point in the history
The delayed work item mmc_host.detect is now cancelled before flushing
the work queue. This takes care of cases when delayed_work was scheduled
for mmc_host.detect, but not yet placed in the work queue.

Signed-off-by: Jorg Schummer <ext-jorg.2.schummer@nokia.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Jorg Schummer authored and Pierre Ossman committed Mar 24, 2009
1 parent 89c8aa2 commit 7de427d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ void mmc_stop_host(struct mmc_host *host)
spin_unlock_irqrestore(&host->lock, flags);
#endif

cancel_delayed_work(&host->detect);
mmc_flush_scheduled_work();

mmc_bus_get(host);
Expand Down Expand Up @@ -842,6 +843,7 @@ void mmc_stop_host(struct mmc_host *host)
*/
int mmc_suspend_host(struct mmc_host *host, pm_message_t state)
{
cancel_delayed_work(&host->detect);
mmc_flush_scheduled_work();

mmc_bus_get(host);
Expand Down

0 comments on commit 7de427d

Please sign in to comment.