AsahiLinux / linux

Linux kernel source tree
Other
2.16k stars 85 forks source link

xHCI host not responding #283

Closed wardensfx closed 2 months ago

wardensfx commented 3 months ago

Hi,

I'm facing a problem with my two disks (1HDD /dev/sda & 1SSD /dev/sdb) attached to my asahi server (Mac mini m2 2023). I noticed that after a few moment of working (maybe an hour) my drives popped out and I had to reboot completly to reuse them again.

It happens everytime the server is up at somepoint, and maybe an app fail something, but it should not make the fs nor the disk crash :/ I checked the log and asked Copilot for help. It thinks that it might be a driver issue, that's why I ask for help here, but please tell me if I'm wrong and it has nothing to do with Asahi.

Here are the logs, thanks in advance

journalctl --no-tail --boot=0 --priority=warning :

Mar 25 10:30:55 asahi kernel: apple-dart 682008000.iommu: translation fault: status:0x80100004 stream:1 code:0x4 (NO PMD FOR IOVA) at 0x70
Mar 25 10:31:00 asahi kernel: xhci_hcd 0000:02:00.0: xHCI host not responding to stop endpoint command
Mar 25 10:31:00 asahi kernel: xhci_hcd 0000:02:00.0: xHCI host controller not responding, assume dead
Mar 25 10:31:00 asahi kernel: xhci_hcd 0000:02:00.0: HC died; cleaning up
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 27943536 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: scsi host1: uas_eh_device_reset_handler FAILED to get lock err -19
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 155395912 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 155396936 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 146366600 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 146361480 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 146362504 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 146363528 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 146364552 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 146365576 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:00 asahi kernel: I/O error, dev sda, sector 144990464 op 0x0:(READ) flags 0x84700 phys_seg 32 prio class 2
Mar 25 10:31:01 asahi kernel: BTRFS: error (device sda1) in btrfs_commit_transaction:2511: errno=-5 IO failure (Error while writing out transaction)
Mar 25 10:31:01 asahi kernel: BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 0, flush 0, corrupt 0, gen 0
Mar 25 10:31:01 asahi kernel: BTRFS error (device sda1: state E): bdev /dev/sda1 errs: wr 2, rd 0, flush 0, corrupt 0, gen 0
Mar 25 10:31:01 asahi kernel: BTRFS error (device sda1: state E): bdev /dev/sda1 errs: wr 3, rd 0, flush 0, corrupt 0, gen 0
Mar 25 10:31:01 asahi kernel: BTRFS warning (device sda1: state E): Skipping commit of aborted transaction.
Mar 25 10:31:01 asahi kernel: BTRFS error (device sda1: state E): bdev /dev/sda1 errs: wr 4, rd 0, flush 0, corrupt 0, gen 0
Mar 25 10:31:01 asahi kernel: BTRFS error (device sda1: state EA): Transaction aborted (error -5)
Mar 25 10:31:01 asahi kernel: BTRFS error (device sda1: state EA): bdev /dev/sda1 errs: wr 5, rd 0, flush 0, corrupt 0, gen 0
Mar 25 10:31:01 asahi kernel: BTRFS: error (device sda1: state EA) in cleanup_transaction:2005: errno=-5 IO failure
Mar 25 10:31:01 asahi kernel: xhci_hcd 0000:02:00.0: WARN Can't disable streams for endpoint 0x81, streams are being disabled already
Mar 25 10:31:31 asahi kernel: BTRFS error (device sda1: state EA): bdev /dev/sda1 errs: wr 6, rd 0, flush 0, corrupt 0, gen 0
Mar 25 10:33:33 asahi kernel: BTRFS error (device sdb1): bdev /dev/sdb1 errs: wr 1, rd 0, flush 0, corrupt 0, gen 0
Mar 25 10:33:33 asahi kernel: BTRFS error (device sdb1): bdev /dev/sdb1 errs: wr 2, rd 0, flush 0, corrupt 0, gen 0
jannau commented 3 months ago

@marcan was seeing this on a Mac mini used as file server as well. It is likely a bug in the USB dwc3 driver or an issue with the iommu setup / driver. Using the USB-A ports (if possible) could be a workaround. Those are not directly implemented through the SoC but use an Asmedia PCIe USB xhci controller.

wardensfx commented 3 months ago

Unfortunately for me, both of the disks are plugged through the only 2 usb type A of the mac mini :c Both of the usb-c ports are left empty

Is there any workaround ?

wardensfx commented 2 months ago

Changing the btrfs options while mounting the partitions seems to solve the problem