]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.36.2/mmc-fix-rmmod-race-for-hosts-using-card-detection-polling.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / mmc-fix-rmmod-race-for-hosts-using-card-detection-polling.patch
CommitLineData
d9b1f36d
GKH
1From d9bcbf343ec63e1104b5276195888ee06b4d086f Mon Sep 17 00:00:00 2001
2From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
3Date: Thu, 11 Nov 2010 17:32:25 +0100
4Subject: mmc: fix rmmod race for hosts using card-detection polling
5
6From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
7
8commit d9bcbf343ec63e1104b5276195888ee06b4d086f upstream.
9
10MMC hosts that poll for card detection by defining the MMC_CAP_NEEDS_POLL
11flag have a race on rmmod, where the delayed work is cancelled without
12waiting for completed polling. To prevent this a _sync version of the work
13cancellation has to be used.
14
15Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
16Signed-off-by: Chris Ball <cjb@laptop.org>
17Signed-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 */