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

Commit 09333d5f authored by Ram Prakash Gupta's avatar Ram Prakash Gupta Committed by Gerrit - the friendly Code Review server
Browse files

mmc: core: power cycle card when sd card switch voltage operation fails



As per the sd card spec, mmc need to power cycle sd card in case sd
card voltage switch operation fails. Currently we are directly going
for low speed mode without power cycle, which is in violation of sd
card spec. Now we will retry for 10 times in case timeout happens
while switching voltage and at last, in case, it did not succeed in
switching sd card voltage, mmc would go for low speed mode.

Change-Id: Icece08732b8d52104e0890dce81ad16844265edd
Signed-off-by: default avatarRam Prakash Gupta <rampraka@codeaurora.org>
parent 5bb87ff4
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2968,8 +2968,16 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr)
	 */
	mmc_host_clk_hold(host);
	err = mmc_wait_for_cmd(host, &cmd, 0);
	if (err)
	if (err) {
		if (err == -ETIMEDOUT) {
			pr_debug("%s: voltage switching failed with err %d\n",
				mmc_hostname(host), err);
			err = -EAGAIN;
			goto power_cycle;
		} else {
			goto err_command;
		}
	}

	if (!mmc_host_is_spi(host) && (cmd.resp[0] & R1_ERROR)) {
		err = -EIO;