linux无法读取SD卡

linux无法读取SD卡

我无法从 Linux 读取任何 SD 卡。我已经在不同的机器(Windows 和 Linux)上尝试过两张 SD 卡,它们工作完美,我还从实时 USB 启动(与我安装的内核和发行版相同),它们也工作,所以它一定是某种东西在我当前安装的 Kali Linux 中,导致了这个问题。

首先,这些是我插入SD卡时收到的日志:

Jan  4 22:41:42 matrix kernel: [ 2028.923668] mmc0: card lacks mandatory switch function, performance might suffer
Jan  4 22:41:42 matrix kernel: [ 2028.923685] mmc0: new SD card at address aaaa
Jan  4 22:41:42 matrix kernel: [ 2028.924358] mmcblk0: mmc0:aaaa DSC16 256 MiB (ro)
Jan  4 22:41:42 matrix kernel: [ 2029.006966]  mmcblk0: p1
Jan  4 22:41:42 matrix kernel: [ 2029.006980] mmcblk0: p1 size 31108096 extends beyond EOD, truncated
Jan  4 22:41:43 matrix kernel: [ 2029.611115] print_req_error: I/O error, dev mmcblk0, sector 524672
Jan  4 22:41:43 matrix kernel: [ 2029.746877] print_req_error: I/O error, dev mmcblk0, sector 524673
Jan  4 22:41:43 matrix kernel: [ 2029.882571] print_req_error: I/O error, dev mmcblk0, sector 524674
Jan  4 22:41:43 matrix kernel: [ 2030.017980] print_req_error: I/O error, dev mmcblk0, sector 524675
Jan  4 22:41:43 matrix kernel: [ 2030.153261] print_req_error: I/O error, dev mmcblk0, sector 524676
Jan  4 22:41:44 matrix kernel: [ 2030.288366] print_req_error: I/O error, dev mmcblk0, sector 524677
Jan  4 22:41:44 matrix kernel: [ 2030.424021] print_req_error: I/O error, dev mmcblk0, sector 524678
Jan  4 22:41:44 matrix kernel: [ 2030.559682] print_req_error: I/O error, dev mmcblk0, sector 524679
Jan  4 22:41:44 matrix kernel: [ 2030.966821] print_req_error: I/O error, dev mmcblk0, sector 524672
Jan  4 22:41:44 matrix kernel: [ 2031.101915] print_req_error: I/O error, dev mmcblk0, sector 524673
Jan  4 22:41:45 matrix kernel: [ 2031.913602] Buffer I/O error on dev mmcblk0, logical block 65584, async page read
Jan  4 22:41:48 matrix kernel: [ 2034.631681] print_req_error: 21 callbacks suppressed
Jan  4 22:41:48 matrix kernel: [ 2034.631686] print_req_error: I/O error, dev mmcblk0, sector 524679
Jan  4 22:41:48 matrix kernel: [ 2034.631701] Buffer I/O error on dev mmcblk0p1, logical block 64560, async page read

这是 lspci -v 的输出,更具体地说,是 SD 卡读卡器的输出:

02:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01) (prog-if 01)
    Subsystem: Lenovo SD/MMC Card Reader Controller
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at e1301000 (32-bit, non-prefetchable) [size=4K]
    Memory at e1300000 (32-bit, non-prefetchable) [size=2K]
    Capabilities: <access denied>
    Kernel driver in use: sdhci-pci
    Kernel modules: sdhci_pci

lsmod 的输出 | grep MMC

mmc_block              45056  0
mmc_core              172032  4 sdhci,cqhci,mmc_block,sdhci_pci

与 mmc 相关的 dmesg 启动输出:

[    1.271406] mmc0: Unknown controller version (3). You may experience problems.
[    1.271639] mmc0: SDHCI controller on PCI [0000:02:00.0] using ADMA

这是我的内核:

Linux matrix 4.18.0-kali2-amd64 #1 SMP Debian 4.18.10-2kali1 (2018-10-09) x86_64 GNU/Linux

我已经尝试过的事情:

  • 使用 modprobe 禁用和启用 sdhci
  • 更改 shdci_pci 的 debug_quirk 值(选项 sdhci debug_quirks=0x40)

相关内容