diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-04-04 09:41:06 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-04-12 14:08:07 -0400 |
commit | 0d3e3350d5871c53464be4c92d57198744247005 (patch) | |
tree | cca13f8eb12a397c4ea8adf9f74de3bcd7c89041 | |
parent | f9a94e0a3f18ae4c0245d4a16d0ee20e93fd7bad (diff) |
mmc: core: fix performance regression initializing MMC host controllers
Commit fa5501890d8974301042e0202d342a6cbe8609f4 introduced a performance
regression by adding mmc_power_up() to mmc_start_host(). mmc_power_up()
is not necessary to host controller initialization, it is part of card
initialization and is performed anyway asynchronously.
This patch allows a driver to leave the power up in asynchronous code
(as it was before).
On my current target platform this reduces driver initialization from:
[ 1.313220] initcall sdhci_acpi_driver_init+0x0/0x12 returned 0 after 102008 usecs
to this:
[ 1.217209] initcall sdhci_acpi_driver_init+0x0/0x12 returned 0 after 8331 usecs
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/core/core.c | 3 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-acpi.c | 2 | ||||
-rw-r--r-- | include/linux/mmc/host.h | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 3bf1c462eded..c1893c9c3c31 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -2416,7 +2416,8 @@ void mmc_start_host(struct mmc_host *host) | |||
2416 | { | 2416 | { |
2417 | host->f_init = max(freqs[0], host->f_min); | 2417 | host->f_init = max(freqs[0], host->f_min); |
2418 | host->rescan_disable = 0; | 2418 | host->rescan_disable = 0; |
2419 | mmc_power_up(host); | 2419 | if (!(host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP)) |
2420 | mmc_power_up(host); | ||
2420 | mmc_detect_change(host, 0); | 2421 | mmc_detect_change(host, 0); |
2421 | } | 2422 | } |
2422 | 2423 | ||
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 2592dddbd965..7bcf74b1a5cd 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c | |||
@@ -195,6 +195,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev) | |||
195 | host->mmc->pm_caps |= c->slot->pm_caps; | 195 | host->mmc->pm_caps |= c->slot->pm_caps; |
196 | } | 196 | } |
197 | 197 | ||
198 | host->mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP; | ||
199 | |||
198 | err = sdhci_add_host(host); | 200 | err = sdhci_add_host(host); |
199 | if (err) | 201 | if (err) |
200 | goto err_free; | 202 | goto err_free; |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 17d714801e94..8873e8349597 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -280,6 +280,7 @@ struct mmc_host { | |||
280 | #define MMC_CAP2_PACKED_WR (1 << 13) /* Allow packed write */ | 280 | #define MMC_CAP2_PACKED_WR (1 << 13) /* Allow packed write */ |
281 | #define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ | 281 | #define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ |
282 | MMC_CAP2_PACKED_WR) | 282 | MMC_CAP2_PACKED_WR) |
283 | #define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14) /* Don't power up before scan */ | ||
283 | 284 | ||
284 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 285 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
285 | 286 | ||