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

custom_board

#1

hello.
we boot the apq8096 board with emmc, not ufs, but fail with the mmc0: Timeout waiting for hardware interrupt log, how to resolved it?

[ 16.097198] mmc0: Timeout waiting for hardware interrupt.
[ 16.097244] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 16.101595] mmc0: sdhci: Sys addr: 0x00000008 | Version: 0x00004902
[ 16.108017] mmc0: sdhci: Blk size: 0x00004200 | Blk cnt: 0x00000006
[ 16.114438] mmc0: sdhci: Argument: 0x03a3df80 | Trn mode: 0x0000003b
[ 16.120861] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x0000003d
[ 16.127286] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 16.133708] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 16.140133] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 16.146555] mmc0: sdhci: Int enab: 0x02ff900b | Sig enab: 0x02ff100b
[ 16.152979] mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 16.159403] mmc0: sdhci: Caps: 0x762dc8b2 | Caps_1: 0x00008007
[ 16.165826] mmc0: sdhci: Cmd: 0x0000123a | Max curr: 0x00000000
[ 16.172251] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000
[ 16.178674] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000900
[ 16.185096] mmc0: sdhci: Host ctl2: 0x0000000b
[ 16.191519] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000ff040200
[ 16.195858] mmc0: sdhci: ============================================

the linux kernel from git clone git://git.linaro.org/landing-teams/working/qualcomm/kernel.git -b release/qcomlt-4.14,
but the emmc size and partions can be recognized.
[ 4.192947] mmc0: Switching to 3.3V signalling voltage failed
[ 4.233293] mmc0: SDHCI controller on 7464900.sdhci [7464900.sdhci] using ADMA 64-bit
[ 4.237532] sdhci_msm 74a4900.sdhci: Got CD GPIO
[ 4.285419] mmc0: new HS200 MMC card at address 0001
[ 4.286289] mmcblk0: mmc0:0001 BJNB4R 29.1 GiB
[ 4.289550] mmc1: SDHCI controller on 74a4900.sdhci [74a4900.sdhci] using ADMA 64-bit
[ 4.289612] mmcblk0boot0: mmc0:0001 BJNB4R partition 1 4.00 MiB
[ 4.289764] mmcblk0boot1: mmc0:0001 BJNB4R partition 2 4.00 MiB
[ 4.289857] mmcblk0rpmb: mmc0:0001 BJNB4R partition 3 4.00 MiB
[ 4.314294] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24 p25 p26 p27 p28 p29 p30 p31 p32 p33 p34 p35 p36 p37 p38 p39 p40 p41 p42 p43 p44 p45 p46 p47 p48 p49

the detaied information as belows:

[ 4.180282] Synopsys Designware Multimedia Card Interface Driver
[ 4.185396] sdhci-pltfm: SDHCI platform and OF driver helper
[ 4.192947] mmc0: Switching to 3.3V signalling voltage failed
[ 4.233293] mmc0: SDHCI controller on 7464900.sdhci [7464900.sdhci] using ADMA 64-bit
[ 4.237532] sdhci_msm 74a4900.sdhci: Got CD GPIO
[ 4.285419] mmc0: new HS200 MMC card at address 0001
[ 4.286289] mmcblk0: mmc0:0001 BJNB4R 29.1 GiB
[ 4.289550] mmc1: SDHCI controller on 74a4900.sdhci [74a4900.sdhci] using ADMA 64-bit
[ 4.289612] mmcblk0boot0: mmc0:0001 BJNB4R partition 1 4.00 MiB
[ 4.289764] mmcblk0boot1: mmc0:0001 BJNB4R partition 2 4.00 MiB
[ 4.289857] mmcblk0rpmb: mmc0:0001 BJNB4R partition 3 4.00 MiB
[ 4.314294] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24 p25 p26 p27 p28 p29 p30 p31 p32 p33 p34 p35 p36 p37 p38 p39 p40 p41 p42 p43 p44 p45 p46 p47 p48 p49
[ 4.319405] ledtrig-cpu: registered to indicate activity on CPUs
[ 4.339016] usbcore: registered new interface driver usbhid
[ 4.343903] usbhid: USB HID core driver
[ 4.352383] usbcore: registered new interface driver snd-usb-audio
[ 4.354199] NET: Registered protocol family 10
[ 4.360200] Segment Routing with IPv6
[ 4.363712] NET: Registered protocol family 17
[ 4.367451] 9pnet: Installing 9P2000 support
[ 4.371893] Key type dns_resolver registered
[ 4.376642] registered taskstats version 1
[ 4.392489] qcom-qusb2-phy 7411000.phy: Registered Qcom-QUSB2 phy
[ 4.393036] qcom-qusb2-phy 7412000.phy: Registered Qcom-QUSB2 phy
[ 4.398164] qcom-pcie 600000.qcom,pcie: Unbalanced pm_runtime_enable!
[ 4.404216] OF: PCI: host bridge /soc/agnoc@0/qcom,pcie@00600000 ranges:
[ 4.410087] OF: PCI: IO 0x0c200000…0x0c2fffff -> 0x0c200000
[ 4.416841] OF: PCI: MEM 0x0c300000…0x0cffffff -> 0x0c300000
[ 5.503820] qcom-pcie 600000.qcom,pcie: phy link never came up
[ 5.505795] qcom-pcie 600000.qcom,pcie: cannot initialize host
[ 5.509441] qcom-pcie: probe of 600000.qcom,pcie failed with error -110
[ 5.516933] arm-smmu b40000.arm,smmu: probing hardware configuration…
[ 5.520982] arm-smmu b40000.arm,smmu: SMMUv2 with:
[ 5.527603] arm-smmu b40000.arm,smmu: stage 1 translation
[ 5.532401] arm-smmu b40000.arm,smmu: address translation ops
[ 5.537857] arm-smmu b40000.arm,smmu: non-coherent table walk
[ 5.543664] arm-smmu b40000.arm,smmu: (IDR0.CTTW overridden by FW configuration)
[ 5.549488] arm-smmu b40000.arm,smmu: stream matching with 2 register groups
[ 5.557076] arm-smmu b40000.arm,smmu: 2 context banks (0 stage-2 only)
[ 5.564193] arm-smmu b40000.arm,smmu: Supported page sizes: 0x63315000
[ 5.570580] arm-smmu b40000.arm,smmu: Stage-1: 48-bit VA -> 36-bit IPA
[ 5.580304] phy phy-7412000.phy.6: QUSB2PHY pll lock failed: status reg = 0
[ 5.583753] phy phy-7412000.phy.6: phy init failed --> -16
[ 5.590682] dwc3 7600000.dwc3: failed to initialize core
[ 5.596271] dwc3: probe of 7600000.dwc3 failed with error -16
[ 5.603144] phy phy-7411000.phy.5: QUSB2PHY pll lock failed: status reg = 0
[ 5.607370] phy phy-7411000.phy.5: phy init failed --> -16
[ 5.614120] dwc3 6a00000.dwc3: failed to initialize core
[ 5.619706] dwc3: probe of 6a00000.dwc3 failed with error -16
[ 5.629587] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[ 5.631559] hctosys: unable to open rtc device (rtc0)
[ 5.638415] wlan-en-regulator: disabling
[ 5.642504] ALSA devic[ 5.649777] Freeing unused kernel memory: 1152K
Loading, please wait…
starting version 238
[ 5.893685] rtc-pm8xxx 400f000.qcom,spmi:pmic@0:rtc@6000: rtc core: registered pm8xxx_rtc as rtc0
[ 5.919025] atl1c 0002:01:00.0 enP2p1s0: renamed from eth0
[ 16.097198] mmc0: Timeout waiting for hardware interrupt.
[ 16.097244] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 16.101595] mmc0: sdhci: Sys addr: 0x00000008 | Version: 0x00004902
[ 16.108017] mmc0: sdhci: Blk size: 0x00004200 | Blk cnt: 0x00000006
[ 16.114438] mmc0: sdhci: Argument: 0x03a3df80 | Trn mode: 0x0000003b
[ 16.120861] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x0000003d
[ 16.127286] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 16.133708] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 16.140133] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 16.146555] mmc0: sdhci: Int enab: 0x02ff900b | Sig enab: 0x02ff100b
[ 16.152979] mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 16.159403] mmc0: sdhci: Caps: 0x762dc8b2 | Caps_1: 0x00008007
[ 16.165826] mmc0: sdhci: Cmd: 0x0000123a | Max curr: 0x00000000
[ 16.172251] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000
[ 16.178674] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000900
[ 16.185096] mmc0: sdhci: Host ctl2: 0x0000000b
[ 16.191519] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000ff040200
[ 16.195858] mmc0: sdhci: ============================================
[ 16.303081] mmc0: Reset 0x4 never completed.
[ 16.303107] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 16.306416] mmc0: sdhci: Sys addr: 0x00000008 | Version: 0x00004902
[ 16.312753] mmc0: sdhci: Blk size: 0x00004200 | Blk cnt: 0x00000006
[ 16.319177] mmc0: sdhci: Argument: 0x03a3df80 | Trn mode: 0x0000003b
[ 16.325600] mmc0: sdhci: Present: 0x03f80206 | Host ctl: 0x0000003d
[ 16.332023] mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000
[ 16.338448] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 16.344871] mmc0: sdhci: Timeout: 0x0000000a | Int stat: 0x00000000
[ 16.351295] mmc0: sdhci: Int enab: 0x02ff900b | Sig enab: 0x02ff100b
[ 16.357717] mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 16.364141] mmc0: sdhci: Caps: 0x762dc8b2 | Caps_1: 0x00008007
[ 16.370564] mmc0: sdhci: Cmd: 0x0000123a | Max curr: 0x00000000
[ 16.376989] mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
[ 16.383411] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
[ 16.389834] mmc0: sdhci: Host ctl2: 0x0000000b
[ 16.396259] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000ff040200
[ 16.400597] mmc0: sdhci: ============================================
Begin: Loading essential drivers … done.
Begin: Running /scripts/init-premount … done.
Begin: Mounting root file system … Begin: Running /scripts/local-top … done.
Begin: Running /scripts/local-premount … [ 126.185221] raid6: int64x1 gen() 1103 MB/s


#2

Hi,

I am also facing same issue with linux kernel 4.14.15 on apq8096 based custom board.

Thanks,
Pankaj


#3

hey,

we are aware of the issue. We have ‘similar’ issue with UHS SD cards on 8096, and we think it’s the same underlying problem. We do not have access to 8096 + eMMC, we have been testing a solution for this issue with UHS SD card. We have pushed an updated branch here:

https://git.linaro.org/landing-teams/working/qualcomm/kernel.git/log/?h=integration-linux-qcomlt

and at least we don’t see the issue with UHS cards anymore. Can you please try this branch on your custom hardware and test with eMMC?

This branch is our dev branch, it’s currently based on 4.17-rc5 , not 4.14, but for the purpose of this test it should be enough. Just checkout this branch and build as usual.

thanks for your help!


#4

HI Nico,

Sd card works fine in 4.17. I have tested it.


#5

hello. ndec,
we have clone the kernel code ,by git clone https://git.linaro.org/landing-teams/working/qualcomm/kernel.git

which branch should be checkout out for test emmc ?

thanks


#6

In my case, the DragonBoard 820c simply do not detect any SD card.

dmesg command displays some error messages :

mmc0: error -5 whilst initialising SD card

I’m currently using Debian snapshot 213


#7

In 4.17 rc6 branch, it is working fine. Do not take snapshot builds(based on 4.14). Build the kernel manually.


#8

hi Pradeep,

can you please confirm you are using the branch I shared a few answers above? e.g. integration-linux-qcomlt?

Also, what exactly have you tested with this branch? UHS cards? and how have you tested them?

thanks for your help!


#9

and I forgot to add, this branch is a development branch, we will include this ‘fix’ in our release branch and into our builds, of course, once we confirm that all issues we were chasing are fixed… it’s a very large fix, not a simple bug fix…


#10

Hi Nico,

I have tested on integration-linux-qcomlt with sandisk class 4 sd card.

I have ported mmc driver to 4.14 too. It still didn’t work. Do you know why it doesn’t work in 4.14 kernel.

Thanks,
Pradeep


#11

I have tried inserting sd card preboot. It worked. I have also tested by inserting it postboot.
There are no issues on integration branch.

There is some issue with UHS cards. Sometimes, it gets detected late. Below are logs for reference.
root@linaro-alip:~# [ 30.485320] mmc0: new ultra high speed SDR104 SDHC card at address 0007
[ 30.486011] mmcblk0: mmc0:0007 SL16G 14.5 GiB
[ 30.493082] mmcblk0: p1
[ 30.501966] dwc3 6a00000.dwc3: failed to initialize core
[ 30.505639] dwc3 7600000.dwc3: failed to initialize core
[ 34.451005] mmc0: card 0007 removed
[ 40.418779] sdhci_msm 74a4900.sdhci: mmc0: pwr_irq for req: (4) timed out
[ 45.538787] sdhci_msm 74a4900.sdhci: mmc0: pwr_irq for req: (4) timed out
[ 45.675647] mmc0: new ultra high speed SDR104 SDHC card at address 0007
[ 45.676195] mmcblk0: mmc0:0007 SL16G 14.5 GiB
[ 45.683338] mmcblk0: p1
[ 45.690932] dwc3 6a00000.dwc3: failed to initialize core
[ 45.692761] dwc3 7600000.dwc3: failed to initialize core
[ 54.423093] mmc0: card 0007 removed
[ 60.386784] sdhci_msm 74a4900.sdhci: mmc0: pwr_irq for req: (4) timed out
[ 65.506782] sdhci_msm 74a4900.sdhci: mmc0: pwr_irq for req: (4) timed out
[ 65.643480] mmc0: new ultra high speed SDR104 SDHC card at address 0007
[ 65.644049] mmcblk0: mmc0:0007 SL16G 14.5 GiB
[ 65.650804] mmcblk0: p1
[ 65.659162] dwc3 6a00000.dwc3: failed to initialize core
[ 65.660985] dwc3 7600000.dwc3: failed to initialize core


#12

Pradeep,

class 4 SD cards work with 4.14 I believe… it’s UHS cards (e.g. Class 10) that don’t work… so i am confused by your last message now.

I don’t understand your sentence ‘ported mmc driver to 4.14’, do you mean that you added a device node entry? As I said earlier, on APQ8096 eMMC and UHS SD cards fail to work in our current builds. We have a strong suspicion that both issues are related to a missing driver called ‘bus scaling’. We have added this feature in the integration-linux-qcomlt branch shared earlier for testing.


#13

Hi Nico,

Sorry for the confusion.
class 4 sd card works fine with integration branch.
If I use sandisk UHS class 10 sd card, it works but it gets detected bit late with below log.
[ 346.126986] mmc0: card 0007 removed
[ 352.226780] sdhci_msm 74a4900.sdhci: mmc0: pwr_irq for req: (4) timed out
[ 357.346775] sdhci_msm 74a4900.sdhci: mmc0: pwr_irq for req: (4) timed out
[ 357.483606] mmc0: new ultra high speed SDR104 SDHC card at address 0007
**[ 357.484214] mmcblk0: mmc0:0007 SL16G 14.5 GiB **
[ 357.490914] mmcblk0: p1

one more test log, you can see the delay in detection:
[ 1091.670991] mmc0: card 0007 removed
[ 1097.442784] sdhci_msm 74a4900.sdhci: mmc0: pwr_irq for req: (4) timed out
[ 1102.562795] sdhci_msm 74a4900.sdhci: mmc0: pwr_irq for req: (4) timed out
[ 1102.686332] mmc0: new ultra high speed SDR104 SDHC card at address 0007
[ 1102.687163] mmcblk0: mmc0:0007 SL16G 14.5 GiB
[ 1102.695402] mmcblk0: p1


#14

Hi Nico,

I thought it was mmc driver issue, so i ported mmc driver from 4.17 kernel to 4.14 kernel. It doesn’t help.

Thanks for letting me know , it is related to bus scaling.


#15

Class 4 sd cards are not working with 4.14 branch. I am getting error like “mmc0: Timeout waiting for hardware interrupt”


#16

Hi @ndec ,

I reverted bus scaling patch in integration branch. sd card still works fine.

I think, this issue is not related with bus scaling.


#17

Any news on getting SD card to work with 4.14? I’m having the same issue.
Thanks,
kimbo


#18

Try Adding the below quirks to command line.
sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4

First quirk is to use system dma, second is to use reduce speed from ultra to high speed(I have used class 10 card). It seems sdhc ADMA is broken, I have not tried debugging further. may be you can try by comparing with 4.11 kernel(since sd card works there).
System DMA is not reliable for sdhc data operations.


#19

Hi Pradeep,

Adding those two quirks to the kernel image allows me to now see the sd card and contents in 4.14! Is there a downside to using those quirks? The card I am using is a class 10 as well.

Thanks,
Kim


#20

Hi Kimbo,

Have You tried read/write or data transfer to sd card ? with linux terminal, data transfer is ok but through UI, there is some issue. Downside is, data transfer rate will be slower.

These quirks are not recommended. I tried porting the mmc driver from 4.11 kernel, still it doesn’t work, we need to debug why sdhc host controller ADMA is not working in 4.14. May be @ndec @Loic can give us pointers to debug the issue?

Pradeep.