mmc: core: Don't power off the card when starting the host
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 13 Oct 2016 11:37:40 +0000 (13:37 +0200)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:36:49 +0000 (15:36 -0500)
commitaa99f67910bafd7578dfd6bcec2db8a6d50cc4fc
treeeaa221851c897d93e12a53936fb19a33b41fa9d0
parentc9142ec053d01bf05f9644131a457f83742a9808
mmc: core: Don't power off the card when starting the host

The MMC_CAP2_NO_PRESCAN_POWERUP was invented to avoid running the power up
sequence, mmc_power_up(), during ->probe() of the mmc host driver, but
instead defer this to the mmc detect work. This is especially useful for
those hosts that suffers from a long initialization time, as this time
would otherwise add up to the total boot time.

However, due to the introduction of runtime PM of mmc host devices in the
mmc core, this behaviour changed a bit. More precisely, it caused the mmc
core to runtime resume the host device during ->probe() of the host driver.
In cases like the rtsx_usb_sdmmc, runtime resuming the device may be costly
and thus affecting the total boot time.

To improve this behaviour when using MMC_CAP2_NO_PRESCAN_POWERUP, let's
postpone also calling mmc_power_off() when starting the host. This change
allows the mmc core to avoid runtime resuming the device, as it don't need
to claim the host for that execution path.

Cc: Ritesh Raj Sarraf <rrs@researchut.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit c2c24819b28087f2a62750957e8dfa889d1f8bb2)
drivers/mmc/core/core.c