[PATCH 2/3] mmc: core: cycle power the card in voltage switch rather than mmc_sd_get_cid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cycle power the card is a MUST step when voltage switch sequence failed.
So move this operation to function mmc_set_signal_voltage.

Signed-off-by: Kevin Liu <kliu5@xxxxxxxxxxx>
---
 drivers/mmc/core/sd.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index c1a700d..53ba4d9 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -757,7 +757,6 @@ try_again:
 	if (max_current > 150)
 		ocr |= SD_OCR_XPC;
 
-try_again:
 	err = mmc_send_app_op_cond(host, ocr, rocr);
 	if (err)
 		return err;
@@ -769,16 +768,11 @@ try_again:
 	if (!mmc_host_is_spi(host) && rocr &&
 	   ((*rocr & 0x41000000) == 0x41000000)) {
 		err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, true);
-		if (err == -EAGAIN) {
-			/* Power cycle card */
-			pr_debug("%s: Signal voltage switch failed, "
-					"power cycling card (retries = %d)\n",
-					mmc_hostname(host), retries);
-			mmc_power_cycle(host);
-			retries--;
-			goto try_again;
-		} else if (err) {
-			retries = 0;
+		if (err) {
+			if (err == -EAGAIN)
+				retries--;
+			else
+				retries = 0;
 			goto try_again;
 		}
 	}
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux