]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: core: properly select voltage range without power cycle
authorYann Gautier <yann.gautier@foss.st.com>
Fri, 28 Oct 2022 07:37:40 +0000 (09:37 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 16 Nov 2022 12:58:01 +0000 (13:58 +0100)
commitfccf85931bd0a45f01e1e4a83481b53f0466d3bf
tree67aaa29f868c6b59a317a27b768b7cfd7a120e2b
parenta4006cca2ec79a9fea74149004ac62dd348ae059
mmc: core: properly select voltage range without power cycle

In mmc_select_voltage(), if there is no full power cycle, the voltage
range selected at the end of the function will be on a single range
(e.g. 3.3V/3.4V). To keep a range around the selected voltage (3.2V/3.4V),
the mask shift should be reduced by 1.

This issue was triggered by using a specific SD-card (Verbatim Premium
16GB UHS-1) on an STM32MP157C-DK2 board. This board cannot do UHS modes
and there is no power cycle. And the card was failing to switch to
high-speed mode. When adding the range 3.2V/3.3V for this card with the
proposed shift change, the card can switch to high-speed mode.

Fixes: 06b1830d61b1 ("mmc: core: Prevent violation of specs while initializing cards")
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221028073740.7259-1-yann.gautier@foss.st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c