Skip to content

Commit

Permalink
mmc: fix rmmod race for hosts using card-detection polling
Browse files Browse the repository at this point in the history
MMC hosts that poll for card detection by defining the MMC_CAP_NEEDS_POLL
flag have a race on rmmod, where the delayed work is cancelled without
waiting for completed polling. To prevent this a _sync version of the work
cancellation has to be used.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: <stable@kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Guennadi Liakhovetski authored and Chris Ball committed Nov 11, 2010
1 parent 35ac6f0 commit d9bcbf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ void mmc_stop_host(struct mmc_host *host)

if (host->caps & MMC_CAP_DISABLE)
cancel_delayed_work(&host->disable);
cancel_delayed_work(&host->detect);
cancel_delayed_work_sync(&host->detect);
mmc_flush_scheduled_work();

/* clear pm flags now and let card drivers set them as needed */
Expand Down

0 comments on commit d9bcbf3

Please sign in to comment.