mirror of https://gitee.com/openkylin/linux.git
mmc: core: skip card initialization if power class selection fails
With current implementation of power class selection, mmc_select_powerclass() should never fail. So treat any error returned by this function as serious enough to skip the card initialization. Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
parent
10942aa40a
commit
3d93576e34
|
@ -719,6 +719,10 @@ static int mmc_select_powerclass(struct mmc_card *card,
|
||||||
card->ext_csd.generic_cmd6_time);
|
card->ext_csd.generic_cmd6_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
pr_err("%s: power class selection for ext_csd_bus_width %d"
|
||||||
|
" failed\n", mmc_hostname(card->host), bus_width);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1102,9 +1106,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
|
||||||
EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4;
|
EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4;
|
||||||
err = mmc_select_powerclass(card, ext_csd_bits, ext_csd);
|
err = mmc_select_powerclass(card, ext_csd_bits, ext_csd);
|
||||||
if (err)
|
if (err)
|
||||||
pr_warning("%s: power class selection to bus width %d"
|
goto err;
|
||||||
" failed\n", mmc_hostname(card->host),
|
|
||||||
1 << bus_width);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1136,10 +1138,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
|
||||||
err = mmc_select_powerclass(card, ext_csd_bits[idx][0],
|
err = mmc_select_powerclass(card, ext_csd_bits[idx][0],
|
||||||
ext_csd);
|
ext_csd);
|
||||||
if (err)
|
if (err)
|
||||||
pr_warning("%s: power class selection to "
|
goto err;
|
||||||
"bus width %d failed\n",
|
|
||||||
mmc_hostname(card->host),
|
|
||||||
1 << bus_width);
|
|
||||||
|
|
||||||
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
||||||
EXT_CSD_BUS_WIDTH,
|
EXT_CSD_BUS_WIDTH,
|
||||||
|
@ -1167,10 +1166,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
|
||||||
err = mmc_select_powerclass(card, ext_csd_bits[idx][1],
|
err = mmc_select_powerclass(card, ext_csd_bits[idx][1],
|
||||||
ext_csd);
|
ext_csd);
|
||||||
if (err)
|
if (err)
|
||||||
pr_warning("%s: power class selection to "
|
goto err;
|
||||||
"bus width %d ddr %d failed\n",
|
|
||||||
mmc_hostname(card->host),
|
|
||||||
1 << bus_width, ddr);
|
|
||||||
|
|
||||||
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
||||||
EXT_CSD_BUS_WIDTH,
|
EXT_CSD_BUS_WIDTH,
|
||||||
|
|
Loading…
Reference in New Issue