In sd_set_bus_speed_mode(), sd card speed is switched to sd_bus_speed. However, the switch process may fail. When it happens, sd card is in default speed mode, which is SDR12 as described in Spec3.0. In such case, the sd_bus_speed should be updated according to status[16]. Signed-off-by: Gao Pan <pandy.gao@xxxxxxx> Reviewed-by: Fugang Duan <B38611@xxxxxxxxxxxxx> --- drivers/mmc/core/sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 73c762a..ac456ec 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -471,9 +471,11 @@ static int sd_set_bus_speed_mode(struct mmc_card *card, u8 *status) if (err) return err; - if ((status[16] & 0xF) != card->sd_bus_speed) + if ((status[16] & 0xF) != card->sd_bus_speed) { + card->sd_bus_speed = status[16] & 0xF; pr_warn("%s: Problem setting bus speed mode!\n", mmc_hostname(card->host)); + } else { mmc_set_timing(card->host, timing); mmc_set_clock(card->host, card->sw_caps.uhs_max_dtr); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html