Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fixes' into next

+19 -4
+19 -4
drivers/mmc/core/mmc.c
··· 1384 1384 goto out_err; 1385 1385 } 1386 1386 1387 + /* 1388 + * Bump to HS timing and frequency. Some cards don't handle 1389 + * SEND_STATUS reliably at the initial frequency. 1390 + */ 1387 1391 mmc_set_timing(host, MMC_TIMING_MMC_HS); 1392 + mmc_set_bus_speed(card); 1393 + 1388 1394 err = mmc_switch_status(card, true); 1389 1395 if (err) 1390 1396 goto out_err; 1391 - 1392 - mmc_set_clock(host, card->ext_csd.hs_max_dtr); 1393 1397 1394 1398 /* Switch card to DDR with strobe bit */ 1395 1399 val = EXT_CSD_DDR_BUS_WIDTH_8 | EXT_CSD_BUS_WIDTH_STROBE; ··· 1452 1448 static int mmc_select_hs200(struct mmc_card *card) 1453 1449 { 1454 1450 struct mmc_host *host = card->host; 1455 - unsigned int old_timing, old_signal_voltage; 1451 + unsigned int old_timing, old_signal_voltage, old_clock; 1456 1452 int err = -EINVAL; 1457 1453 u8 val; 1458 1454 ··· 1483 1479 false, true, MMC_CMD_RETRIES); 1484 1480 if (err) 1485 1481 goto err; 1482 + 1483 + /* 1484 + * Bump to HS timing and frequency. Some cards don't handle 1485 + * SEND_STATUS reliably at the initial frequency. 1486 + * NB: We can't move to full (HS200) speeds until after we've 1487 + * successfully switched over. 1488 + */ 1486 1489 old_timing = host->ios.timing; 1490 + old_clock = host->ios.clock; 1487 1491 mmc_set_timing(host, MMC_TIMING_MMC_HS200); 1492 + mmc_set_clock(card->host, card->ext_csd.hs_max_dtr); 1488 1493 1489 1494 /* 1490 1495 * For HS200, CRC errors are not a reliable way to know the ··· 1506 1493 * mmc_select_timing() assumes timing has not changed if 1507 1494 * it is a switch error. 1508 1495 */ 1509 - if (err == -EBADMSG) 1496 + if (err == -EBADMSG) { 1497 + mmc_set_clock(host, old_clock); 1510 1498 mmc_set_timing(host, old_timing); 1499 + } 1511 1500 } 1512 1501 err: 1513 1502 if (err) {