Apq8096 boot from emmc fail with mmc0: Timeout waiting for hardware interrupt log

Hi Pradeep,

I’m not using a UI. Reading from the SD card seems ok from a terminal. Writing to the SD card does not work and I get an I/O Error:
[ 366.920170] mmcblk0: error -110 sending status command, retrying
[ 366.926435] mmcblk0: error -110 sending status command, aborting
[ 377.310832] mmc0: Timeout waiting for hardware interrupt.
[ 377.310884] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 377.315232] mmc0: sdhci: Sys addr: 0x00000400 | Version: 0x00004902
[ 377.321653] mmc0: sdhci: Blk size: 0x00004200 | Blk cnt: 0x000003c4
[ 377.328075] mmc0: sdhci: Argument: 0x00022744 | Trn mode: 0x0000002a
[ 377.334500] mmc0: sdhci: Present: 0x01f80106 | Host ctl: 0x00000007
[ 377.340922] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 377.347345] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 377.353769] mmc0: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000
[ 377.360195] mmc0: sdhci: Int enab: 0x00ff9073 | Sig enab: 0x00ff1073
[ 377.366616] mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 377.373040] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 377.379463] mmc0: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000
[ 377.385888] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x44333247
[ 377.392310] mmc0: sdhci: Resp[2]: 0x3001f1ab | Resp[3]: 0x00000900
[ 377.398733] mmc0: sdhci: Host ctl2: 0x00000000
[ 377.405153] mmc0: sdhci: ============================================
[ 377.411117] mmcblk0: error -110 sending status command, retrying
[ 377.416198] mmcblk0: error -110 sending status command, retrying
[ 377.422629] mmcblk0: error -110 sending status command, aborting
[ 377.428253] print_req_error: I/O error, dev mmcblk0, sector 141124
[ 377.434315] print_req_error: I/O error, dev mmcblk0, sector 141132
[ 377.440236] print_req_error: I/O error, dev mmcblk0, sector 141140

That makes sense to look at the sdhc host controller ADMA. I’ll start looking in 4.11, comparing to 4.14. But I think we’ll need some help.
Thanks,
Kim

Even if you get sector write errors, it seems write will succeed after some time. Check the copied file size in bytes . try copying a video to sdcard. Then, Play it from sdcard. But writing to sdcard is very slower.

Hi Nicolas,

Just to be clear, are is the 4.14 branch going to be fixed so that the sd card works with 4.14?
Thanks,
Kim

The team is currently working on this issue, If a fix is found, it will be integrated to 4.14.

Hi @anon91830841

Do you know if the UHS fix has been merged into the 4.14 stable branch yet?

I tried it on the 4.14.69 stable release on the DB820C and a U1/UHS card I tested is still not working.

Thanks

AFAIK, this is still on the QCOM LT todo list.

We met an issue with UHS on db410c as well, and it seems the following workaround fix it: https://fileserver.linaro.org/owncloud/index.php/s/lMln71RIl2Lnvc1
This is not something I tested with the DB820C though, but feel free to give it a try.

Thanks! I’ll give it a try.

Hi. On the dragonboard 820, I’ve been see some strange issues with the latest linux kernel. I’ve been able to use some Kingston SD cards (speed class 10, UHS-I 1) successfully and others, with same classes, but different “part numbers” do not work for me. The Kingston SD cards that don’t work, seem to be recognized but I cannot mount them. A Sandisk Ultra speed class 10 is recognized and mounted.

I also have another development board from a vendor that uses the snapdragon 820 and I’m using the same kernel code base with, but the Sandisk Ultra speed class 10 is not able to mount. I see the same issue with the Kingston SD class 10 cards mentioned above. Where some work and some do not mount. I did try Loic’s patch on this dev board, but don’t see any change.

Are the issues I’ve described part of the QCOM LT todo list or is my hardware broken somehow?
Thanks,
Kim

This is may not be relevant, but I understand that SDXC cards use exFAT. exFAT cannot be used under Linux, without fuse-exfat, and I read somewhere that it may be enforced by the SD host controller firmware for SD cards >32GB, possibly even SDHC cards.
Is the problem size related rather than speed related?

Hi kldixon,
The Kingston SD cards I am using are 32GB and I’ve formatted them as ext4 and vfat. In either case, the card that doesn’t mount, can never be mounted. But the other card that works, always works. So I don’t think these are exFAT, according to the size being 32GB.

Thanks,
Kim

Hi @kimbo that sounds similar to my experience.

I have a SanDisk 64GB U1/UHS card that doesn’t work on the Dragonboard or an Inforce 6601 SoM. The kernel streams out a lot of these messages when inserted:

[ 29.612805] mmcblk0: error -110 transferring data, sector 124735360, nr 8, cmd response 0x900, card status 0x0
[ 29.612813] print_req_error: I/O error, dev mmcblk0, sector 124735360
[ 29.781964] mmcblk0: error -110 transferring data, sector 124735361, nr 7, cmd response 0x900, card status 0x0
[ 29.781975] print_req_error: I/O error, dev mmcblk0, sector 124735361
[ 29.951201] mmcblk0: error -110 transferring data, sector 124735362, nr 6, cmd response 0x900, card status 0x0
[ 29.951211] print_req_error: I/O error, dev mmcblk0, sector 124735362

However I have a SanDisk 32GB Class 10 card which works fine in the Dragonboard, but does not work with the Inforce SoM, even though they are both using the same kernel source. The errors are a little different to the U1 card, and not nearly as frequently spewed out:

[ 16.745044] mmcblk0: error -110 sending status command, retrying
[ 16.745225] mmcblk0: error -110 sending status command, retrying
[ 16.745301] mmcblk0: error -110 sending status command, aborting

Hi @Loic

I have tested this patch from db410c on the db820c now, and UHS cards still do not work. This is using the September kernel release and that patch. Errors are as follows:

[ 31.700236] mmcblk0: error -110 transferring data, sector 124735362, nr 6, cmd response 0x900, card status 0x0
[ 31.868425] mmcblk0: error -110 transferring data, sector 124735363, nr 5, cmd response 0x900, card status 0x0
[ 32.036570] mmcblk0: error -110 transferring data, sector 124735364, nr 4, cmd response 0x900, card status 0x0
[ 32.204666] mmcblk0: error -110 transferring data, sector 124735365, nr 3, cmd response 0x900, card status 0x0
[ 32.372764] mmcblk0: error -110 transferring data, sector 124735366, nr 2, cmd response 0x900, card status 0x0
[ 32.540857] mmcblk0: error -110 transferring data, sector 124735367, nr 1, cmd response 0x900, card status 0x0

Do you think this might hit the top of the todo list soon?

Thanks

Hi @Loic

I have tried out the integration-linux-qcomlt branch now on the DB820C and even here a SanDisk U1/UHS card is not detected.

uname -ar
Linux linaro-alip 4.20.0-rc4-arm64 #1 SMP PREEMPT Thu Nov 29 17:24:40 GMT 2018 aarch64 GNU/Linux

The errors are different compared to the stable 4.14 branch, this time I see:

[ 16.867463] mmc0: Timeout waiting for hardware interrupt.
[ 16.867559] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 16.871936] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00004902
[ 16.878370] mmc0: sdhci: Blk size: 0x00004008 | Blk cnt: 0x00000000
[ 16.884784] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 16.891232] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x00000019
[ 16.897617] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 16.904085] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 16.910473] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 16.916924] mmc0: sdhci: Int enab: 0x02ff900b | Sig enab: 0x02ff100b
[ 16.923343] mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 16.929728] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 16.936155] mmc0: sdhci: Cmd: 0x0000333a | Max curr: 0x00000000
[ 16.942578] mmc0: sdhci: Resp[0]: 0x00000920 | Resp[1]: 0x5b590001
[ 16.949001] mmc0: sdhci: Resp[2]: 0xdbd37f80 | Resp[3]: 0x0a4040de
[ 16.955419] mmc0: sdhci: Host ctl2: 0x00000008
[ 16.961839] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000df072200
[ 16.966183] mmc0: sdhci: ============================================
[ 17.074129] mmc0: Reset 0x4 never completed.
[ 17.074264] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 17.077593] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00004902
[ 17.083956] mmc0: sdhci: Blk size: 0x00004008 | Blk cnt: 0x00000000
[ 17.090369] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 17.096788] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x00000019
[ 17.103226] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 17.109595] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 17.116018] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 17.122440] mmc0: sdhci: Int enab: 0x02ff900b | Sig enab: 0x02ff100b
[ 17.128862] mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 17.135286] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 17.141711] mmc0: sdhci: Cmd: 0x0000333a | Max curr: 0x00000000
[ 17.148137] mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
[ 17.154560] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
[ 17.160978] mmc0: sdhci: Host ctl2: 0x00000008
[ 17.167440] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000df072200
[ 17.171745] mmc0: sdhci: ============================================
[ 17.181675] mmc0: error -110 whilst initialising SD card
[ 17.286361] mmc0: Reset 0x4 never completed.
[ 17.286440] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 17.289751] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00004902
[ 17.296086] mmc0: sdhci: Blk size: 0x00004008 | Blk cnt: 0x00000000
[ 17.302512] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 17.308935] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x00000019
[ 17.315357] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 17.321779] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 17.328202] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 17.334629] mmc0: sdhci: Int enab: 0x02ff900b | Sig enab: 0x02ff100b
[ 17.341056] mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 17.347476] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 17.353900] mmc0: sdhci: Cmd: 0x00000102 | Max curr: 0x00000000
[ 17.360321] mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
[ 17.366746] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
[ 17.373167] mmc0: sdhci: Host ctl2: 0x00000008
[ 17.379588] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000df072200
[ 17.383934] mmc0: sdhci: ============================================
[ 17.494455] mmc0: Reset 0x1 never completed.
[ 17.494531] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 17.504481] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00004902
[ 17.508584] mmc0: sdhci: Blk size: 0x00004008 | Blk cnt: 0x00000000
[ 17.519727] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 17.522644] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x00000018
[ 17.529019] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 17.538060] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 17.542122] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 17.550567] mmc0: sdhci: Int enab: 0x02ff900b | Sig enab: 0x00000000
[ 17.554803] mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 17.563535] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 17.567646] mmc0: sdhci: Cmd: 0x00000102 | Max curr: 0x00000000
[ 17.575698] mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
[ 17.580604] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
[ 17.585888] mmc0: sdhci: Host ctl2: 0x00000008
[ 17.586916] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000df072200
[ 17.586921] mmc0: sdhci: ============================================

Would you expect SD cards to work on at least the integration branch on the DB820C?

Thanks

There is two bugs open:

The seems to be the one you observe on integration branch and the second one is for 4.14.
Investigation is ongoing.

The problem seems different but maybe linked to the same root cause.
In your case issue happens on SDCARD init when SD CARD Configuration Register (SCR) is read.

Thanks a lot for the rely @Loic.

It’s good to see the issues being tracked. This is a showstopper for us, preventing us releasing a commercial product. We can’t be the only one wanting to use modern SD cards on the 820 either.

Many thanks!

@althea, feel free to test this patch: https://patchwork.kernel.org/patch/10726801/

1 Like

Hi @Loic,

Brilliant, this fixes the U1/UHS cards that were not working for me on DB820C. Thanks a lot for your efforts, much appreciated!

FYI I tested the patch in the stable 4.14 branch.

1 Like

Thanks for the patch, Loic.
And thanks for your comment, althea! Without your comment, we wouldn’t have noticed that this actually fixes the overall SD card issue!