summaryrefslogtreecommitdiffstats
path: root/target/linux/omap24xx/patches-2.6.38/810-mmc-fixes.patch
blob: 854a1305e46fd7a28f978dfef27745005696a70a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1456,6 +1456,7 @@ static int __init mmc_omap_probe(struct
 	host->dma_ch = -1;
 
 	host->irq = irq;
+	host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
 	host->phys_base = host->mem_res->start;
 	host->virt_base = ioremap(res->start, res->end - res->start + 1);
 	if (!host->virt_base)
@@ -1495,7 +1496,9 @@ static int __init mmc_omap_probe(struct
 		}
 	}
 
-	host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
+	/* Make sure the detect workqueue was run at least once. */
+	printk(KERN_INFO "OMAP-mmc: waiting for cards...\n");
+	mmc_flush_scheduled_work();
 
 	return 0;
 
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -75,12 +75,13 @@ static int mmc_schedule_delayed_work(str
 }
 
 /*
- * Internal function. Flush all scheduled work from the MMC work queue.
+ * Flush all scheduled work from the MMC work queue.
  */
-static void mmc_flush_scheduled_work(void)
+void mmc_flush_scheduled_work(void)
 {
 	flush_workqueue(workqueue);
 }
+EXPORT_SYMBOL(mmc_flush_scheduled_work);
 
 /**
  *	mmc_request_done - finish processing an MMC request
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -325,5 +325,7 @@ static inline int mmc_card_is_powered_re
 	return host->pm_flags & MMC_PM_KEEP_POWER;
 }
 
+void mmc_flush_scheduled_work(void);
+
 #endif