Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5060874imm; Tue, 12 Jun 2018 01:42:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLAMnqJVKZhxszYAhiqMTz8+y3t6QX+JHPuWMHI4itizpbhwMvVDkdYchC8Nj8SNGq3qnxu X-Received: by 2002:a63:444:: with SMTP id 65-v6mr2449336pge.101.1528792948105; Tue, 12 Jun 2018 01:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528792948; cv=none; d=google.com; s=arc-20160816; b=ZKiagM16kLRJcNNAbZM/NdnHn11me7POC2zigZr2uj96iaCaM+95KHHIGiZSYvdLYf gB0dms0VPUkgz2AJo0Vt1koGlMa3P91gsv/KC/iV+kVf81Ic56GV0Xhd2HPPJ7aGdFcO qEFR1SJG1FOF3Jz3fMSDcPY/ubJ+l/48bYSG5ugJpQprfZg+ZGa1qL7U+uy7Fsv7HK4D meM9M4Cy7rA/BVydMw5ylPTjXu6WqpZ6xmk4MyeYl8nGPkWsEJPgvVvvZSeQP2YAAlZM sHuG9e2yfPG0MMP7W/U6JgONYMc+xHa9biQxyo8pkXJSuVKf+N9xrbHcVRLjmr6NmBsb Dr8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=hGMKiKLR5KEckvYNqsQDPfbUacdS+um8ulaFGH4ncBI=; b=hTGBXf29pnJtVD63OFCoetkSUS3r4A5ulvI+vWrIgmhVNAHRN7i/84Y7OBmSlxqWsC s8CTSs3aYeFSF9uIHF9kE3b/UodxNMFJ1dp0in2MWIMsFPSrxmKc/TZCgZxFUrWnl8TG YXqxv8CLgKxGA0uIdss7nle2cdFQpKRBlyCTmzWH4WObd3l1jI9Bm71QRb1KzcfgPPbi efF96/YVLS6TTbH39tSSOQqkMYhAUCsN8v/PuGHA5bo4nWEKqCJAUI9R7aCjACEc0QGq /zOZC29kQw6y9l1skMxPQmjVUvsHUQ60IAuZ3UXXuz1jZv6kcnIJtsod0P78ayDleH9s gPRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si223172pgv.335.2018.06.12.01.42.12; Tue, 12 Jun 2018 01:42:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934045AbeFLIkm (ORCPT + 99 others); Tue, 12 Jun 2018 04:40:42 -0400 Received: from mga17.intel.com ([192.55.52.151]:39362 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933363AbeFLIki (ORCPT ); Tue, 12 Jun 2018 04:40:38 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2018 01:40:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,213,1526367600"; d="scan'208";a="47085193" Received: from shbuild888.sh.intel.com (HELO localhost) ([10.239.146.239]) by fmsmga008.fm.intel.com with ESMTP; 12 Jun 2018 01:40:36 -0700 Date: Tue, 12 Jun 2018 16:42:34 +0800 From: Feng Tang To: Ulf Hansson Cc: Linux Kernel Mailing List , "linux-mmc@vger.kernel.org" , Greg Kroah-Hartman , Adrian Hunter Subject: Re: [PATCH] mmc: Move the mmc driver init earlier Message-ID: <20180612084234.gjzq66xsqblryrkm@shbuild888> References: <20180608095154.22413-1-feng.tang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ulf, Thanks for the review. On Tue, Jun 12, 2018 at 08:25:44AM +0200, Ulf Hansson wrote: > On 8 June 2018 at 11:51, Feng Tang wrote: > > When doing some boot time optimization for an eMMC rootfs NUCs, > > we found the rootfs may spend around 100 microseconds waiting > > for eMMC card to be initialized, then the rootfs could be > > mounted. > > [ 1.216561] Waiting for root device /dev/mmcblk1p1... > > [ 1.289262] mmc1: new HS400 MMC card at address 0001 > > [ 1.289667] mmcblk1: mmc1:0001 R1J56L 14.7 GiB > > [ 1.289772] mmcblk1boot0: mmc1:0001 R1J56L partition 1 8.00 MiB > > [ 1.289869] mmcblk1boot1: mmc1:0001 R1J56L partition 2 8.00 MiB > > [ 1.289967] mmcblk1rpmb: mmc1:0001 R1J56L partition 3 4.00 MiB > > [ 1.292798] mmcblk1: p1 p2 p3 > > [ 1.300576] EXT4-fs (mmcblk1p1): couldn't mount as ext3 due to feature incompatibilities > > [ 1.300912] EXT4-fs (mmcblk1p1): couldn't mount as ext2 due to feature incompatibilities > > > > And this is a common problem for smartphones, tablets, embedded > > devices and automotive products. This patch will make the eMMC/SD > > card start initializing earlier, by changing its order in drivers/Makefile. > > > > On our platform, the waiting for eMMC card is almost eliminated with the patch, > > which is critical to boot time. > > I am wondering what kernel version you are running here. There have > been some changes to the mmc initialization path, which perhaps can > help. These logs in commit msg are based on kernel 4.14, and the patch is generated against kernel 4.17. > > > > > Signed-off-by: Feng Tang > > --- > > drivers/Makefile | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/Makefile b/drivers/Makefile > > index 24cd47014657..c473afd3c688 100644 > > --- a/drivers/Makefile > > +++ b/drivers/Makefile > > @@ -50,6 +50,9 @@ obj-$(CONFIG_REGULATOR) += regulator/ > > # reset controllers early, since gpu drivers might rely on them to initialize > > obj-$(CONFIG_RESET_CONTROLLER) += reset/ > > > > +# put mmc early as many morden devices use emm/sd card as rootfs storage > > +obj-y += mmc/ > > + > > Your suggested approach isn't really a solution, as it may work for > your particular case but not for everybody else. Do you mean the patch may break some platforms? Yes, I only tested on some IA based NUCs, and I did think about other architectures, things that may affect MMC are gpio/clk/pinctrl, and those are still earlier than mmc after change. Thanks, Feng