ChanServ changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | Non-development talk: #asahi | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
kesslerd has quit [Remote host closed the connection]
pthariensflame has joined #asahi-dev
kesslerd has joined #asahi-dev
pthariensflame has quit []
opticron has quit [Ping timeout: 480 seconds]
opticron has joined #asahi-dev
zef has joined #asahi-dev
zef_ has quit [Ping timeout: 480 seconds]
roxfan has joined #asahi-dev
roxfan2 has quit [Ping timeout: 480 seconds]
djorz has quit [Ping timeout: 480 seconds]
pbsds has quit [Ping timeout: 480 seconds]
DarkShadow4444 has joined #asahi-dev
DarkShadow44 has quit [Ping timeout: 480 seconds]
pbsds has joined #asahi-dev
seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
seeeath has joined #asahi-dev
seeeath has quit [Read error: Connection reset by peer]
gladiac has joined #asahi-dev
jeffmiw has quit [Ping timeout: 480 seconds]
tom-w has joined #asahi-dev
Dementor has quit [Read error: Connection reset by peer]
Dementor has joined #asahi-dev
pjakobsson has joined #asahi-dev
apalos has joined #asahi-dev
MajorBiscuit has joined #asahi-dev
kesslerd has quit [Remote host closed the connection]
kesslerd has joined #asahi-dev
MajorBiscuit has quit [Quit: WeeChat 3.6]
tobhe_ has quit [Quit: leaving]
tobhe has joined #asahi-dev
gladiac has quit [Quit: k thx bye]
bisko has joined #asahi-dev
chadmed has quit [Remote host closed the connection]
chadmed has joined #asahi-dev
kesslerd has quit [Quit: Leaving]
kesslerd has joined #asahi-dev
apalos has quit [Quit: ZNC 1.7.2 - https://znc.in]
apalos has joined #asahi-dev
hightower2 has quit [Ping timeout: 480 seconds]
apalos has quit [Quit: ZNC 1.7.2 - https://znc.in]
apalos has joined #asahi-dev
<jannau> sven: tb seems to work for the most part. connected to the thunderbolt4 hub (goshen ridge) with i225 pcie ethernet and alpine ridge nvme case (directly and through a downstream port on the hub)
<jannau> I can't get the nvme to work however
<sven> hmm… nvme should just be tunneled pcie as well
<sven> i also can’t get my usb4 hub (goshen ridge) to work twice without manually doing a full pcie reset inbetween
<jannau> the device is visible in lspci and the kernel detects a nvme device but it ends with
<jannau> nvme 0000:03:00.0: enabling device (0000 -> 0002)
<sven> uh. that sounds like it should work :/
<sven> maybe enable nvme debug as well? but I’d expect to see an error
<jannau> there is however no nvme block device
<jannau> yes, I think replugging the hub requires a reset and sometimes results in the M3 failed to boot
<sven> I haven't seen the M3 boot failure ever :/
<sven> and I have a rather ugly hack locally that performs a PMGR pcie reset every time the tunnel is brought down
<sven> that at least fixes the hub being recognized more than once
<sven> also needs resets = <&ps_atc1_pcie>; in the DT
<jannau> we also have to fix bolt on asahi linux (or there's a problem with my kernel config). it doesn't display the host controller. boltd log shows some dmidecode errors. sounds like it might need to learn that thunderbolt is not x86/acpi specific
<sven> fun
<sven> hotplug into the hub is also kinda sketchy. i'm not sure if that's a general PCI hotplug issue or something I messed up in pcie-apple though
hightower2 has joined #asahi-dev
<jannau> I suspect the M3 boot failure happens when disconnecting the cable at the wrong time
<jannau> s/when/after/
<sven> hm.. wouldn't surprise me
<sven> i need to improve the error handling there anyway
<sven> right now it probably gets stuck in a broken state when anything goes wrong
<sven> jannau: briefly looked into bolt, it seems to also assume that the NHI is a PCI device afaict
<jannau> I assumed it shows the host controller for since you asked for `boltctl list -a`
<sven> huh, boltctl list -a should show the host
<sven> at least it used to
<jannau> it does so on my thinkpad but not on the mac mini
<sven> hrm, maybe I broke that somehow :/
<sven> OHHH....
<sven> i know what happened I think
<sven> it's when I moved the nhi to that child device node as a hack
<sven> but that node doesn't contain that "apple,thunderbolt-drom" property
<sven> add a ->parent to the line that defines dev inside tb_drom_copy_property and it'll work again.
<sven> I'll fix that once I clean up that entire hack anyway
<jannau> seems to be only a cosmetical problem anyway
<sven> yeah
<sven> it's mostly related to the awkward child node hack required due to that DART
<sven> maybe something like "apple,usb4-coprocessor" parent node that contains the dart and the "apple,usb4-nhi" node as a child with the actual regs, interrupts, etc. assigned to the child works better
<sven> +a
veloek has joined #asahi-dev
beeblebrox has joined #asahi-dev
cylm has quit [Ping timeout: 480 seconds]
hightower2 has quit [Ping timeout: 480 seconds]
<jannau> thunderbolt nvme probing fails on "if (readl(dev->bar + NVME_REG_CSTS) == -1) {" in nvme_pci_enable()
<sven> can you check PORT_PREFMEM_ENABLE from the hv?
<sven> maybe that thing was reset again for some reason
Dementor2 has joined #asahi-dev
Dementor has quit [Ping timeout: 480 seconds]
Dementor2 is now known as Dementor
<jannau> seems to be 0. should I be able to write to it from the hv? writes don't seem to stick
<sven> hmmm… maybe you can’t read it back
<sven> maybe trt writing 1 and then rescanning the nvme device
<jannau> no change
<sven> can you check the bar from the hv?
<sven> does it only read back as -1?
<sven> and can you also show lspci -vv?
<sven> Region 0: Memory at 600100000 (64-bit, non-prefetchable) [size=16K]
<sven> hrm, that should work anyway
<jannau> how do I check the bar from the HV?
<sven> read from 0x600100000 :D
<jannau> that doesn't work at all
<sven> huh
<sven> oh.. maybe because the device is disabled :/
<jannau> appears so, I can read from enabled pcie usb hcd but not from the disbaled wlan adapter
<sven> and I guess that nvme device works on other Linux machines and on macOS
<jannau> yes
<sven> strange. it sounds like its BAR always returns -1 which should only happen if the device isn’t connected or in a low power state
bisko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jannau> intel nvme works: "Timing buffered disk reads: 4300 MB in 3.00 seconds = 1432.78 MB/sec"
<sven> is that fast enough?
<sven> 40 gbps should be faster, shouldn't it?
<sven> (even accounting for overhead)
<jannau> probably: "pci 0000:03:00.0: 8.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x4 link at 0000:01:00.0 (capable of 31.504 Gb/s with 8.0 GT/s PCIe x4 link)"
<jannau> i.e. it's only using PCIe1 x4
<jannau> err probably not
<jannau> it's faster than the same ssd with a 10 gbps usb3 link though
<sven> can you test it with another host?
<sven> id really like to know if lane bonding and 20gbps/lane just works
<jannau> it's faster than on my intel thinkpad with Alpine Ridge tbt controller: 1070 MB/sec
<jannau> dd reports just 1.2 GB/s (intel) instead of 1.5 GB/s (mac) with a block size of 8M
<jannau> same PCIe bandwidth message
<sven> nice :D
<jannau> samsung ssd is not faster on the intel system but it should be capable of ~3500 MB/s
<sven> samsung is the one where the BAR reads as -1?
shunsukemie has joined #asahi-dev
<jannau> yes
<sven> hmmmm
shunsukemie has left #asahi-dev [#asahi-dev]
bisko has joined #asahi-dev
shunsuke has joined #asahi-dev
<sven> i guess you could try to trace everything macos does to pcie but that's not much fun
<sven> even less fun is tracing the NHI messages on the rings becase I've been too lazy to write a proper tracer so far
<jannau> the intel ssd should be good for 2000 MB/s. so there might be an issue with the enclosure
bluetail986 has quit []
kesslerd has quit [Remote host closed the connection]
<sven> does hotplug work on your usb4 hub btw?
<sven> because the ports on mine usually seem to miss the hotplug irq
<sven> and sometimes they are delayed by like 10-15 seconds
<sven> uh oh.. and now lockdep just complained about a possible deadlock in pciehp 🙃
<jannau> haven't tried that yet as hotplug is not relieable in general
<sven> ok
<jannau> sometimes it doesn't work at all, sometimes it takes a long time and sometimes it get into hotplug hot-unplug loop
<sven> that's for hotplug at the ports on the usb4 hub, right?
kesslerd has joined #asahi-dev
<sven> the nhi side seems to work rather reliably here
<jannau> no, for hotplug on the mac port
<sven> it's just that pcie side that seems to not get the hotplug irq
<sven> ah, okay
<sven> that's mostly stable for me fwiw
zzywysm has quit [Quit: Textual IRC Client: www.textualapp.com]
<jannau> hotplug on the dock/hub's downstream port appears to be relieable. 10 out of 10 tries
<jannau> also hotplug of the dock worked on on the first try
<jannau> ssd is slower hwen connected through the dock though, 1 GB/s instead of 1.5 GB/s
nela has quit [Ping timeout: 480 seconds]
<sven> huh, weird. hotplug on the hub's downstream port is very unreliable here
<sven> the pcie hotplug driver essentially seems to miss irqs
nela has joined #asahi-dev
<jannau> sysfs reports that the nvme runs with a PCIe v3 x2 link. so 1.5 GB/s seems to be ok/expected
<sven> hrm, if i switch pciehp to polling mode it actually works reliably as well
<sven> so it's really just the irq that somehow gets lost
<jannau> sigh, this seems to be ok as the enclosure is only a 20gbps / x2 thunderbolt 3 device
gladiac has joined #asahi-dev
ah- has quit [Read error: Connection reset by peer]
bisko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bluetail986 has joined #asahi-dev
ah- has joined #asahi-dev
<sven> still can’t reproduce that m3 issue despite trying to remove the cable at various times and/or replugging it very quickly
kesslerd has quit [Remote host closed the connection]
kesslerd has joined #asahi-dev
zzywysm has joined #asahi-dev
<sven> jannau: which usb4 huh do you have?
<sven> *hub
shunsuke has quit [Ping timeout: 480 seconds]
<sven> I assume it’s what I guess is the 1-to-3 goshen ridge reference design?
<jannau> no, I have dock with 1 thunderbolt downstream port: hp thunderbolt dock g4
<jannau> main selling point was the integrated 2.5gbps nic
<sven> ahhh… okay, the downstream port of my caldigit ts3 also works quite well
<sven> it’s just that usb4 hub that has issues
shunsuke has joined #asahi-dev
<jannau> the thunderbolt controller is the same though
<sven> weird
<sven> just pushed that reset hack and slightly better error handling
Esmil_ has quit []
Esmil has joined #asahi-dev
shunsuke has quit [Ping timeout: 480 seconds]
shunsuke has joined #asahi-dev
gladiac is now known as Guest5413
gladiac has joined #asahi-dev
bluetail986 has quit []
bluetail has joined #asahi-dev
Guest5413 has quit [Ping timeout: 480 seconds]
shunsuke has quit [Ping timeout: 480 seconds]
shunsuke has joined #asahi-dev
shunsuke has quit [Ping timeout: 480 seconds]
<sven> lol, caldigit ts3 to owc hub to Apple Thunderbolt Display doesn’t work because the Linux pci code messes up the resource distribution afaict :D
<sven> but it looks like the hotplug interrupts work when the hub isn’t directly connected to the host :/
shunsuke has joined #asahi-dev
nyilas has joined #asahi-dev
shunsuke has quit [Ping timeout: 480 seconds]
<sven> can’t find anything special in the usb4 spec about interrupts either
<sven> i sure hope this is not another weird vendor specific bit that has to be set somewhere
shunsuke has joined #asahi-dev
shunsuke has quit [Ping timeout: 480 seconds]
shunsuke has joined #asahi-dev
<jannau> usb3 ports on my thunderbolt3 (titan ridge) work. do you understand how usb3 tunneling is supposed to work?
<sven> I understand the dwc3 part
<sven> but it doesn’t work currently, if you plug in a usb4 devices that Supports tunneling the nhi code will complain that the tunnel couldn’t be activated
<sven> either because dwc3 is currently in a messed up state or because more vendor specific nhi stuff is missing
shunsuke has quit [Ping timeout: 480 seconds]
<sven> i hope it’s the former because I really don’t want to write a nhi tracer
<jannau> yes, it fails to activate the tunnel. I wasn't 100% certain that tunnel terminates at dwc3
<sven> i'm reasonably sure it's just this here on the dwc3 side: PIPEHANDLER_MUX_CTRL = 0x11 (MUX_MODE=1(DUMMY_PHY), CLK_SELECT=2(DUMMY_PHY))
<sven> (ignore the dummy_phy, that name is wrong)
<jannau> btw, I see for for the root port and the thunderbolt bridges in the dock "BAR 13: no space for [io size 0x1000/0x3000]
<sven> I think that's expected. it comes from some heuristic somewhere that allocates N bytes of io space when a bridge is marked as hotplug capable
gladiac has quit [Quit: k thx bye]
cylm has joined #asahi-dev
shunsuke has joined #asahi-dev
<sven> oh well, just flipping the pipehandler mux to the usb3 tunnel phy isn’t enough to make it work
jeffmiw has joined #asahi-dev
shunsuke has quit [Ping timeout: 480 seconds]
kesslerd has quit [Quit: Leaving]
<jannau> the pcie ethernet adapter is mostly busted. I shouldn't have assumed that it works just because config via dhcp works
djorz has joined #asahi-dev
<sven> hrm, all of my devices work fine fwiw
<sven> those are tg3 ethernet, various xhci controllers, that old ohci/ehci controller pair in the tbt display, some intel(?) Ethernet controller and presumably also that old pcie to FireWire Controller but I don’t have anything to test that
yamii_ has joined #asahi-dev
yamii has quit [Read error: Connection reset by peer]
shunsuke has joined #asahi-dev
shunsuke has quit [Ping timeout: 480 seconds]
kesslerd has joined #asahi-dev
nyilas has quit [Quit: Konversation terminated!]
kesslerd has quit [Remote host closed the connection]
shunsuke has joined #asahi-dev
<jannau> this kind of broken: "408 bytes from 192.169.1.10: icmp_seq=183 ttl=64 time=541905 ms"
kesslerd has joined #asahi-dev
<jannau> not even sure if that is correct, high packet loss, out of order and duplicate replies as well
<sven> huh.. that sounds pretty broken
<sven> I also really wouldn’t expect a Ethernet adapter to do anything weird with pcie :/
hightower2 has joined #asahi-dev
darkapex has quit [Remote host closed the connection]
darkapex has joined #asahi-dev