lab.nexedi.com will be down from Thursday, 20 March 2025, 07:30:00 UTC for a duration of approximately 2 hours

Commit c25a7e5d authored by Ulf Hansson's avatar Ulf Hansson

Merge branch 'fixes' into next

parents cfb64661 4bc31ede
...@@ -1384,13 +1384,17 @@ static int mmc_select_hs400es(struct mmc_card *card) ...@@ -1384,13 +1384,17 @@ static int mmc_select_hs400es(struct mmc_card *card)
goto out_err; goto out_err;
} }
/*
* Bump to HS timing and frequency. Some cards don't handle
* SEND_STATUS reliably at the initial frequency.
*/
mmc_set_timing(host, MMC_TIMING_MMC_HS); mmc_set_timing(host, MMC_TIMING_MMC_HS);
mmc_set_bus_speed(card);
err = mmc_switch_status(card, true); err = mmc_switch_status(card, true);
if (err) if (err)
goto out_err; goto out_err;
mmc_set_clock(host, card->ext_csd.hs_max_dtr);
/* Switch card to DDR with strobe bit */ /* Switch card to DDR with strobe bit */
val = EXT_CSD_DDR_BUS_WIDTH_8 | EXT_CSD_BUS_WIDTH_STROBE; val = EXT_CSD_DDR_BUS_WIDTH_8 | EXT_CSD_BUS_WIDTH_STROBE;
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
...@@ -1448,7 +1452,7 @@ static int mmc_select_hs400es(struct mmc_card *card) ...@@ -1448,7 +1452,7 @@ static int mmc_select_hs400es(struct mmc_card *card)
static int mmc_select_hs200(struct mmc_card *card) static int mmc_select_hs200(struct mmc_card *card)
{ {
struct mmc_host *host = card->host; struct mmc_host *host = card->host;
unsigned int old_timing, old_signal_voltage; unsigned int old_timing, old_signal_voltage, old_clock;
int err = -EINVAL; int err = -EINVAL;
u8 val; u8 val;
...@@ -1479,8 +1483,17 @@ static int mmc_select_hs200(struct mmc_card *card) ...@@ -1479,8 +1483,17 @@ static int mmc_select_hs200(struct mmc_card *card)
false, true, MMC_CMD_RETRIES); false, true, MMC_CMD_RETRIES);
if (err) if (err)
goto err; goto err;
/*
* Bump to HS timing and frequency. Some cards don't handle
* SEND_STATUS reliably at the initial frequency.
* NB: We can't move to full (HS200) speeds until after we've
* successfully switched over.
*/
old_timing = host->ios.timing; old_timing = host->ios.timing;
old_clock = host->ios.clock;
mmc_set_timing(host, MMC_TIMING_MMC_HS200); mmc_set_timing(host, MMC_TIMING_MMC_HS200);
mmc_set_clock(card->host, card->ext_csd.hs_max_dtr);
/* /*
* For HS200, CRC errors are not a reliable way to know the * For HS200, CRC errors are not a reliable way to know the
...@@ -1493,8 +1506,10 @@ static int mmc_select_hs200(struct mmc_card *card) ...@@ -1493,8 +1506,10 @@ static int mmc_select_hs200(struct mmc_card *card)
* mmc_select_timing() assumes timing has not changed if * mmc_select_timing() assumes timing has not changed if
* it is a switch error. * it is a switch error.
*/ */
if (err == -EBADMSG) if (err == -EBADMSG) {
mmc_set_clock(host, old_clock);
mmc_set_timing(host, old_timing); mmc_set_timing(host, old_timing);
}
} }
err: err:
if (err) { if (err) {
......
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