aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/core/sd.c
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2016-08-10 12:11:15 +0200
committerAnders Roxell <anders.roxell@linaro.org>2016-08-10 12:11:15 +0200
commita44038112d3379f49df8a9db3e1259d9e945faee (patch)
tree198f8ef7dcba389b87dbd3cac861d896b5bfd77d /drivers/mmc/core/sd.c
parent590e935df0c94b2d7a4584bb26906666176a6133 (diff)
parent0e790100f1c49f32a390d0cc55801230fd04ba56 (diff)
Merge remote-tracking branch 'lsk/linux-linaro-lsk-v3.18' into linux-linaro-lsk-v3.18-rtlsk-v3.18-16.09-rtlinux-linaro-lsk-v3.18-rt-test
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Conflicts: kernel/futex.c kernel/printk/printk.c kernel/softirq.c mm/slub.c mm/swap.c
Diffstat (limited to 'drivers/mmc/core/sd.c')
-rw-r--r--drivers/mmc/core/sd.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index d90a6de7901d..d4c8c6fa369f 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -660,13 +660,24 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
* SPI mode doesn't define CMD19 and tuning is only valid for SDR50 and
* SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
*/
- if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning &&
- (card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
- card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) {
- mmc_host_clk_hold(card->host);
- err = card->host->ops->execute_tuning(card->host,
- MMC_SEND_TUNING_BLOCK);
- mmc_host_clk_release(card->host);
+ if (!mmc_host_is_spi(card->host) &&
+ (card->host->ios.timing == MMC_TIMING_UHS_SDR50 ||
+ card->host->ios.timing == MMC_TIMING_UHS_DDR50 ||
+ card->host->ios.timing == MMC_TIMING_UHS_SDR104)) {
+ err = mmc_execute_tuning(card);
+
+ /*
+ * As SD Specifications Part1 Physical Layer Specification
+ * Version 3.01 says, CMD19 tuning is available for unlocked
+ * cards in transfer state of 1.8V signaling mode. The small
+ * difference between v3.00 and 3.01 spec means that CMD19
+ * tuning is also available for DDR50 mode.
+ */
+ if (err && card->host->ios.timing == MMC_TIMING_UHS_DDR50) {
+ pr_warn("%s: ddr50 tuning failed\n",
+ mmc_hostname(card->host));
+ err = 0;
+ }
}
out: