public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MMC: Flush mmc workqueue late in the boot sequence
@ 2007-05-10 10:35 Haavard Skinnemoen
  2007-05-10 12:04 ` Pierre Ossman
  0 siblings, 1 reply; 15+ messages in thread
From: Haavard Skinnemoen @ 2007-05-10 10:35 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: linux-kernel, Haavard Skinnemoen

At some point before 2.6.20, the mmc subsystem moved the card
detection code to its own workqueue. One consequence of this change
is that when using an mmc card as a root device, the card may get
detected after the init task attempts to mount the root filesystem,
causing a kernel panic because the root device could not be opened.

This patch adds a call to mmc_flush_scheduled_work() late in the boot
sequence so that we can be sure the mmc card detection scans are
complete before attempting to use an mmc device as a root device.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---
 drivers/mmc/core/sysfs.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sysfs.c b/drivers/mmc/core/sysfs.c
index 843b1fb..168b20f 100644
--- a/drivers/mmc/core/sysfs.c
+++ b/drivers/mmc/core/sysfs.c
@@ -358,3 +358,16 @@ static void __exit mmc_exit(void)
 
 module_init(mmc_init);
 module_exit(mmc_exit);
+
+#ifndef MODULE
+/*
+ * Make sure scanning for new cards has completed before attempting
+ * to mount the root filesystem.
+ */
+static int __init mmc_finish_detect(void)
+{
+	mmc_flush_scheduled_work();
+	return 0;
+}
+late_initcall(mmc_finish_detect);
+#endif
-- 
1.4.4.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-05-13 14:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-10 10:35 [PATCH] MMC: Flush mmc workqueue late in the boot sequence Haavard Skinnemoen
2007-05-10 12:04 ` Pierre Ossman
2007-05-10 12:37   ` Haavard Skinnemoen
2007-05-10 13:45     ` Pierre Ossman
2007-05-10 14:33       ` Haavard Skinnemoen
2007-05-10 15:58         ` Pierre Ossman
2007-05-10 16:27           ` Haavard Skinnemoen
2007-05-10 17:51             ` Matt Reimer
2007-05-11  7:44               ` Haavard Skinnemoen
2007-05-10 19:41             ` Pierre Ossman
2007-05-11  8:39               ` Haavard Skinnemoen
2007-05-13 13:34                 ` Pierre Ossman
2007-05-13 13:47                   ` Haavard Skinnemoen
2007-05-13 14:24                     ` Pierre Ossman
2007-05-13 14:37                       ` Haavard Skinnemoen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox