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

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>

authored by

Hongjie Fang and committed by
Ulf Hansson
7f38abf2 e401bfda

+5 -1
+5 -1
drivers/mmc/core/mmc.c
··· 1348 1348 goto out_err; 1349 1349 1350 1350 err = mmc_select_bus_width(card); 1351 - if (err < 0) 1351 + if (err != MMC_BUS_WIDTH_8) { 1352 + pr_err("%s: switch to 8bit bus width failed, err:%d\n", 1353 + mmc_hostname(host), err); 1354 + err = err < 0 ? err : -ENOTSUPP; 1352 1355 goto out_err; 1356 + } 1353 1357 1354 1358 /* Switch card to HS mode */ 1355 1359 err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,