Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d3e3350 authored by Adrian Hunter's avatar Adrian Hunter Committed by Chris Ball
Browse files

mmc: core: fix performance regression initializing MMC host controllers



Commit fa550189 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: default avatarAdrian Hunter <adrian.hunter@intel.com>
Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent f9a94e0a
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2416,6 +2416,7 @@ void mmc_start_host(struct mmc_host *host)
{
{
	host->f_init = max(freqs[0], host->f_min);
	host->f_init = max(freqs[0], host->f_min);
	host->rescan_disable = 0;
	host->rescan_disable = 0;
	if (!(host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP))
		mmc_power_up(host);
		mmc_power_up(host);
	mmc_detect_change(host, 0);
	mmc_detect_change(host, 0);
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -195,6 +195,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
		host->mmc->pm_caps  |= c->slot->pm_caps;
		host->mmc->pm_caps  |= c->slot->pm_caps;
	}
	}


	host->mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP;

	err = sdhci_add_host(host);
	err = sdhci_add_host(host);
	if (err)
	if (err)
		goto err_free;
		goto err_free;
+1 −0
Original line number Original line Diff line number Diff line
@@ -280,6 +280,7 @@ struct mmc_host {
#define MMC_CAP2_PACKED_WR	(1 << 13)	/* Allow packed write */
#define MMC_CAP2_PACKED_WR	(1 << 13)	/* Allow packed write */
#define MMC_CAP2_PACKED_CMD	(MMC_CAP2_PACKED_RD | \
#define MMC_CAP2_PACKED_CMD	(MMC_CAP2_PACKED_RD | \
				 MMC_CAP2_PACKED_WR)
				 MMC_CAP2_PACKED_WR)
#define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14)	/* Don't power up before scan */


	mmc_pm_flag_t		pm_caps;	/* supported pm features */
	mmc_pm_flag_t		pm_caps;	/* supported pm features */