summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorHongjie Fang <hongjiefang@asrmicro.com>2018-07-31 10:55:09 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2018-08-01 14:15:28 +0200
commit7f38abf220e2c800a2c451372e9f07ed5fd0ea49 (patch)
treefdfe43cced74182aef89d10e27079cd869ace5f5 /drivers/mmc
parente401bfdadd2dc0f59bf76220236285130f072190 (diff)
downloadlinux-7f38abf220e2c800a2c451372e9f07ed5fd0ea49.tar.gz
linux-7f38abf220e2c800a2c451372e9f07ed5fd0ea49.tar.bz2
linux-7f38abf220e2c800a2c451372e9f07ed5fd0ea49.zip
mmc: core: improve reasonableness of bus width setting for HS400es
mmc_select_hs400es() calls mmc_select_bus_width() which will continue to set 4bit transfer mode if fail to set 8bit mode. The bus width should not be set to 4bit in HS400es. When fail to set 8bit mode, need return error directly for HS400es. Signed-off-by: Hongjie Fang <hongjiefang@asrmicro.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/mmc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 63a52379e8ab..bc1bd2c25613 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1348,8 +1348,12 @@ static int mmc_select_hs400es(struct mmc_card *card)
goto out_err;
err = mmc_select_bus_width(card);
- if (err < 0)
+ if (err != MMC_BUS_WIDTH_8) {
+ pr_err("%s: switch to 8bit bus width failed, err:%d\n",
+ mmc_hostname(host), err);
+ err = err < 0 ? err : -ENOTSUPP;
goto out_err;
+ }
/* Switch card to HS mode */
err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,