Occasional mmc0: error -22 whilst initialising SD card errors on custom board

Hi All,

We have a custom board based of the BB design. We boot from a micro SD card on MMC0. Sometimes the board will fail to boot and we get the messages:

[ 3.781463] mmc0: unrecognised SCR structure version 8
[ 3.790832] mmc0: error -22 whilst initialising SD card

then the board will hang when trying to mount the root filesystem. I’ve tried different SD cards, checking the filesystem, different hardware but the problem remains. Does anyone know how to fix this?

Hi all,
I’ve exactly the same issue with the MMC0 of beaglebone black. I didn’t experienced this issue using the OS shipped with the board.
I stripped as much as possible from the kernel trying to compile and get a small one, I think this may lead to this issue.
SCR is a register defined by MMC/SD standard, and the data should be read by the data bus, instead of the cmd bus as most predefined registers do.
The omap_hsmmc_request function of the TI HSMMC driver tries to read in the SCR data by DMA, and this always returns garbage.
Sometimes the SCR check gets passed, because the garbage data happens to be a valid SCR data. But the system will hang ultimately if the microSD inserted is used now and then.

It is very difficult to find out why this happens.

Dashi Cao