2022-12-12
00:07amarioguy has joined #asahi-dev
00:11jannaumarcan: https://github.com/AsahiLinux/linux/pull/78 with t8112 cache info and dart rename is open as well
00:16marcanin s2idle there aren't "wakeup sources" per se, what there are is IRQs marked IRQF_NO_SUSPEND
00:16marcanwhich means those IRQs will not be masked in s2idle, then the drivers are free to do whatever they want with them
00:16marcanthe pin controller should have that set for its parent IRQ and then the downstream SPI driver should set it for its GPIO IRQ
00:17marcanremember in s2idle the kernel is just running normally, it's just that by default all IRQs are masked
00:17marcanwe unconditionally unmask mailbox IRQs in suspend under the assumption that rtkit drivers will suspend themselves anyway (except SMC which needs to stay alive)
00:21jannauah, so the dead code in spihid makes not much sense for s2idle. I'd assumed s2idle could use the same suspend path
00:25jannaumacos powers dcp completely down for DPMS (t8103 with internal displays), I've not yet checked j314 or mac mini/studio
00:48marcanhttps://www.reddit.com/r/AsahiLinux/comments/zjapki/asahi_installation_disk_resize_error/
01:03TellowKrinkle"The YouTube tutorial said to do this. When I did it, it didn't do this. It must be broken."
01:06sam___ has quit [Remote host closed the connection]
01:17zalyx has quit [Quit: later alligator]
01:19zalyx has joined #asahi-dev
01:42user982492 has joined #asahi-dev
01:44user982492 has quit []
01:45user982492 has joined #asahi-dev
01:56marcanrebased on 6.1 final and merged jannau's stuff. only compiled tested, will play around with suspend later today
02:00user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:02jbowen_ has quit []
02:03jbowen has joined #asahi-dev
02:04user982492 has joined #asahi-dev
03:16opticron_ is now known as opticron
04:04renatorabelo has quit [Quit: Leaving]
04:08renatorabelo has joined #asahi-dev
05:53user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:28cyrozapmarcan, sven: Heads-up, there's an issue with ASMedia's USB host controllers where if you try reading from multiple USB devices simultaneously that are connected to the same ASMedia host controller (doesn't matter whether it's through a hub or they're plugged directly into the HC's USB ports), the host controller will attempt a DMA write to an address it doesn't have permission to access. I can easily
06:28cyrozapreproduce the error on POWER9 systems, which have a very strict IOMMU, so I was curious if the same issue affects Apple Silicon systems, which I assume also have a strict IOMMU. Even if the platform doesn't support any kind of capability like EEH (Enhanced Error Handling), where the IOMMU reports misbehaving devices to the OS, it would be interesting to see if any data gets lost or memory corruption
06:29cyrozapI first wrote about this issue a couple of years ago, but have yet to discover exactly what's going wrong, and where. You can find the original thread where I discussed it here: https://lore.kernel.org/all/CAO3ALPyB1JDvvC27JGgAoTuHh0w+897tPhmTKX9PQWBFCrrnbQ@mail.gmail.com/
07:01mini0n has quit [Read error: Connection reset by peer]
07:03marcancyrozap: we have a strict IOMMU and haven't seen such issues yet (maybe it doesn't apply to our firmware? I can't imagine Apple shipping broken USB controllers... wait, I can >_>)
07:15marcancyrozap: I saw the zero addr quirk thing. for us, we do get full proper fault addresses, so iff we can reproduce the same problem we might be able to shed light on it
07:30cylm has joined #asahi-dev
07:35amarioguy has quit [Ping timeout: 480 seconds]
07:35amarioguy has joined #asahi-dev
07:37renato__ has joined #asahi-dev
07:44renatorabelo has quit [Ping timeout: 480 seconds]
07:47renato__ has quit [Ping timeout: 480 seconds]
08:10SSJ_GZ has joined #asahi-dev
08:25ChaosPrincessmarcan: mind cherry-picking c5895db and 3e14469 from https://github.com/WhatAmISupposedToPutHere/linux/commits/spi-nor ? Those add the binding for the nvram, so you can have a linux equivalent of `bless`
09:38mkurz has quit [Ping timeout: 480 seconds]
09:40bcrumb has joined #asahi-dev
09:59mkurz has joined #asahi-dev
10:05mkurz has quit [Remote host closed the connection]
10:05mkurz has joined #asahi-dev
10:08mkurz has quit []
10:09mkurz has joined #asahi-dev
10:10mkurz has quit []
10:10mkurz has joined #asahi-dev
10:10MajorBiscuit has joined #asahi-dev
10:11mkurz has quit []
10:11mkurz has joined #asahi-dev
11:14mkurz has quit [Read error: Connection reset by peer]
11:21mkurz has joined #asahi-dev
11:29mkurz has quit [Remote host closed the connection]
11:33mkurz has joined #asahi-dev
11:34Mary has quit [Quit: The Lounge - https://thelounge.chat]
11:34heyuan has joined #asahi-dev
11:34Mary has joined #asahi-dev
11:43heyuan has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.2)]
11:45tobhe_ is now known as tobhe
12:20bcrumb has quit [Quit: WeeChat 3.7.1]
13:01Mary has quit [Quit: The Lounge - https://thelounge.chat]
13:06Mary has joined #asahi-dev
13:08jluthra has quit [Remote host closed the connection]
13:08jluthra has joined #asahi-dev
13:10Dementor has quit [Ping timeout: 480 seconds]
14:37mkurz has quit [Read error: Connection reset by peer]
14:53mkurz has joined #asahi-dev
16:07psykose has quit [Remote host closed the connection]
16:08psykose has joined #asahi-dev
16:23gladiac has joined #asahi-dev
16:29user982492 has joined #asahi-dev
16:42bcrumb has joined #asahi-dev
16:43bcrumb has quit []
16:43bcrumb has joined #asahi-dev
16:44ncopa has joined #asahi-dev
16:51ncopa> If you are a developer for a distribution and interested in officially supporting Apple Silicon machines, please get in touch!
16:57ncopa"If you are a developer for a distribution and interested in officially supporting Apple Silicon machines, please get in touch! We’d love to work with you to make it happen." https://asahilinux.org/2022/03/asahi-linux-alpha-release/#can-i-install-other-distros
16:58bcrumb has quit [Quit: WeeChat 3.7.1]
16:58bcrumb has joined #asahi-dev
16:58bcrumb has quit []
17:13bcrumb has joined #asahi-dev
17:18mofux has joined #asahi-dev
17:33gladiac has quit [Quit: k thx bye]
17:36mofux has quit [Remote host closed the connection]
17:39mofux has joined #asahi-dev
17:43user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:45MajorBiscuit has quit [Ping timeout: 480 seconds]
17:45mkurz has quit [Read error: Connection reset by peer]
17:47mofux has quit [Ping timeout: 480 seconds]
17:51Dementor has joined #asahi-dev
17:51mkurz has joined #asahi-dev
19:21cyrozapmarcan: Firmware version shouldn't matter--I've seen the issue with every ASMedia USB host controller I've tested, from the original ASM1042 through the ASM3142 (it seems I haven't tried the ASM3242 yet). But I'll load the Apple ASM3142 firmware on an ASM3142 card I have here and see if I can trigger the fault, just to be sure. The most reliable way I've found to trigger it is to plug in two USB NVMe
19:21cyrozapdrives into the same host controller, then start two reads from them (`sudo dd if=/dev/sdN of=/dev/null bs=1G iflag=direct status=progress`) as simultaneously as possible. Doing this triggers the issue almost immediately. It also works with USB hard drives, though it may trigger slightly less than immediately.
19:33renato__ has joined #asahi-dev
19:35cyrozapI'm not sure if there's a way to enable tracing the DMA buffers (or whatever they're called) allocated by the xHCI driver, but assuming you can successfully trigger the fault, it would be helpful to know what buffer is being overrun (assuming that's what the issue is and the xHC isn't just trying to write to some random address).
19:36renato__ is now known as renatorabelo
19:41cyrozapAnd if you _can't_ trigger the fault, I'll be really interested to know about that, since that would mean that the issue likely has something to do specifically with the POWER9 IOMMU or its kernel driver (though this issue doesn't occur with any of the TI or Fresco Logic USB host controllers I've tried).
19:52zzywysm_cyrozap: there is also the possibility that Apple's hardware qual team found the same bug and made ASMedia fix it for them
19:53beeblebrox has joined #asahi-dev
19:53zzywysm_cyrozap: you may notice that SSDs are far more reliable in Apple hardware than anywhere else, and it's for the same reason
19:58mkurz has quit [Quit: Leaving]
20:00cyrozapzzywysm_: Yeah, that's why I'm testing on my ASM3142 card the firmware that Apple ships--I want to see if Apple had them fix the issue in firmware.
20:12svenif this can be reproduced on macOS I’m pretty sure apple will make then fix it (assuming they haven’t already)
20:29bcrumb has quit [Quit: WeeChat 3.7.1]
20:32cylm has quit [Ping timeout: 480 seconds]
20:49cyrozapI've confirmed that the issue still exists even when running the firmware Apple ships. Tested with Linux 6.0.11 on POWER9.
21:01cyrozapIt'll be interesting to see if this issue happens on Apple hardware, and whether it happens in just Linux or in macOS, too.
21:02jannaucyrozap: seems to work here without issues, both SSDs copied 70GB with 226MB/s (mac studio, linux 6.1-rc8 + asahi)
21:06kettenis has quit [Remote host closed the connection]
21:06kettenis has joined #asahi-dev
21:26cyrozapjannau: Interesting... Would you mind running `dd if=/usr/lib/firmware/asmedia/asm2214a-apple.bin bs=1 skip=128 count=6 2>/dev/null | xxd -ps`? That will print the version of the firmware you have installed.
21:28jannaucyrozap: fw version is 191118701108, both SSDs (500G / 256G) now completely read without issue
21:36cyrozapjannau: Thanks for your help! It's especially interesting to see that you're running a slightly older version than what I have (191118_70_11_08 vs. 191118_70_11_11), and yet haven't encountered the issue. Meanwhile, I've uploaded a much more recent firmware (210330_70_02_40) to my ASM3142 card and haven't been able to trigger the fault yet.
21:49renatorabelo has quit [Ping timeout: 480 seconds]
21:52renatorabelo has joined #asahi-dev
21:53cyrozapI was using the one from macOS 13.0, but I don't think the slight version difference should matter that much since I know the fault can be triggered on even older versions.
22:12cyrozapI just managed to trigger the fault on firmware version 210330_70_02_40. When I tried earlier, I was using a cheap USB 3 thumb drive (64 GB, 100 MB/s max read speed) and a Crucial P5 250 GB SSD in a SuperSpeed Plus Gen 2x1 enclosure. This time, instead of the cheap USB drive, I used a Crucial P5 Plus 2 TB SSD in a SuperSpeed Plus Gen 2x1 enclosure, so now both SSDs plugged into the card support 10 Gbps
22:12cyrozapUSB. This shouldn't be necessary, since I've been able to trigger the fault with mechanical hard drives on 5 Gbps USB, but maybe it's the fact that, even with the newer firmware, the USB link is now getting saturated (I saw ~973 MB/s on the P5 Plus drive before the system detected the bad write).
23:20SSJ_GZ has quit [Ping timeout: 480 seconds]