SD card not working with Linux 5.7 snapshots

When using the latest Linaro Snapshots based on linux 5.7 (5.7.19-00177-g4af49ea41ecf-127) on the db820c, the SD card slot fails. Here are the error messages:

[ 44.798424] mmc0: Timeout waiting for hardware interrupt.
[ 44.798461] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 44.802803] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00004902
[ 44.809229] mmc0: sdhci: Blk size: 0x00004008 | Blk cnt: 0x00000000
[ 44.815665] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 44.822072] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x00000019
[ 44.828496] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 44.834920] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 44.841343] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 44.847765] mmc0: sdhci: Int enab: 0x03ff900b | Sig enab: 0x03ff100b
[ 44.854190] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 44.860613] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 44.867037] mmc0: sdhci: Cmd: 0x0000333a | Max curr: 0x00000000
[ 44.873460] mmc0: sdhci: Resp[0]: 0x00000920 | Resp[1]: 0x5b590000
[ 44.879884] mmc0: sdhci: Resp[2]: 0x76b27f80 | Resp[3]: 0x0a404012
[ 44.886307] mmc0: sdhci: Host ctl2: 0x00000008
[ 44.892728] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x000000017830a200
[ 44.897071] mmc0: sdhci: ============================================
[ 45.004351] mmc0: Reset 0x4 never completed.
[ 45.004373] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 45.007680] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00004902
[ 45.014016] mmc0: sdhci: Blk size: 0x00004008 | Blk cnt: 0x00000000
[ 45.020439] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 45.026862] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x00000019
[ 45.033286] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 45.039711] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 45.046133] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 45.052556] mmc0: sdhci: Int enab: 0x03ff900b | Sig enab: 0x03ff100b
[ 45.058981] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 45.065404] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 45.071828] mmc0: sdhci: Cmd: 0x0000333a | Max curr: 0x00000000
[ 45.078252] mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
[ 45.084675] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
[ 45.091097] mmc0: sdhci: Host ctl2: 0x00000008
[ 45.097518] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x000000017830a200
[ 45.101863] mmc0: sdhci: ============================================
[ 45.109768] mmc0: error -110 whilst initialising SD card
[ 45.216309] mmc0: Reset 0x4 never completed.
[ 45.216430] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 45.219751] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00004902
[ 45.226085] mmc0: sdhci: Blk size: 0x00004008 | Blk cnt: 0x00000000
[ 45.232507] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 45.238932] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x00000019
[ 45.245354] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 45.251778] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 45.258202] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 45.264625] mmc0: sdhci: Int enab: 0x03ff900b | Sig enab: 0x03ff100b
[ 45.271048] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 45.277473] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 45.283896] mmc0: sdhci: Cmd: 0x00000102 | Max curr: 0x00000000
[ 45.290319] mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
[ 45.296743] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
[ 45.303165] mmc0: sdhci: Host ctl2: 0x00000008
[ 45.309572] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x000000017830a200
[ 45.313933] mmc0: sdhci: ============================================
[ 45.421686] mmc0: Reset 0x1 never completed.
[ 45.421715] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 45.425045] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00004902
[ 45.431383] mmc0: sdhci: Blk size: 0x00004008 | Blk cnt: 0x00000000
[ 45.437805] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 45.444225] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x00000018
[ 45.450646] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 45.457079] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 45.463631] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 45.469926] mmc0: sdhci: Int enab: 0x03ff900b | Sig enab: 0x00000000
[ 45.476342] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 45.482939] mmc0: sdhci: Caps: 0x322dc8b2 | Caps_1: 0x00008007
[ 45.489205] mmc0: sdhci: Cmd: 0x00000102 | Max curr: 0x00000000
[ 45.495629] mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
[ 45.502035] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
[ 45.508460] mmc0: sdhci: Host ctl2: 0x00000008
[ 45.514879] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x000000017830a200
[ 45.519728] mmc0: sdhci: ============================================

Before hair pulling over software, have you tried any different cards?

The same SD card works with Linux 4.14.96.

That’s great, but not what I asked.

The following 3 cards have been tested:

  • SanDisk 4GB high speed SDHC (Class 4)
  • SanDisk 8GB ultra high speed DDR50 SDHC (Class 4)
  • Kingston 16GB ultra high speed SDR104 SDHC (Class 10)

All work under 4.14 kernel.

All fail under 5.7 kernel with the same errors (“Timeout waiting for hardware interrupt”, then register dump).

I’m seeing this too, have tested with multiple known working SD cards.

After a bit of digging, it looks like the issue was introduced with the move to kernel 5.4:
SD card working: https://snapshots.linaro.org/96boards/dragonboard820c/linaro/debian/428/
SD card broken: https://snapshots.linaro.org/96boards/dragonboard820c/linaro/debian/429/

Has anybody made any progress on this issue? We are stuck with the issue too.

Looking at SDHC command traces, the problem seems to be that the block read never completes after sending ACMD51. As a test, we disabled ADMA2 and voltage changes, then 2GB SD card worked, but that is not what we need.

We probed signals going to the SD card and they looked OK. The VDD (L21) didn’t seem to dip too much (I think that was the cause of the SD card issue in 4.14(?)).

The other thing we noticed was, the regulator tree (output from cat /sys/kernel/debug/regulator/regulator_summary) looks very different between 4.14 and 5.7.

Anybody? @loic, @danielt, @anon91830841? Any insight, where/what to look? :pray:

@tamo2 , have you tried with a more recent kernel (e.g 5.15)?

When I last tried, it didn’t work but let me try again.

We burned the latest 5.15 snapshot from Linaro Snapshots on a DragonBoard 820c, and SD card still doesn’t work.

indeed, I think you need this patch which made it to 5.16-rc1, but not 5.15:

https://lore.kernel.org/linux-arm-msm/20211104011155.2209654-1-dmitry.baryshkov@linaro.org/

1 Like

Thanks for the info!
I don’t see 5.16-rc1 branch/tag in working/qualcomm/kernel.git - Qualcomm Landing Team kernel. Do you mean the main branch? Or is it a different repo?

it was merged upstream in 5.16-rc1, so whenever we have a newer release based on 5.16+ we will have it.

RIght now you would need to cherry-pick the patch and rebuild your own kernel to test it out.

We were having problem building the latest 5.x, but we applied the patch to 5.7 kernel and it fixed the SD card. Thank you!