Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1417043 > unrolled thread

[RFC PATCH 4/4] mmc: core: improve initialization flow

Started byShawn Lin <shawn.lin@rock-chips.com>
First post2016-06-08 10:30 +0200
Last post2016-06-08 10:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH 4/4] mmc: core: improve initialization flow Shawn Lin <shawn.lin@rock-chips.com> - 2016-06-08 10:30 +0200

#1417043 — [RFC PATCH 4/4] mmc: core: improve initialization flow

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-06-08 10:30 +0200
Subject[RFC PATCH 4/4] mmc: core: improve initialization flow
Message-ID<rHH29-6b9-1@gated-at.bofh.it>
We should skip sending some unnecessary cmds
during initialization if we know that this controller
can't support the claimed function.

In this way, we provide the capabilities for DT to
decide whether they need to reduce booting time if they
know a slot is just only for one card type.

We also don't want to break the backward compatibility
if not assigning any one of these caps for existing dts
or dtb. So this patch should be safe.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/mmc/core/core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index e864187..663bf18 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2503,13 +2503,13 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
 	mmc_send_if_cond(host, host->ocr_avail);
 
 	/* Order's important: probe SDIO, then SD, then MMC */
-	if (!(host->caps2 & MMC_CAP2_NO_SDIO))
-		if (!mmc_attach_sdio(host))
-			return 0;
+	if (!(host->caps2 & MMC_CAP2_NO_SDIO) && !mmc_attach_sdio(host))
+		return 0;
 
-	if (!mmc_attach_sd(host))
+	if (!(host->caps2 & MMC_CAP2_NO_SD) && !mmc_attach_sd(host))
 		return 0;
-	if (!mmc_attach_mmc(host))
+
+	if (!(host->caps2 & MMC_CAP2_NO_MMC) && !mmc_attach_mmc(host))
 		return 0;
 
 	mmc_power_off(host);
-- 
2.3.7

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web