]> git.dujemihanovic.xyz Git - linux.git/commitdiff
DONOTMERGE: mmc: core: force-disable cache
authorKarel Balej <balejk@matfyz.cz>
Sun, 28 Jan 2024 18:24:03 +0000 (19:24 +0100)
committerKarel Balej <balejk@matfyz.cz>
Thu, 28 Mar 2024 13:39:50 +0000 (14:39 +0100)
This is a workaround for the card initialization error:

mmc0: SDHCI controller on d4281000.mmc [d4281000.mmc] using ADMA
mmc0: Card stuck being busy! __mmc_poll_for_busy
mmc0: error -110 whilst initialising MMC card
mmc0: Tuning failed, falling back to fixed sampling clock
mmc0: Card stuck being busy! __mmc_poll_for_busy
mmc0: error -110 whilst initialising MMC card
mmc0: Card stuck being busy! __mmc_poll_for_busy
mmc0: error -110 whilst initialising MMC card
mmc0: Card stuck being busy! __mmc_poll_for_busy
mmc0: error -110 whilst initialising MMC card
mmc0: Failed to initialize a non-removable card

This error does not occur when the card is forced to DDR_1_8V but if
caching is not disabled, the following errors occur:

[    0.210673] mmc0: SDHCI controller on d4281000.mmc [d4281000.mmc] using ADMA
[    0.301489] mmc0: new DDR MMC card at address 0001
[    0.302156] mmcblk0: mmc0:0001 QNW00A 7.28 GiB
[    0.308976] mmcblk0boot0: mmc0:0001 QNW00A 4.00 MiB
[    0.310318] mmcblk0boot1: mmc0:0001 QNW00A 4.00 MiB
[    0.311571] mmcblk0rpmb: mmc0:0001 QNW00A 512 KiB, chardev (248:0)
[  171.353426] mmc0: Card stuck being busy! __mmc_poll_for_busy
[  171.353443] mmc0: cache flush error -110
[  201.399007] mmc0: Card stuck being busy! __mmc_poll_for_busy
[  201.399023] mmc0: cache flush error -110
[  231.415093] mmc0: Card stuck being busy! __mmc_poll_for_busy
[  231.415109] mmc0: cache flush error -110
[  261.464688] mmc0: Card stuck being busy! __mmc_poll_for_busy
[  261.464703] mmc0: cache flush error -110

A workaround was initially devised by blacksilver to counter the first
error by forcing the card to DDR_1_8V and the second error by always
returning false from _mmc_cache_enabled() (which the current workaround
causes to happen too).

The current workaround allows the card to be used in HS200 mode which
however has the side effect of spamming dmesg with tuning failure
messages.

drivers/mmc/core/mmc.c

index 5b2f7c2854619d552f4641e7fde2d2b8542ee7b1..0783d848d7209aa2e916b8d39849eca30d2824e0 100644 (file)
@@ -1879,6 +1879,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
         * sudden power failure tests. Let's extend the timeout to a minimum of
         * DEFAULT_CACHE_EN_TIMEOUT_MS and do it for all cards.
         */
+       card->ext_csd.cache_size = 0;
        if (card->ext_csd.cache_size > 0) {
                unsigned int timeout_ms = MIN_CACHE_EN_TIMEOUT_MS;