Skip to content

Commit fa1e319

Browse files
author
Ulf Hansson
committed
mmc: sdio: Re-use negotiated OCR mask when re-sending CMD8
While initializing an SDIO card in mmc_sdio_init_card(), we may need to retry the UHS-I specific initialization, in case the first attempt fails. This leads to resending a CMD8, but also to restart from scratch with the so called OCR mask negotiations. This is unnecessary as we already have a negotiated OCR mask, so let's use that instead. In this way, the behaviour also becomes more consistent with other similar paths. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20200430091640.455-4-ulf.hansson@linaro.org
1 parent a94a59f commit fa1e319

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/mmc/core/sdio.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,12 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card)
543543
return err;
544544
}
545545

546-
static void mmc_sdio_resend_if_cond(struct mmc_host *host,
546+
static void mmc_sdio_resend_if_cond(struct mmc_host *host, u32 ocr,
547547
struct mmc_card *card)
548548
{
549549
sdio_reset(host);
550550
mmc_go_idle(host);
551-
mmc_send_if_cond(host, host->ocr_avail);
551+
mmc_send_if_cond(host, ocr);
552552
mmc_remove_card(card);
553553
}
554554

@@ -640,7 +640,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
640640
if (rocr & ocr & R4_18V_PRESENT) {
641641
err = mmc_set_uhs_voltage(host, ocr_card);
642642
if (err == -EAGAIN) {
643-
mmc_sdio_resend_if_cond(host, card);
643+
mmc_sdio_resend_if_cond(host, ocr_card, card);
644644
retries--;
645645
goto try_again;
646646
} else if (err) {
@@ -712,7 +712,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
712712
*/
713713
err = sdio_read_cccr(card, ocr);
714714
if (err) {
715-
mmc_sdio_resend_if_cond(host, card);
715+
mmc_sdio_resend_if_cond(host, ocr_card, card);
716716
if (ocr & R4_18V_PRESENT) {
717717
/* Retry init sequence, but without R4_18V_PRESENT. */
718718
retries = 0;

0 commit comments

Comments
 (0)