The speed of read and write of sd card is too slow

Hi,

We test the read and write speed of our carrier board’ SD card

This is our dtsi:

sdhci@700b0400 {
status = "okay";
/delete-property/ keep-power-in-suspend;
/delete-property/ non-removable;
mmc-ddr-1_8v;
mmc-ocr-mask = <3>;
uhs-mask = <0x0>;
max-clk-limit = <400000>;
tap-delay = <3>;
cd-gpios = <&gpio TEGRA_GPIO(I, 0) GPIO_ACTIVE_HIGH>;

We copy a 1GB file from SD card to ram, it takes 638 seconds

Then copy the same file from ram to SD card, it takes 378 seconds

Because this result is lower than we expected, is there any possible reason?

SD Card :
SAMSUNG PRO Endurance microSDHC
UHS-1 Class10 32GB

Read :100 MB/s

Write :30 MB/s


Please remove “max-clk-limit = <400000>;”

Hi , WayneWWW

  After we remove the  "max-clk-limit = <400000>;" , the SDIO clock increase to 50MHz , we copy  a 1GB file from SD card to ram, it takes 52 seconds(Read) , then copy the same file from ram to SD card(Write), it takes 30 seconds . 

  Compare to Jetson Nano EVB with the same test procedure , the SDIO clock is 208MHz , Read time is  12 seconds , write time is 22 seconds .

  The Read / Write speed of EVB is much faster then our carrier board , how can we set the SDIO clock to 208MHz ? Is there any bug in circuit diagram ?  

   Another question is in EVB , VDD to SD card is +3.3V , but measured clock / data voltage is 1.8V , from the SD card specification , it only support 2.7~ 3.6V , is there any voltage level shifter in SDIO circuit? 

Regards
Wayne

Could you share the result of below node?

sudo -s
cat /sys/kernel/debug/mmc1/ios
cat /sys/kerenl/debug/mmc1/clock
cat /sys/kernel/debug/mmc1/speed

Also, try different cards if possible.

The result of these commands

Another SD card has the same result

root@pesi-desktop:/home/pesi# cat /sys/kernel/debug/mmc1/ios
clock:          50000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    2 (sd high-speed)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)

root@pesi-desktop:/home/pesi# cat /sys/kernel/debug/mmc1/clock
50000000

root@pesi-desktop:/home/pesi# cat /sys/kernel/debug/mmc1/speed
1

Hi Dave,

Could you also share the dmesg?

Hi WayneWWW,

This is dmesg that plug the sd card and boot up
20200313_dmesg.txt (59.7 KB)

This is under investigation. Will update the thread once we find something.

Hi WayneWWW,

Have any update?

Hi Dave,

Could you try to use below patch?

ea53ff9.diff.zip (1.5 KB)

@WayneWWW,

Will this patch work for Jetpack 4.4.1?

Yes, jetapck4.4.1 does not have this patch.

@WayneWWW,

So Jetpack 4.5.1 does then?

I can’t tell for Nano because I don’t have these sources, but yes for TX2 or Xavier in R32.5.1 (kernel 4.9.201) the patch is there (sharing here only the comment for general understanding):

	} else if (!fallback && (host->caps2 & MMC_CAP2_SLOT_REG_ALWAYS_ON)) {
		/*
		 * With slot regulator always-on, SW reset does not power cycle
		 * the card. As a result, the card continues to stay in 1.8V
		 * mode from previous init cycle and sends S18A=0 in response to
		 * CMD8 even though it supports 1.8V signalling.
		 * Skip CMD11, set rocr to support 1.8V for S18A=0 response from
		 * the card if slot is fed from always-on supply and
		 * continue with UHS mode init.
		 * If S18A=0 response is due to an HS card plugin, all subsequent
		 * commands at 1.8V will fail and the host controller enumerates
		 * the card in HS mode in the next retry.
		 */
1 Like