当前位置:网站首页>EMMC print cqhci: timeout for tag 10 prompt analysis and solution

EMMC print cqhci: timeout for tag 10 prompt analysis and solution

2022-07-07 05:49:00 Wang erche

        mt2735 5G Module external Hynix 8G EMMC, Start the prompt to analyze the data reading failure . 

Start printing

EMMC Drive clock initialization printing :

[    3.977929] <1>.(1)[1:swapper/0]mtk-msdc 11230000.mmc: Linked as a consumer to regulator.27
[    3.979343] <1>.(1)[1:swapper/0]mmc0: CQHCI version 5.10
[    3.981926] <1>.(1)[1:swapper/0]mtk-msdc 11230000.mmc: init hardware done!
[    3.984383] <1>.(1)[1:swapper/0]mtk-msdc 11230000.mmc: init hardware done!
[    3.996084] <1>.(1)[1:swapper/0]mtk-msdc 11230000.mmc: host->mclk:0, ios->clock:400000, host->timing:0,ios->timing:0
[    3.997531] <2>.(2)[1:swapper/0]mtk-msdc 11230000.mmc: sclk: 399999, timing: 0, hz: 400000
[    4.015348] <2>.(2)[1:swapper/0]mtk-msdc 11240000.mmc: Got CD GPIO
[    4.017036] <2>.(2)[1:swapper/0]mtk-msdc 11240000.mmc: Linked as a consumer to regulator.33
[    4.020145] <2>.(2)[1:swapper/0]mtk-msdc 11240000.mmc: init hardware done!
[    4.035223] <2>.(2)[1:swapper/0]mtk-msdc 11240000.mmc: host->mclk:0, ios->clock:400000, host->timing:0,ios->timing:0
[    4.036795] <2>.(2)[1:swapper/0]mtk-msdc 11240000.mmc: sclk: 399999, timing: 0, hz: 400000
[    4.051228] <2>.(2)[2170:kworker/2:2]mtk-msdc 11240000.mmc: host->mclk:400000, ios->clock:0, host->timing:0,ios->timing:0
[    4.052635] <2>.(2)[2170:kworker/2:2]mtk-msdc 11240000.mmc: set mclk to 0

[    4.104750] <2>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: host->mclk:400000, ios->clock:400000, host->timing:0,ios->timing:9
[    4.106295] <2>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: sclk: 399999, timing: 9, hz: 400000
[    4.107746] <2>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: host->mclk:400000, ios->clock:200000000, host->timing:9,ios->timing:9
[    4.109256] <2>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: sclk: 191999939, timing: 9, hz: 200000000

HS200 and HS400 Mode detection printing : HS200 and HS400 Patterns are detected successfully .drivers/mmc/host/mediatek/autok.c

[    4.077168] <0>.(0)[14:kworker/0:1][AUTOK]eMMC HS200 Tune
[    4.084195] <2>.(0)[14:kworker/0:1][AUTOK]CMD 0 	 44 	 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOOOOOOOOOOOOOOO
[    4.088048] <0>.(0)[14:kworker/0:1][AUTOK]CMD 1 	 56 	 OOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[    4.094483] <0>.(0)[14:kworker/0:1][AUTOK]Analysis Result: 1T = 74
[    4.099475] <0>.(0)[14:kworker/0:1][AUTOK]dev status 0x00000900
[    4.113842] <2>.(0)[14:kworker/0:1][AUTOK]DAT 0 	 39 	 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXXXXXXXOOOOOOOOOOOOOOOOO
[    4.123932] <0>.(0)[14:kworker/0:1][AUTOK]DAT 1 	 55 	 OOXXXXXXXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[    4.125058] <0>.(0)[14:kworker/0:1][AUTOK]Analysis Result: 1T = 74
[    4.129413] <2>.(0)[14:kworker/0:1][AUTOK]CMD [EDGE:0 CMD_FIFO_EDGE:0 DLY1:7 DLY2:0]
[    4.139421] <2>.(0)[14:kworker/0:1][AUTOK]DAT [RDAT_EDGE:0 RD_FIFO_EDGE:0 WD_FIFO_EDGE:0]
[    4.145125] <2>.(0)[14:kworker/0:1][AUTOK]DAT [LATCH_CK:0 DLY1:5 DLY2:0]
[    4.148244] <2>.(0)[14:kworker/0:1][AUTOK]DS  [DLY1:0 DLY2:0 DLY3:0]
[    4.151185] <2>.(0)[14:kworker/0:1][AUTOK]CLK TX  [0]
[    4.154158] <2>.(0)[14:kworker/0:1][AUTOK]CMD TX  [0]
[    4.154171] <2>.(0)[14:kworker/0:1][AUTOK]DAT TX  [D0:0 D1:0 D2:0 D3:0]
[    4.157110] <2>.(0)[14:kworker/0:1][AUTOK]DAT TX  [D4:0 D5:0 D6:0 D7:0]
[    4.160055] <0>.(0)[14:kworker/0:1][AUTOK][HS200]======Cost:82 ms======

[    4.187290] <3>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: host->mclk:200000000, ios->clock:200000000, host->timing:9,ios->timing:1
[    4.188971] <3>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: sclk: 191999939, timing: 1, hz: 200000000
[    4.193035] <3>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: host->mclk:200000000, ios->clock:52000000, host->timing:1,ios->timing:1
[    4.194632] <3>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: sclk: 47999984, timing: 1, hz: 52000000
[    4.198355] <3>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: host->mclk:52000000, ios->clock:52000000, host->timing:1,ios->timing:10
[    4.200224] <3>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: sclk: 47999984, timing: 10, hz: 52000000
[    4.203163] <3>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: host->mclk:52000000, ios->clock:200000000, host->timing:10,ios->timing:10
[    4.205782] <3>.(2)[74:kworker/2:1]mtk-msdc 11230000.mmc: sclk: 191999939, timing: 10, hz: 200000000

[    4.182371] <2>.(0)[14:kworker/0:1][AUTOK]eMMC HS400 Tune
[    4.191612] <2>.(0)[14:kworker/0:1][AUTOK]CMD 0 	 44 	 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOOOOOOOOOOOOOOO
[    4.196469] <2>.(0)[14:kworker/0:1][AUTOK]CMD 1 	 57 	 OOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[    4.200044] <2>.(0)[14:kworker/0:1][AUTOK]Analysis Result: 1T = 76
[    4.202067] <2>.(0)[14:kworker/0:1][AUTOK]device status 0x00000900
[    9.431232] <0>.(0)[14:kworker/0:1][AUTOK]DLY1/2 0 	 0 	 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[    9.432691] <0>.(0)[14:kworker/0:1][AUTOK]CMD [EDGE:0 CMD_FIFO_EDGE:0 DLY1:6 DLY2:0]
[    9.433721] <0>.(0)[14:kworker/0:1][AUTOK]DAT [RDAT_EDGE:0 RD_FIFO_EDGE:0 WD_FIFO_EDGE:0]
[    9.434782] <0>.(0)[14:kworker/0:1][AUTOK]DAT [LATCH_CK:0 DLY1:0 DLY2:0]
[    9.435656] <0>.(0)[14:kworker/0:1][AUTOK]DS  [DLY1:0 DLY2:0 DLY3:20]
[    9.436497] <0>.(0)[14:kworker/0:1][AUTOK]CLK TX  [0]
[    9.437161] <0>.(0)[14:kworker/0:1][AUTOK]CMD TX  [0]
[    9.437826] <0>.(0)[14:kworker/0:1][AUTOK]DAT TX  [D0:0 D1:0 D2:0 D3:0]
[    9.438688] <0>.(0)[14:kworker/0:1][AUTOK]DAT TX  [D4:0 D5:0 D6:0 D7:0]
[    9.439571] <0>.(0)[14:kworker/0:1][AUTOK][HS400]======Cost:5251 ms======

distinguish EMMC success , hynix 8G Capacity , But read the partition data message data error later dat_err =-110, Start reset recovery :

[    9.463002] <2>.(2)[74:kworker/2:1]mmc0: Command Queue Engine enabled
[    9.463855] <2>.(2)[74:kworker/2:1]mmc0: new HS400 MMC card at address 0001
[    9.468233] <2>.(2)[74:kworker/2:1]mmcblk0: mmc0:0001 H8G4a2 7.28 GiB 
[    9.468233] <2>.(2)[74:kworker/2:1]mmcblk0: mmc0:0001 H8G4a2 7.28 GiB 
[    9.470576] <2>.(2)[74:kworker/2:1]mmcblk0boot0: mmc0:0001 H8G4a2 partition 1 4.00 MiB
[    9.470576] <2>.(2)[74:kworker/2:1]mmcblk0boot0: mmc0:0001 H8G4a2 partition 1 4.00 MiB
[    9.473075] <2>.(2)[74:kworker/2:1]mmcblk0boot1: mmc0:0001 H8G4a2 partition 2 4.00 MiB
[    9.473075] <2>.(2)[74:kworker/2:1]mmcblk0boot1: mmc0:0001 H8G4a2 partition 2 4.00 MiB
[    9.474489] <2>.(2)[74:kworker/2:1]mmcblk0rpmb: mmc0:0001 H8G4a2 partition 3 4.00 MiB, chardev (234:0)
[    9.474489] <2>.(2)[74:kworker/2:1]mmcblk0rpmb: mmc0:0001 H8G4a2 partition 3 4.00 MiB, chardev (234:0)
[   10.176763] <0>-(0)[0:swapper/0]mtk-msdc 11230000.mmc: msdc_cmdq_irq: DATA TIMEOUT ERR
[   10.177837] <0>-(0)[0:swapper/0]mtk-msdc 11230000.mmc: cmd_err = 0, dat_err =-110, intsts = 0x10004108
[   10.179160] <0>.(0)[14:kworker/0:1]mmc0: running CQE recovery

Print “mmc0: cqhci: timeout for tag 10” Error prompt and register information , Timeout here 60 second :#define MMC_ERASE_TIMEOUT_MS    (60 * 1000) /* 60 s */

[   74.716094] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: timeout for tag 10
[   74.716989] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: ============ CQHCI REGISTER DUMP ===========
[   74.718161] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Caps:      0x000020b6 | Version:  0x00000510
[   74.719331] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Config:    0x00001101 | Control:  0x00000000
[   74.720500] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Int stat:  0x00000000 | Int enab: 0x00000006
[   74.721670] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Int sig:   0x00000006 | Int Coal: 0x00000000
[   74.722838] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: TDL base:  0x7f047000 | TDL up32: 0x00000000
[   74.724006] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Doorbell:  0x00000400 | TCN:      0x00000000
[   74.725174] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000400
[   74.726433] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Task clr:  0x00000000 | SSC1:     0x00001000
[   74.727606] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: SSC2:      0x00000001 | DCMD rsp: 0x00000000
[   74.728775] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: RED mask:  0xfdf9a080 | TERRI:    0x00000000
[   74.729943] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Resp idx:  0x0000000d | Resp arg: 0x00000000
[   74.731108] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: : ===========================================
[   74.732379] <2>.(2)[2417:kworker/2:3]mmc0: running CQE recovery

Finally report “print_req_error: I/O error, dev mmcblk0, sector 0” Data read failed :

[  136.157599] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: timeout for tag 10
[  136.164661] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: ============ CQHCI REGISTER DUMP ===========
[  136.165832] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Caps:      0x000020b6 | Version:  0x00000510
[  136.167153] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Config:    0x00001101 | Control:  0x00000000
[  136.168326] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Int stat:  0x00000000 | Int enab: 0x00000006
[  136.169495] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Int sig:   0x00000006 | Int Coal: 0x00000000
[  136.170665] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: TDL base:  0x7f047000 | TDL up32: 0x00000000
[  136.171834] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Doorbell:  0x00000400 | TCN:      0x00000000
[  136.173003] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000400
[  136.174172] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Task clr:  0x00000000 | SSC1:     0x00001000
[  136.175340] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: SSC2:      0x00000001 | DCMD rsp: 0x00000000
[  136.176616] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: RED mask:  0xfdf9a080 | TERRI:    0x00000000
[  136.177788] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: Resp idx:  0x0000000d | Resp arg: 0x00000000
[  136.178955] <2>.(2)[2230:kworker/2:1H]mmc0: cqhci: : ===========================================
[  136.180252] <2>.(2)[2417:kworker/2:3]mmc0: running CQE recovery
[  136.181927] <2>.(2)[2417:kworker/2:3]print_req_error: I/O error, dev mmcblk0, sector 0
[  136.183029] <2>.(2)[2417:kworker/2:3]Buffer I/O error on dev mmcblk0, logical block 0, async page read
[  136.891855] <0>-(0)[0:swapper/0]mtk-msdc 11230000.mmc: msdc_cmdq_irq: DATA TIMEOUT ERR
[  136.892967] <0>-(0)[0:swapper/0]mtk-msdc 11230000.mmc: cmd_err = 0, dat_err =-110, intsts = 0x10004108
[  136.894396] <0>.(0)[2416:kworker/0:2]mmc0: running CQE recovery
[  330.716949] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: timeout for tag 12
[  330.724006] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: ============ CQHCI REGISTER DUMP ===========
[  330.725177] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: Caps:      0x000020b6 | Version:  0x00000510
[  330.726430] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: Config:    0x00001101 | Control:  0x00000000
[  330.727606] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: Int stat:  0x00000000 | Int enab: 0x00000006
[  330.728776] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: Int sig:   0x00000006 | Int Coal: 0x00000000
[  330.729945] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: TDL base:  0x7f047000 | TDL up32: 0x00000000
[  330.731114] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: Doorbell:  0x00001000 | TCN:      0x00000000
[  330.732282] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00001000
[  330.733450] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: Task clr:  0x00000000 | SSC1:     0x00001000
[  330.734619] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: SSC2:      0x00000001 | DCMD rsp: 0x00000000
[  330.735785] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: RED mask:  0xfdf9a080 | TERRI:    0x00000000
[  330.737229] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: Resp idx:  0x0000000d | Resp arg: 0x00000000
[  330.738408] <3>.(3)[2450:kworker/3:1H]mmc0: cqhci: : ===========================================
[  330.739688] <3>.(3)[4193:kworker/3:5]mmc0: running CQE recovery

Seriously affecting the startup speed and time , see emmc Post startup mode :

[email protected]:~# cat /sys/kernel/debug/mmc0/ios
clock:		200000000 Hz
actual clock:	191999939 Hz
vdd:		18 (3.0 ~ 3.1 V)
bus mode:	2 (push-pull)
chip select:	0 (don't care)
power mode:	2 (on)
bus width:	3 (8 bits)
timing spec:	10 (mmc HS400)
signal voltage:	1 (1.80 V)
driver type:	0 (driver type B)

Problem analysis

Check the circuit diagram design , Check whether there is any problem with the welding of hardware components , analysis EMMC Data manual ,5.1 Version of EMMC Need to connect Data Strobe pin Pin to support HS400 Pattern , and 4.5 The version of does not need to connect this pin, so it only supports up to HS200 Pattern ;Vcc It is the power connection of the device 3.3V,Vccq It's the control part , Determine the level of data and other pins , Pick up 1.8V perhaps 3.3V In this way, with CPU The pins of the chip are level matched .

  In circuit design , Because of the previous 4.5 Version hardware design leads to no connection Data Strobe pin Pin , therefore HS400 Although the detection was successful , But reading data failed ; That's because EMMC and CPU Drivers support 5.1 edition .

 Data Strobe pin The pin is H5 Pin , It needs to be verified after the next version of hardware is connected .

  Problem solving

Can only be forcibly detected HS200 Pattern , Annotation detection HS400 Model code :

static int mmc_init_card(struct mmc_host *host, u32 ocr,
    struct mmc_card *oldcard)
{
    struct mmc_card *card;
    int err;
    u32 cid[4];
    u32 rocr;

    WARN_ON(!host->claimed);

	......
    if (mmc_card_hs200(card)) {
        err = mmc_hs200_tuning(card);
        if (err)
            goto free_card;

//      err = mmc_select_hs400(card);
//      if (err)
//          goto free_card;
    } else if (!mmc_card_hs400es(card)) {
        /* Select the desired bus width optionally */
        err = mmc_select_bus_width(card);
        if (err > 0 && mmc_card_hs(card)) {
            err = mmc_select_hs_ddr(card);
            if (err)
                goto free_card;
        }
    }
[    4.067441] <3>.(3)[68:kworker/3:1]mtk-msdc 11230000.mmc: host->mclk:400000, ios->clock:400000, host->timing:0,ios->timing:9
[    4.068901] <3>.(3)[68:kworker/3:1]mtk-msdc 11230000.mmc: sclk: 399999, timing: 9, hz: 400000
[    4.070330] <3>.(3)[68:kworker/3:1]mtk-msdc 11230000.mmc: host->mclk:400000, ios->clock:200000000, host->timing:9,ios->timing:9
[    4.071903] <3>.(3)[68:kworker/3:1]mtk-msdc 11230000.mmc: sclk: 191999939, timing: 9, hz: 200000000
[    4.130445] <3>.(3)[68:kworker/3:1]mmc0: Command Queue Engine enabled
[    4.131595] <3>.(3)[68:kworker/3:1]mmc0: new HS200 MMC card at address 0001
[    4.145960] <3>.(3)[68:kworker/3:1]mmcblk0: mmc0:0001 H8G4a2 7.28 GiB 
[    4.148318] <3>.(3)[68:kworker/3:1]mmcblk0boot0: mmc0:0001 H8G4a2 partition 1 4.00 MiB
[    4.150826] <3>.(3)[68:kworker/3:1]mmcblk0boot1: mmc0:0001 H8G4a2 partition 2 4.00 MiB
[    4.152472] <3>.(3)[68:kworker/3:1]mmcblk0rpmb: mmc0:0001 H8G4a2 partition 3 4.00 MiB, chardev (234:0)
[    4.160306] <3>.(3)[68:kworker/3:1] mmcblk0: p1
[    4.168629] <3>.(3)[68:kworker/3:1]BOOTPROF:      4168.624624:probe: probe=mmc_bus_probe drv=mmcblk(mmc_driver)    34.474692ms
[email protected]:~#  cat /sys/kernel/debug/mmc0/ios
clock:		200000000 Hz
actual clock:	191999939 Hz
vdd:		18 (3.0 ~ 3.1 V)
bus mode:	2 (push-pull)
chip select:	0 (don't care)
power mode:	2 (on)
bus width:	3 (8 bits)
timing spec:	9 (mmc HS200)
signal voltage:	1 (1.80 V)
driver type:	0 (driver type B)
[email protected]:~# ls /dev/mmcblk0* -l
brw-rw---- 1 root disk 179,  0 Apr  2 03:55 /dev/mmcblk0
brw-rw---- 1 root disk 179,  8 Apr  2 03:55 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 16 Apr  2 03:55 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179,  1 Apr  2 03:55 /dev/mmcblk0p1
crw------- 1 root root 234,  0 Apr  2 03:55 /dev/mmcblk0rpmb
Disk /dev/mmcblk0: 7.3 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd9379130

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       2048 15269887 15267840  7.3G 83 Linux

Use... After startup fdisk The tool partitions and reads and writes data normally .

原网站

版权声明
本文为[Wang erche]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070002246993.html