Commit b307e704 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mmc-v6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:

 - Fix workaround for SD UHS-I voltage switch

* tag 'mmc-v6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: core: Fix inconsistent sd3_bus_mode at UHS-I SD voltage switch failure
  mmc: core: Fix UHS-I SD 1.8V workaround branch
parents 1e8e515e 63f15609
...@@ -949,14 +949,15 @@ int mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card, ...@@ -949,14 +949,15 @@ int mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card,
/* Erase init depends on CSD and SSR */ /* Erase init depends on CSD and SSR */
mmc_init_erase(card); mmc_init_erase(card);
}
/* /*
* Fetch switch information from card. * Fetch switch information from card. Note, sd3_bus_mode can change if
* voltage switch outcome changes, so do this always.
*/ */
err = mmc_read_switch(card); err = mmc_read_switch(card);
if (err) if (err)
return err; return err;
}
/* /*
* For SPI, enable CRC as appropriate. * For SPI, enable CRC as appropriate.
...@@ -1480,16 +1481,6 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, ...@@ -1480,16 +1481,6 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
if (!v18_fixup_failed && !mmc_host_is_spi(host) && mmc_host_uhs(host) && if (!v18_fixup_failed && !mmc_host_is_spi(host) && mmc_host_uhs(host) &&
mmc_sd_card_using_v18(card) && mmc_sd_card_using_v18(card) &&
host->ios.signal_voltage != MMC_SIGNAL_VOLTAGE_180) { host->ios.signal_voltage != MMC_SIGNAL_VOLTAGE_180) {
/*
* Re-read switch information in case it has changed since
* oldcard was initialized.
*/
if (oldcard) {
err = mmc_read_switch(card);
if (err)
goto free_card;
}
if (mmc_sd_card_using_v18(card)) {
if (mmc_host_set_uhs_voltage(host) || if (mmc_host_set_uhs_voltage(host) ||
mmc_sd_init_uhs_card(card)) { mmc_sd_init_uhs_card(card)) {
v18_fixup_failed = true; v18_fixup_failed = true;
...@@ -1498,8 +1489,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, ...@@ -1498,8 +1489,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
mmc_remove_card(card); mmc_remove_card(card);
goto retry; goto retry;
} }
goto done; goto cont;
}
} }
/* Initialization sequence for UHS-I cards */ /* Initialization sequence for UHS-I cards */
...@@ -1534,7 +1524,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, ...@@ -1534,7 +1524,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
mmc_set_bus_width(host, MMC_BUS_WIDTH_4); mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
} }
} }
cont:
if (!oldcard) { if (!oldcard) {
/* Read/parse the extension registers. */ /* Read/parse the extension registers. */
err = sd_read_ext_regs(card); err = sd_read_ext_regs(card);
...@@ -1566,7 +1556,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, ...@@ -1566,7 +1556,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
err = -EINVAL; err = -EINVAL;
goto free_card; goto free_card;
} }
done:
host->card = card; host->card = card;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment