我有一台 HP EliteBook 8460p,配备 JMicron 读卡器:
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
读取速率约为 10MB/s。在 Windows 10 中,我的速度持续为 80MB/s。
这些摘录dmesg
可能相关:
[ 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
它在输出中显示“SD 主机控制器”未声明lshw
,这是否相关?
我看了一下/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)
我的读卡器似乎设置为最慢模式。
更快的模式具有低电压信号(1.8V),并且我在互联网上的其他地方看到“定时器规格”显示“SD高速”。
那么,为什么会发生这种情况,以及如何强制我的 SD 读卡器进入更快的模式?
答案1
这只是部分答案。
通过将时钟速率加倍,我设法将性能提高到大约 19MB/s。
似乎timing spec
下面可以设置为更有趣的值,例如“sd high-speed”,但到目前为止我还没有运气。
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
我的卡评级为 10 级 UHS-I。
控制器似乎被设置为最慢、最古老(因此最兼容)的 SD 速度模式,即 25Mhz、3.3V 信号、12.5MB/秒。
通过手动将频率提高到 50Mhz,我会将其置于“高速”模式(25MB/秒,规格 1.10)。
在 Windows 下,它将以 UHS-I、SDR104 模式运行 - 104MB/秒。SDR104 模式的频率为 208MHz,信号电压为 1.8V。
我还没有找到手动设置总线模式或电压的方法,这是进一步提高频率所需要的。
答案2
我在装有 arch linux 的 Lenovo L380 的 mmc 插槽中还有一个 400GB Class 10 UHS-I microSD (SDSQUAR-400G-GN6MA),它显示频率为 208MHz,信号电压为 1.8V。写入速度还可以:使用 exfat 文件系统时,f3write 的初始测试显示为 37 MB/s,f3read 为 72 MB/s。既然卡在luks/lvm下是ext4的。我遇到了这样的问题:rsync 在(本地)备份期间经常挂起几分钟!我目前正在研究更改此处建议的数据模式:https://stackoverflow.com/a/21766889,禁用日志记录,并使用 noatime 进行安装。当我通过 USB3 端口备份到 HD 或 SSD 时,rsync 不会挂起。所以我的猜测是rsync挂起一定与mmc驱动程序有关。