#
✕ nick:sven
#asahi-dev · 2023-01-24 22:27
sven just realized the weird crashlog address translation is essentially segment-ranges
#asahi-dev · 2023-01-24 19:11
svenno idea how 010009c00 turns into 501089c00
#asahi-dev · 2023-01-24 19:11
svenand then macos replies with [cpu4] [M3Tracer@/arm-io/acio-cpu1] SEND: 0010400501089c00:0000000000000001 | EP=0x1
#asahi-dev · 2023-01-24 19:11
sventhe setbuffer requests are also strange. for the crashlog e.g. it asks [cpu4] [M3Tracer@/arm-io/acio-cpu1] RECV: 0010400010009c00:0020350000000001 | OUTCNT=0x2, INCNT=0x0, OUTPTR=0x3, INPTR=0x5, EP=0x1
#asahi-dev · 2023-01-24 19:10
sven(e.g. assert_id=1271)
#asahi-dev · 2023-01-24 19:09
svenoh this is just great, acio seems to put its crashlog into MMIO somewhere like SMC. the only message I get when it dies is four digits assert number that was triggered :/
#asahi-dev · 2023-01-24 18:24
svenI don’t remember looking at „dp-switch“
#asahi-dev · 2023-01-24 18:24
sveniirc the ufp/dfp endpoints are just the dcpext and the atcphys
#asahi-dev · 2023-01-24 16:13
svenalso, turns out that locking the thunderbolt mutex when calling deep into the thunderbolt subsystem is a very good idea🙃
#asahi-dev · 2023-01-24 16:06
svenugh.. let's hope it at least doesn't require that DPTX dance
#asahi-dev · 2023-01-24 12:30
svenif I add a msleep(1000) before telling the NHI about the new cable it seems reliable now. I bet this just needs to be synchronized against something in atcphy
#asahi-dev · 2023-01-24 12:30
svenwell... looks like the unreliability is just some kind of race
#asahi-dev · 2023-01-24 10:24
svenjust how many machines do you have at this point? :D
#asahi-dev · 2023-01-24 08:57
sven+on macOS
#asahi-dev · 2023-01-24 08:57
sventhis adapter switch also increases the probe time to something like 20-30seconds from maybe 5 seconds so there's clearly something that's very broken
#asahi-dev · 2023-01-24 08:57
svenyup
#asahi-dev · 2023-01-24 08:56
svenI still have hope that this adapter switch thing is just something dumb I do ;)
#asahi-dev · 2023-01-24 08:56
sven:D
#asahi-dev · 2023-01-24 08:55
svenyup. the biggest mystery is why switching between my apple and startech adapter breaks the TB NHI (and/or figure out a way to just completely reset that NHI). once that's done there's really just busywork left
#asahi-dev · 2023-01-24 08:52
svenmaybe there's a way to get it to somehow use the normal pciehp but that's something for the pci mailing list once I'm happy with the rest
#asahi-dev · 2023-01-24 08:51
svenyeah :/
#asahi-dev · 2023-01-24 08:47
svennope, doesn't work because the root port claims that it doesn't support hotplug
#asahi-dev · 2023-01-24 08:39
svenbut I at least need to reset the tunnel on link down/tunnel error
#asahi-dev · 2023-01-24 08:39
svenmaybe I can remove the open-coded hotplug from apple-pcie now that I compiled it with pcie hotplug support, let me try that
#asahi-dev · 2023-01-24 08:36
svenit's just anything below the root ports that uses the normal pcie hotplug
#asahi-dev · 2023-01-24 08:36
sveni have to do the hotplug for the root ports manually anyway
#asahi-dev · 2023-01-24 07:54
svenmaybe I should've compiled the kernel with pcie hotplug support if I wanted pcie hotplug for that chained adapter to work :D
#asahi-dev · 2023-01-23 20:05
svenhotplug takes like 5 seconds or so when using the same one but can easily take 20-30 seconds when switching between apple and startech
#asahi-dev · 2023-01-23 20:05
svenhm, switching between adapter also does something weird on macOS
#asahi-dev · 2023-01-23 17:14
svenoh, yeah, that would make sense
#asahi-dev · 2023-01-23 17:14
svenand then everything goes horribly wrong when I disconnect it again because the pcie side seems to think it’s still there
#asahi-dev · 2023-01-23 17:13
sventhe thunderbolt NHI part seems to do the correct things and a manual rescan actually find the chained adapter then
#asahi-dev · 2023-01-23 17:03
sventhat also doesn’t seem to work on my other Linux machine though :D
#asahi-dev · 2023-01-23 16:49
svenugh.. connecting the ethernet adapter to the tbt out port of the thunderbolt display doesn't work though because I don't get a link up interrupt in that case
#asahi-dev · 2023-01-23 16:44
svenalright, this seems fairly stable now if I reconnect the same adapter again and again. something breaks the NHI though if I try to first connect my startech adapter and then switch to the apple one or vice versa
#asahi-dev · 2023-01-23 16:16
svenyup, that was the issue
#asahi-dev · 2023-01-23 15:53
svenand then it overwrite the group data and apple_dart_release_group isn't able to remove the old entries anymore
#asahi-dev · 2023-01-23 15:52
svenyeah, pci_device_group can return a group that already exists but the dart code assumes it's always a new group
#asahi-dev · 2023-01-23 15:51
sven*merge devices
#asahi-dev · 2023-01-23 15:51
svenOHHH.... i think I know what's wrong. pci_device_group can merge groups even when they're supposed to be separate according to iommu-map I think
#asahi-dev · 2023-01-23 15:46
svenbut there's something going wrong somewhere :/
#asahi-dev · 2023-01-23 15:46
svenapple_dart_release_group is called automatically when no more devices are in a group and removes entries from sid2group under a lock. that should all happen automatically
#asahi-dev · 2023-01-23 15:42
svensomehow a stale group ends up in sid2group in the dart driver and then faults in apple_dart_device_group
#asahi-dev · 2023-01-23 15:40
svenalright, rescanning now finally works automatically from the interrupt. looks like there's something weird with the iommu groups though
#asahi-dev · 2023-01-22 22:15
sven:)
#asahi-dev · 2023-01-22 22:13
svenyeah, that’s what I assume happens. but if we just go with mapping each bus to a separate sid it’ll just work without quirks
#asahi-dev · 2023-01-22 22:02
svenand that worked here. so I bet all functions just need to go to the same stream
#asahi-dev · 2023-01-22 22:02
svenohh... the PI7C9X442SL workaround makes sense I think. it's the controller in the old apple thunderbolt displays (like mine) and that one exposes three different pci functions
#asahi-dev · 2023-01-22 21:59
svenand then there's a marvel-wa-viddids field in the ADT to select some devices that also get a special treatment
#asahi-dev · 2023-01-22 21:59
sven"PI7C9X442SL USB OHCI" is always forced to sid 0

plus ›