Bug 238585 - Intel Bay Trail/Braswell eMMC timeouts
Summary: Intel Bay Trail/Braswell eMMC timeouts
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-15 17:33 UTC by paul.le.gauret
Modified: 2019-07-20 12:24 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paul.le.gauret 2019-06-15 17:33:57 UTC
Running latest FreeBSD 12.0-RELEASE on an "Atomic Pi" board (Atom x5-Z8350 based). System is installed on the internal eMMC, filesystem is ZFS.

Every once in a while (sometimes hours, sometimes days) the system freezes with no emmc disk IO possible. The system log shows the following happening.

Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: mmcsd0: Got AutoCMD12 error 0x0001, but there is no active command.
Jun 11 05:27:11 atomicbsd kernel: Issuing erase command failed Timeout
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: ============== REGISTER DUMP ==============
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Sys addr: 0x035e3000 | Version:  0x00001002
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Blk size: 0x00000200 | Blk cnt:  0x00000000
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Argument: 0x00000001 | Trn mode: 0x00000027
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Present:  0x1fef0000 | Host ctl: 0x00000025
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Power:    0x0000000b | Blk gap:  0x00000080
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Wake-up:  0x00000000 | Clock:    0x00000007
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Timeout:  0x00000007 | Int stat: 0x00000000
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Int enab: 0x05ff003b | Sig enab: 0x05ff0033
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: AC12 err: 0x00000000 | Host ctl2:0x0000008b
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Caps:     0x446cc8b2 | Caps2:    0x00000807
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: Max curr: 0x00000000 | ADMA err: 0x00000000
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
Jun 11 05:27:11 atomicbsd kernel: sdhci_acpi0-slot0: ===========================================
Jun 11 05:27:11 atomicbsd kernel: mmcsd0: Error indicated: 1 Timeout
Jun 11 05:27:11 atomicbsd kernel: mmcsd0: Setting erase start position failed Timeout
Jun 11 05:27:11 atomicbsd syslogd: last message repeated 3 times

The issue always happens when issuing the erase command. 

For reference, relevant messages from system boot related to sdhci and emmc:

sdhci_acpi0: <Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller> iomem 0x89533000-0x89533fff irq 45 on acpi0
mmc0: <MMC/SD bus> on sdhci_acpi0
mmcsd0: 16GB <MMCHC M52516 5.1 SN 12D1DA7A MFG 10/2016 by 112 0x0000> at mmc0 50.0MHz/8bit/65535-block
mmcsd0boot0: 4MB partion 1 at mmcsd0
mmcsd0boot1: 4MB partion 2 at mmcsd0
mmcsd0rpmb: 4MB partion 3 at mmcsd0

Once this happens only a reboot re-enables emmc disk IO. 

I've tried to enable a few quirks based on the indications in bug 228340 without success.

Not sure of what to try next, besides installing another OS to rule-out a hardware error. 

Any ideas on how to troubleshoot this would be greatly appreciated.
Comment 1 paul.le.gauret 2019-07-20 12:24:15 UTC
For the record the issue can be solved by disabling TRIM. In /boot/loader.conf add "vfs.zfs.trim.enabled=0"

Still leaving the bug open as I believe this should not happen.