Skip to content

Fix SD card timeout errors

At least on iMX6 boards, in the latest Flash-N-Go System if the card is inserted before booting, following errors can be observed in dmesg:

[   17.113892] mmc1: Timeout waiting for hardware interrupt.
...
[   27.353525] mmc1: Timeout waiting for hardware interrupt.
...
[   28.911129] mmc1: card never left busy state
[   28.916092] mmc1: tried to HW reset card, got error -110
[   28.925412] blk_update_request: I/O error, dev mmcblk1, sector 1631648 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[   28.945436] mmcblk1: recovery failed!

The problem occurs during boot when SD is accessed by init scripts.

Herewith the problem cannot be reproduced with the latest mainline stable kernels due to following commit, introduced by 5.16.0-rc1 kernel: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.16.y&id=35d114699b90c8b2c568c48f78adeb913d81bcc

It's hard to explain why removing of additional printk solves the problem — it seems that this is some timing issue (or race condition). And to not waste time on further investigation, we would recommend to integrate this commit as is.

Except for getting rid of errors in dmesg, this commit also speeds up the boot process for about 20 seconds.

Edited by Dmitry Petrov

Merge request reports