Skip to content

Commit

Permalink
mmc: core: Fix UHS-I SD 1.8V workaround branch
Browse files Browse the repository at this point in the history
commit 15c5620 upstream.

When introduced, upon success, the 1.8V fixup workaround in
mmc_sd_init_card() would branch to practically the end of the function, to
a label named "done". Unfortunately, perhaps due to the label name, over
time new code has been added that really should have come after "done" not
before it. Let's fix the problem by moving the label to the correct place
and rename it "cont".

Fixes: 045d705 ("mmc: core: Enable the MMC host software queue for the SD card")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Seunghui Lee <sh043.lee@samsung.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220815073321.63382-2-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ahunter6 authored and gregkh committed Sep 8, 2022
1 parent fc9b5b3 commit 8bca229
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/mmc/core/sd.c
Expand Up @@ -1491,7 +1491,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
mmc_remove_card(card);
goto retry;
}
goto done;
goto cont;
}
}

Expand Down Expand Up @@ -1527,7 +1527,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
}
}

cont:
if (!oldcard) {
/* Read/parse the extension registers. */
err = sd_read_ext_regs(card);
Expand Down Expand Up @@ -1559,7 +1559,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
err = -EINVAL;
goto free_card;
}
done:

host->card = card;
return 0;

Expand Down

0 comments on commit 8bca229

Please sign in to comment.