Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759785AbZFJO2g (ORCPT ); Wed, 10 Jun 2009 10:28:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759004AbZFJO23 (ORCPT ); Wed, 10 Jun 2009 10:28:29 -0400 Received: from wf-out-1314.google.com ([209.85.200.169]:11694 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758215AbZFJO22 (ORCPT ); Wed, 10 Jun 2009 10:28:28 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=IPTZlUEfjYpPtr2ob+kZmxg/UGQFjwegaUqaGp+nJ6kytR1UoscamQ8CD5NNjlOPCn dTV5InBvFwJV7O0sGSYr5jnuOfdR18GWk7r+akoTy/cz+7xSdO9xvriv8Ts0thsyo+IN efklCtf+0vIKnNEcABpQVwSYhjkbk1I3A/e7E= From: tom.leiming@gmail.com To: greg@kroah.com Cc: linux-kernel@vger.kernel.org, kay.sievers@vrfy.org, akpm@linux-foundation.org, Ming Lei Subject: [PATCH 2/2] init/do_mounts.c: replace polling for root device with devtmpfs_wait_for_dev Date: Wed, 10 Jun 2009 22:28:17 +0800 Message-Id: <1244644097-305-1-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.6.0.GIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2273 Lines: 77 From: Ming Lei This patch removes the polling for root device if rootwait parameter is passed to kernel and CONFIG_DEVTMPFS is enabled. This way can lead to a faster boot, especially booting from some asynchronous block device (such as usb mass storage, mmc card, ...) The patch has been verified in beagle board(mmc card as root device). Signed-off-by: Ming Lei --- init/do_mounts.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/init/do_mounts.c b/init/do_mounts.c index aa56007..fcf3844 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -364,6 +364,7 @@ void __init mount_root(void) void __init prepare_namespace(void) { int is_floppy; + int ret; if (root_delay) { printk(KERN_INFO "Waiting %dsec before mounting root device...\n", @@ -371,6 +372,7 @@ void __init prepare_namespace(void) ssleep(root_delay); } +#ifndef CONFIG_DEVTMPFS /* * wait for the known devices to complete their probing * @@ -379,6 +381,7 @@ void __init prepare_namespace(void) * for the touchpad of a laptop to initialize. */ wait_for_device_probe(); +#endif md_run_setup(); @@ -397,6 +400,7 @@ void __init prepare_namespace(void) if (initrd_load()) goto out; +#ifndef CONFIG_DEVTMPFS /* wait for any asynchronous scanning to complete */ if ((ROOT_DEV == 0) && root_wait) { printk(KERN_INFO "Waiting for root device %s...\n", @@ -406,6 +410,18 @@ void __init prepare_namespace(void) msleep(100); async_synchronize_full(); } +#else + /*wait for root device, and expire if 120 seconds elapse*/ + if (!strncmp(saved_root_name, "/dev/", 5)) { + ret = devtmpfs_wait_for_dev(saved_root_name, 120); + printk(KERN_INFO "wait for %s based on devtmpfs:%d\n", + saved_root_name, ret); + } + + ROOT_DEV = name_to_dev_t(saved_root_name); + if (!ROOT_DEV) + printk(KERN_ERR "Root device %s not found!\n", saved_root_name); +#endif is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR; -- 1.6.0.GIT -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/