]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mmc: fix rmmod race for hosts using card-detection polling
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Thu, 11 Nov 2010 16:32:25 +0000 (17:32 +0100)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:15 +0000 (23:40 +0100)
commit d9bcbf343ec63e1104b5276195888ee06b4d086f upstream.

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>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/mmc/core/core.c

index 2876c3d80284b733c8b7112401ec85483e20a625..365997e28f32d01c6d4b49b00517c5c9feb337e1 100644 (file)
@@ -1160,7 +1160,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 */