]>
Commit | Line | Data |
---|---|---|
d9b1f36d GKH |
1 | From d9bcbf343ec63e1104b5276195888ee06b4d086f Mon Sep 17 00:00:00 2001 |
2 | From: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | |
3 | Date: Thu, 11 Nov 2010 17:32:25 +0100 | |
4 | Subject: mmc: fix rmmod race for hosts using card-detection polling | |
5 | ||
6 | From: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | |
7 | ||
8 | commit d9bcbf343ec63e1104b5276195888ee06b4d086f upstream. | |
9 | ||
10 | MMC hosts that poll for card detection by defining the MMC_CAP_NEEDS_POLL | |
11 | flag have a race on rmmod, where the delayed work is cancelled without | |
12 | waiting for completed polling. To prevent this a _sync version of the work | |
13 | cancellation has to be used. | |
14 | ||
15 | Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | |
16 | Signed-off-by: Chris Ball <cjb@laptop.org> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
18 | ||
19 | --- | |
20 | drivers/mmc/core/core.c | 2 +- | |
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
22 | ||
23 | --- a/drivers/mmc/core/core.c | |
24 | +++ b/drivers/mmc/core/core.c | |
25 | @@ -1514,7 +1514,7 @@ void mmc_stop_host(struct mmc_host *host | |
26 | ||
27 | if (host->caps & MMC_CAP_DISABLE) | |
28 | cancel_delayed_work(&host->disable); | |
29 | - cancel_delayed_work(&host->detect); | |
30 | + cancel_delayed_work_sync(&host->detect); | |
31 | mmc_flush_scheduled_work(); | |
32 | ||
33 | /* clear pm flags now and let card drivers set them as needed */ |