#StackBounty: #block-device #sd-card #pci JMicron SD reader is slow

Bounty: 50

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.

Things I’ve tried:

  • Changing the readeahead value on the block device
    blockdev --setra 1024 /dev/mmcblk0p1
  • Making sure the correct kernel modules are loaded (sdhci_pci,tifm_sd,mmc_core,mmc_block)
  • Remounting with async: the option is not recognized
  • Changing the block scheduler on the device to noop or deadline before mounting
    tee /sys/block/mmcblk0/queue/scheduler ...

It doesn’t seem to be a filesystem issue, because I get low performance when doing dd from the block device itself to the disk or to /dev/null, and CPU activity remains low.

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

Obviously, my question is, how do I get better performance with Linux?

How to debug this and get a better idea of what is happening?

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


Get this bounty!!!

Leave a Reply