aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong Wang <yong.y.wang@intel.com>2010-12-09 10:37:30 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-09 10:37:30 +0000
commit3b2a22549568fb5f6f63872352ac276e8dc835ac (patch)
treed9627c3a22b8dbebdc370ce7bb611acbe7464b14
parent734aae92f1094570357575a43005ea9f183efa99 (diff)
downloadmrst-s0i3-test-3b2a22549568fb5f6f63872352ac276e8dc835ac.tar.gz
mrst-s0i3-test-3b2a22549568fb5f6f63872352ac276e8dc835ac.tar.xz
mrst-s0i3-test-3b2a22549568fb5f6f63872352ac276e8dc835ac.zip
spectra: asynchronous initialize
The spectra nand driver takes quite some time to initialize because it needs to scan the whole nand disk to find the latest block table. This patch initializes the spectra nand driver asynchronously so that other things in the kernel can initialize in parallel to the scanning operation. Signed-off-by: Yong Wang <yong.y.wang@intel.com>
-rw-r--r--drivers/staging/spectra/ffsport.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/staging/spectra/ffsport.c b/drivers/staging/spectra/ffsport.c
index ae101a26e86..007b24b54e2 100644
--- a/drivers/staging/spectra/ffsport.c
+++ b/drivers/staging/spectra/ffsport.c
@@ -28,6 +28,7 @@
#include <linux/log2.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/async.h>
/**** Helper functions used for Div, Remainder operation on u64 ****/
@@ -729,7 +730,7 @@ static void create_sysfs_entry(struct device *dev)
}
*/
-int register_spectra_ftl()
+static void register_spectra_ftl_async(void *unused, async_cookie_t cookie)
{
int i;
@@ -738,7 +739,7 @@ int register_spectra_ftl()
if (PASS != GLOB_FTL_IdentifyDevice(&IdentifyDeviceData)) {
printk(KERN_ERR "Spectra: Unable to Read Flash Device. "
"Aborting\n");
- return -ENOMEM;
+ return;
} else {
nand_dbg_print(NAND_DBG_WARN, "In GLOB_SBD_init: "
"Num blocks=%d, pagesperblock=%d, "
@@ -772,15 +773,19 @@ int register_spectra_ftl()
"Spectra: module loaded with major number %d\n",
GLOB_SBD_majornum);
- return PASS;
+ return;
out_blk_register:
unregister_blkdev(GLOB_SBD_majornum, GLOB_SBD_NAME);
out_ftl_flash_register:
GLOB_FTL_Cache_Release();
printk(KERN_ERR "Spectra: Module load failed.\n");
+}
- return FAIL;
+int register_spectra_ftl()
+{
+ async_schedule(register_spectra_ftl_async, NULL);
+ return 0;
}
EXPORT_SYMBOL_GPL(register_spectra_ftl);