Hi Guennadi, On Thu, Nov 11, 2010 at 05:32:25PM +0100, Guennadi Liakhovetski wrote: > MMC hosts, using polling 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@xxxxxx> > --- > > Chris, if this bug is old enough, this should also go to stable > eventually. > > drivers/mmc/core/core.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c > index 8f86d70..31ae07a 100644 > --- a/drivers/mmc/core/core.c > +++ b/drivers/mmc/core/core.c > @@ -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 */ Thanks very much, pushed to for-linus/mmc-next with a Cc: to stable@, and queued for .37. The bug is old -- the cancel_delayed_work() call was introduced in .31, and before that we weren't cancelling it at all. - Chris. -- Chris Ball <cjb@xxxxxxxxxx> <http://printf.net/> One Laptop Per Child -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html