Skip to content

Commit 3d4ef32

Browse files
anssihUlf Hansson
authored andcommitted
mmc: core: fix multi-bit bus width without high-speed mode
Commit 577fb13 ("mmc: rework selection of bus speed mode") refactored bus width selection code to mmc_select_bus_width(). However, it also altered the behavior to not call the selection code in non-high-speed modes anymore. This causes 1-bit mode to always be used when the high-speed mode is not enabled, even though 4-bit and 8-bit bus are valid bus widths in the backwards-compatibility (legacy) mode as well (see e.g. 5.3.2 Bus Speed Modes in JEDEC 84-B50). This results in a significant regression in transfer speeds. Fix the code to allow 4-bit and 8-bit widths even without high-speed mode, as before. Tested with a Zynq-7000 PicoZed 7020 board. Fixes: 577fb13 ("mmc: rework selection of bus speed mode") Signed-off-by: Anssi Hannula <[email protected]> Cc: <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent 7089db8 commit 3d4ef32

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mmc/core/mmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,10 +1706,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
17061706
err = mmc_select_hs400(card);
17071707
if (err)
17081708
goto free_card;
1709-
} else if (mmc_card_hs(card)) {
1709+
} else {
17101710
/* Select the desired bus width optionally */
17111711
err = mmc_select_bus_width(card);
1712-
if (err > 0) {
1712+
if (err > 0 && mmc_card_hs(card)) {
17131713
err = mmc_select_hs_ddr(card);
17141714
if (err)
17151715
goto free_card;

0 commit comments

Comments
 (0)