aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2020-04-30 11:16:39 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2020-05-28 11:21:03 +0200
commitfa1e3191922bb6b59a64a1a03e461cde07ae1e62 (patch)
tree812bb6b7bf659ca5856f06f24890613c315bb499 /drivers/mmc/core/sdio.c
parentmmc: sdio: Fix several potential memory leaks in mmc_sdio_init_card() (diff)
downloadlinux-dev-fa1e3191922bb6b59a64a1a03e461cde07ae1e62.tar.xz
linux-dev-fa1e3191922bb6b59a64a1a03e461cde07ae1e62.zip
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
Diffstat (limited to 'drivers/mmc/core/sdio.c')
-rw-r--r--drivers/mmc/core/sdio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 20eed28ea60d..853ac65f0485 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -543,12 +543,12 @@ out:
return err;
}
-static void mmc_sdio_resend_if_cond(struct mmc_host *host,
+static void mmc_sdio_resend_if_cond(struct mmc_host *host, u32 ocr,
struct mmc_card *card)
{
sdio_reset(host);
mmc_go_idle(host);
- mmc_send_if_cond(host, host->ocr_avail);
+ mmc_send_if_cond(host, ocr);
mmc_remove_card(card);
}
@@ -640,7 +640,7 @@ try_again:
if (rocr & ocr & R4_18V_PRESENT) {
err = mmc_set_uhs_voltage(host, ocr_card);
if (err == -EAGAIN) {
- mmc_sdio_resend_if_cond(host, card);
+ mmc_sdio_resend_if_cond(host, ocr_card, card);
retries--;
goto try_again;
} else if (err) {
@@ -712,7 +712,7 @@ try_again:
*/
err = sdio_read_cccr(card, ocr);
if (err) {
- mmc_sdio_resend_if_cond(host, card);
+ mmc_sdio_resend_if_cond(host, ocr_card, card);
if (ocr & R4_18V_PRESENT) {
/* Retry init sequence, but without R4_18V_PRESENT. */
retries = 0;