mmc: sd: fix the issue with paranoid SD card init retry

mmc_resume_host() is called during resume (runtime or system) which calls
	1. mmc_power_up
	2. mmc_select_voltage
	3. host->bus_ops->resume() (mmc_sd_resume())

mmc_sd_resume() ultimately calls mmc_sd_init_card() to initialize the
SD card. But let's say if mmc_sd_init_card() fails during the
execute_tuning(). At this point, host controller timing is changed
to SDR104/SDR50 mode and host clock will also be > 100 MHz.

If there is an error returned by mmc_sd_init_card() and
if CONFIG_MMC_PARANOID_SD_INIT defined, it retries by calling
mmc_sd_init_card() without making sure that host controller timing
and clock be initialized again. This may cause the further
mmc_sd_init_card() also to fail.

To fix this, mmc_sd_resume() should call mmc_power_up()
and mmc_select_voltage() before retrying.

Change-Id: I8de39ea547fa0d5eca478719a4cf9255b6652503
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
3 files changed