1

I have an HP EliteBook 8460p, equipped with JMicron card reader:

rolf@deb:/sys$ sudo lshw |grep JMicron -B 3 -A 8 
       *-firewire       
            description: FireWire (IEEE 1394)
            product: IEEE 1394 Host Controller
            vendor: JMicron Technology Corp.
            physical id: 0
            bus info: pci@0000:23:00.0
            version: 30
            width: 32 bits
            clock: 33MHz
            capabilities: pm pciexpress msi ohci bus_master cap_list
            configuration: driver=firewire_ohci latency=0
            resources: irq:18 memory:d4600000-d46007ff memory:d4605000-d46050ff
       *-generic:0
            description: System peripheral
            product: SD/MMC Host Controller
            vendor: JMicron Technology Corp.
            physical id: 0.1
            bus info: pci@0000:23:00.1
            version: 30
            width: 32 bits
            clock: 33MHz
            capabilities: pm pciexpress msi bus_master cap_list rom
            configuration: driver=sdhci-pci latency=0
            resources: irq:18 memory:d4604000-d46040ff memory:d4608000-d460ffff
       *-generic:1 UNCLAIMED
            description: SD Host controller
            product: Standard SD Host Controller
            vendor: JMicron Technology Corp.
            physical id: 0.2
            bus info: pci@0000:23:00.2
            version: 30
            width: 32 bits
            clock: 33MHz
            capabilities: pm pciexpress msi cap_list
            configuration: latency=0
            resources: memory:d4603000-d46030ff

rolf@deb:/sys$ uname -a && lsb_release -a
Linux deb 4.15.0-2-amd64 #1 SMP Debian 4.15.11-1 (2018-03-20) x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux testing (buster)
Release:    testing
Codename:   buster

Read rates are about 10MB/s. In Windows 10, I get 80MB/s sustained.

These extracts from dmesg might be relevant:

[    1.988810] sdhci: Secure Digital Host Controller Interface driver
[    1.988811] sdhci: Copyright(c) Pierre Ossman
[    1.989507] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.989530] sdhci-pci 0000:23:00.1: SDHCI controller found [197b:2392] (rev 30)
[    1.989647] mmc0 bounce up to 128 segments into one, max segment size 65536 bytes
[    1.990042] ehci-pci: EHCI PCI platform driver
[    1.990144] mmc0: SDHCI controller on PCI [0000:23:00.1] using DMA
[    1.990174] sdhci-pci 0000:23:00.2: SDHCI controller found [197b:2391] (rev 30)
[    1.994928] SCSI subsystem initialized
[    1.996413] sdhci-pci 0000:23:00.2: Refusing to bind to secondary interface.
[    1.999440] libata version 3.00 loaded.
[    2.002040] AVX version of gcm_enc/dec engaged.
[    2.002041] AES CTR mode by8 optimization enabled
[    2.004339] xhci_hcd 0000:25:00.0: xHCI Host Controller
[    2.004347] xhci_hcd 0000:25:00.0: new USB bus registered, assigned bus number 1
[    2.004556] xhci_hcd 0000:25:00.0: hcc params 0x014042cb hci version 0x96 quirks 0x00000004


[    2.264222] mmc0: new SDXC card at address 59b4
[    2.267942] mmcblk0: mmc0:59b4 SDU1  59.1 GiB 
[    2.269284]  mmcblk0: p1

It says UNCLAIMED for "SD Host controller", in lshw output, would this be related?

I had a look at /sys/kernel/debug/mmc0/ios

clock:      25000000 Hz
actual clock:   25000000 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:    0 (legacy)
signal voltage: 0 (3.30 V)
driver type:    0 (driver type B)

My card reader seems to be set-up in the slowest mode.

The faster modes have low-voltage signaling (1.8V), and I have seen "timer spec" displaying "sd high-speed" in other places on the internet.

So, why would this happen, and how can I force my SD reader into a faster mode?

3
  • 1
    May or may not be relevant: I've been experiencing I/O throughput problems for some time now, and found dropping caches (echo 3 | sudo tee /proc/sys/vm/drop_caches) fixes it, at least for some time. I suspect multicore locking issues when using the disk cache, but have not been able to nail it down. (Of course, yours may be a completely different problem).
    – dirkt
    Apr 15, 2018 at 19:08
  • @dirkt Thank you for your suggestion. After dropping cache the throughput is still 10-11 MB/s. If you have issues with the disk cache maybe you can disable write cache (-W 0) or read-ahead (-A 0) with hdparm.
    – Rolf
    Apr 17, 2018 at 15:59
  • I found a PDF document, "JMB385 (Version D) PCI Express to Card Reader Host Controller Data Sheet ". It is very technical and could not understand much, I am also not sure that this is the right chip. However, it mentions a "default mode" and "high speed mode" (section 3.8) for SD. They provide a driver for Windows and OSX.
    – Rolf
    Apr 17, 2018 at 20:33

2 Answers 2

3

This is just a partial answer.

I managed to improve performance to around 19MB/s by doubling the clock rate.

It seems that the timing spec below can be set to more interesting values, such as "sd high-speed", but no luck for me so far.

rolf@deb:~$ sudo cat /sys/kernel/debug/mmc0/ios
[sudo] password for rolf: 
clock:      25000000 Hz
actual clock:   25000000 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:    0 (legacy)
signal voltage: 0 (3.30 V)
driver type:    0 (driver type B)
rolf@deb:~$ sudo cat /sys/kernel/debug/mmc0/clock
25000000
rolf@deb:~$ sudo dd if=/dev/mmcblk0 of=/dev/null bs=512
^C73953+0 records in
73952+0 records out
37863424 bytes (38 MB, 36 MiB) copied, 3.55635 s, 10.6 MB/s

rolf@deb:~$ echo 50000000 | sudo tee /sys/kernel/debug/mmc0/clock
50000000
rolf@deb:~$ sudo cat /sys/kernel/debug/mmc0/ios
clock:      50000000 Hz
actual 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:    0 (legacy)
signal voltage: 0 (3.30 V)
driver type:    0 (driver type B)
rolf@deb:~$ sudo dd if=/dev/mmcblk0 of=/dev/null bs=512
^C225761+0 records in
225760+0 records out
115589120 bytes (96 MB, 92 MiB) copied, 4.94934 s, 19.4 MB/s

My card is rated Class 10 UHS‐I.

It seems that the controller is being set to the slowest, oldest (hence most compatible) SD speed mode, which is 25Mhz, 3.3V signal, 12.5MB/sec.

By manually bumping the frequency to 50Mhz, I would have put it in "High Speed" mode (25MB/sec, spec 1.10).

Under Windows, it would be running in UHS-I, SDR104 mode - 104MB/sec. SDR104 mode has a frequency of 208MHz and signal voltage of 1.8V.

I haven't yet found a way to manually set the bus mode or the voltage, which is needed to further increase the frequency.

0

I also have a 400GB Class 10 UHS‐I microSD (SDSQUAR-400G-GN6MA) in mmc slot of Lenovo L380 with arch linux and it shows 208MHz and signal voltage of 1.8V. The write speed is ok: The initial test with f3write shows 37 MB/s and f3read 72 MB/s with exfat file system. Ever since the card is ext4 under luks/lvm. I got the problem that rsync hangs regularly during (local) backup several times for a couple of minutes! I'm currently investigating to change the data mode as proposed here: https://stackoverflow.com/a/21766889, to disable journaling, and mounting with noatime. rsync doesn't hang when I backup via USB3 port to a HD or SSD. So my guess is rsync hanging must be related to mmc driver.

1
  • Thank you for your answer. You seem to have a different problem. My problem is that I am not able to get it to 1.8V and 208Mhz high speed mode, although the hardware should support it (it works in Windows).
    – Rolf
    Oct 21, 2019 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .