aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/sdio.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index f417adc9feb1..6810b3a8e130 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -633,7 +633,11 @@ try_again:
633 * to switch to 1.8V signaling level. No 1.8v signalling if 633 * to switch to 1.8V signaling level. No 1.8v signalling if
634 * UHS mode is not enabled to maintain compatibility and some 634 * UHS mode is not enabled to maintain compatibility and some
635 * systems that claim 1.8v signalling in fact do not support 635 * systems that claim 1.8v signalling in fact do not support
636 * it. 636 * it. Per SDIO spec v3, section 3.1.2, if the voltage is already
637 * 1.8v, the card sets S18A to 0 in the R4 response. So it will
638 * fails to check rocr & R4_18V_PRESENT, but we still need to
639 * try to init uhs card. sdio_read_cccr will take over this task
640 * to make sure which speed mode should work.
637 */ 641 */
638 if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) { 642 if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) {
639 err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, 643 err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
@@ -645,9 +649,6 @@ try_again:
645 } else if (err) { 649 } else if (err) {
646 ocr &= ~R4_18V_PRESENT; 650 ocr &= ~R4_18V_PRESENT;
647 } 651 }
648 err = 0;
649 } else {
650 ocr &= ~R4_18V_PRESENT;
651 } 652 }
652 653
653 /* 654 /*
@@ -704,11 +705,20 @@ try_again:
704 } 705 }
705 706
706 /* 707 /*
707 * Read the common registers. 708 * Read the common registers. Note that we should try to
709 * validate whether UHS would work or not.
708 */ 710 */
709 err = sdio_read_cccr(card, ocr); 711 err = sdio_read_cccr(card, ocr);
710 if (err) 712 if (err) {
711 goto remove; 713 mmc_sdio_resend_if_cond(host, card);
714 if (ocr & R4_18V_PRESENT) {
715 /* Retry init sequence, but without R4_18V_PRESENT. */
716 retries = 0;
717 goto try_again;
718 } else {
719 goto remove;
720 }
721 }
712 722
713 /* 723 /*
714 * Read the common CIS tuples. 724 * Read the common CIS tuples.