* [PATCH] mmc: fix rmmod race for card-detection polling hosts
@ 2010-11-11 16:32 Guennadi Liakhovetski
2010-11-11 23:45 ` Chris Ball
0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2010-11-11 16:32 UTC (permalink / raw)
To: linux-mmc; +Cc: Chris Ball
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@gmx.de>
---
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 */
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: fix rmmod race for card-detection polling hosts
2010-11-11 16:32 [PATCH] mmc: fix rmmod race for card-detection polling hosts Guennadi Liakhovetski
@ 2010-11-11 23:45 ` Chris Ball
0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2010-11-11 23:45 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-mmc
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@gmx.de>
> ---
>
> 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@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-11 23:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-11 16:32 [PATCH] mmc: fix rmmod race for card-detection polling hosts Guennadi Liakhovetski
2010-11-11 23:45 ` Chris Ball
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.