Sdhci-tegra sdhci-tegra.2: Tuning done, restoring the best tap value

Hi,

I have activated the SDMMC3 in my kernel customization.

But now I have the problem, if I remove the SD card during runtime, I always get the following message in my dmesg:

[  293.802766] sdhci-tegra sdhci-tegra.2: Tuning done, restoring the best tap value : 94

If I reinsert the SD card, everything is fine again.

In my device tree I have added the following things:

sdhci@700b0400 { /* SDMMC3 for SDCARD */
status = “okay”;
tap-delay = <3>;
/delete-property/ nvidia,min-tap-delay;
/delete-property/ nvidia,max-tap-delay;
max-clk-limit = <400000>;
};

sd_card_error (66.6 KB) tegra210-dts_nb_nano.dts (326.2 KB)

Hi,

So is there anything crashed here?

Hi,

if I don’t put the SD card back into the slot, my entire dmesg is full of this message. That’s not normal, is it? In my upload I have only shown a short part of it so that you can still read the other messages.

Please check if you have all the patches here.

If you have them, then there is probably hardware design problem on the board

1 Like

I made the patches, but my SD card no longer works if I should remove the max-clk-limit in step 2, which I set in step 1 before.
The Card Detect no longer works with the “nvidia, vmmc-always-on”, so I removed it for my case.

Share your board schematic may help. If you don’t need “vmmc-always-on”, do you mean you have a gpio/regulator as power source?

This is the schematic!
Screenshot 2021-03-01 101046|690x341

And this is the connection for the SD_CD signal.

Hi,

  1. Is sd3 regulator added by you?

  2. Please follow all the 4 patches I shared. If you hit error, share the log here. It looks like max-clk-limit and nvidia, vmmc-always-on is not the one that causes problem. Seems like your vmmc-supply and vqmmc-supply are the one the has problem.

With the SD3 regulator you talk about the IC20 TPS22919? Yes, this is on our carrier board, more or less as short circuit protection.

Hi,

Patch 1: Patch is included and no errors, only the “tuning done” problem, what is described in the post.
Patch 2: Patch is included and I got these errors:

[    8.953887] mmc1: Data CRC error
[    8.957116] sdhci: =========== REGISTER DUMP (mmc1)===========
[    8.962938] sdhci: Sys addr: 0x00000038 | Version:  0x00000303
[    8.968759] sdhci: Blk size: 0x00007200 | Blk cnt:  0x0000002e
[    8.974580] sdhci: Argument: 0x00000840 | Trn mode: 0x0000003b
[    8.980399] sdhci: Present:  0x01fb0000 | Host ctl: 0x00000013
[    8.986219] sdhci: Power:    0x00000001 | Blk gap:  0x00000000
[    8.992038] sdhci: Wake-up:  0x00000000 | Clock:    0x00000007
[    8.997856] sdhci: Timeout:  0x0000000e | Int stat: 0x00000000
[    9.003675] sdhci: Int enab: 0x02ff100b | Sig enab: 0x02fc100b
[    9.009494] sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[    9.015314] sdhci: Caps:     0x376cd08c | Caps_1:   0x10006f77
[    9.021135] sdhci: Cmd:      0x0000123a | Max curr: 0x00000000
[    9.026952] sdhci: Host ctl2: 0x00003001
[    9.030866] sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000ffefe410
[    9.037400] sdhci: ===========================================
[    9.043407] mmcblk1: error -110 sending stop command, original cmd response 0x900, card status 0x400900
[    9.043416] mmcblk1: error -84 transferring data, sector 2112, nr 56, cmd response 0x900, card status 0x0

Patch 3: I wanted to manually enter the changes from the patch in the kernel, but the changes are already available in L4T 32.5.1.
Patch 4: With all patches, the problem with the Card Detect did not recur and the errors from patch 2 were resolved.
But the original problem with “Tuning done, restoring the best tap value” remains.

dmesg_patch2+4 (65.6 KB) dmesg_patch2_error (80.2 KB)

Hi,

here the new dts-file, maybe it is helpful.

tegra210-dts_nb_nano.dts (326.2 KB)

Hi,

Where is your cd-gpios?

1 Like

Hi,

how do I have to enter the cd-gpios?
In the Pinmux I have the GPIO08 as SDMMC3_CD | Input | Int PU set. Isn’t that enough?

You didn’t give it to your device tree. So the driver does not know the existence at all.

And how I give it to my device tree? How does it have to look?

grep cd-gpios in the original sources and you will find it out. Our sdcard module has an example for that.

I just have “cd-gpios = <& gpio TEGRA_GPIO (Z, 2) 0>;” added in the dts file and now the SD card does not recognize any more.
The development kits say “cd-gpios = <& gpio TEGRA_GPIO (Z, 1) 0>;” in the dts file.

Since GPIO08 is connected to GPIO_PZ2, my allocation is correct, isn’t it?

tegra210-dts_nb_nano.dts (326.2 KB)

Can you share me the dmesg?

Here the dmesg.

dmesg_nb (58.6 KB)