mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
UPSTREAM: mmc: core: Fix init of SD cards reporting an invalid VDD range
The OCR register defines the supported range of VDD voltages for SD cards.
However, it has turned out that some SD cards reports an invalid voltage
range, for example having bit7 set.
When a host supports MMC_CAP2_FULL_PWR_CYCLE and some of the voltages from
the invalid VDD range, this triggers the core to run a power cycle of the
card to try to initialize it at the lowest common supported voltage.
Obviously this fails, since the card can't support it.
Let's fix this problem, by clearing invalid bits from the read OCR register
for SD cards, before proceeding with the VDD voltage negotiation.
Change-Id: I23c224b59505e747e4156f7ddaf0c26630b3f6a4
Cc: stable@vger.kernel.org
Reported-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Philip Langdale <philipl@overt.org>
Tested-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from commit 72741084d9)
This commit is contained in:
parent
94dd525b02
commit
bcc14fe700
|
|
@ -1277,6 +1277,12 @@ int mmc_attach_sd(struct mmc_host *host)
|
|||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some SD cards claims an out of spec VDD voltage range. Let's treat
|
||||
* these bits as being in-valid and especially also bit7.
|
||||
*/
|
||||
ocr &= ~0x7FFF;
|
||||
|
||||
rocr = mmc_select_voltage(host, ocr);
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user