#
✕ nick:sven
#asahi-dev · 2023-03-01 21:50
svenI have a usb4 hub and connecting two docks to that one already breaks at least one xhci controller on them
#asahi-dev · 2023-03-01 21:50
svensounds like the issues I’m running into
#asahi-dev · 2023-03-01 21:47
svengruetzkopf: yeah, pci hotplug seems to not have gotten a lot of attention. Especially since thunderbolt exists
#asahi-dev · 2023-03-01 20:11
svenhates all of this
#asahi-dev · 2023-03-01 20:11
svenbah. If a pcie bridge is busy rescanning due to a hotplug event while nhi tries to bring up a DP tunnel there’s apparently a small chance that acio crashes
#asahi-dev · 2023-03-01 11:28
sveni haven’t even looked at it in detail yet, just found it when looking for pcie hotplug issues
#asahi-dev · 2023-03-01 11:27
svenmakes sense
#asahi-dev · 2023-03-01 10:32
svenhttps://github.com/YADRO-KNS/linux/commits/yadro/pcie_hotplug/movable_bars_v10.1 and that looks like a much more recent version of that patchset
#asahi-dev · 2023-03-01 10:26
svenI think on most amd/intel machines the BIOS or firmware or whatever runs before linux already sets up everything that's connected at boot time
#asahi-dev · 2023-03-01 10:25
svenunfortunately we have no BIOS or anything like that here so *everything* is hotplug here
#asahi-dev · 2023-03-01 10:24
svenor they just boot with kernel parameters to create extra space when pci distributes resources
#asahi-dev · 2023-03-01 10:24
svenit seems that not many people actually use thunderbolt + long daisy chains + hotplug in linux
#asahi-dev · 2023-03-01 10:17
svenhttps://lore.kernel.org/linux-pci/20201218174011.340514-1-s.miroshnichenko@yadro.com/ ohh.. fancy. i'll have to rebase that and check if that allows me to hotplug rather long thunderbolt daisy chains
#asahi-dev · 2023-02-27 16:51
sventhat’s a first for any of these co-processors I think
#asahi-dev · 2023-02-27 16:51
svenoh, wow, I can apparently completely recover from any acio crashes
#asahi-dev · 2023-02-27 16:16
svenhrm, either I do something wrong when setting up the root port or Linux pci hotplug code hasn’t really been tested with daisy chained thunderbolt devices
#asahi-dev · 2023-02-27 09:45
svenbooting with pcie_port_pm=off makes it reliable
#asahi-dev · 2023-02-27 09:45
svenlol, turns out the hotplug error is just some pcie power management hardware bug
#asahi-dev · 2023-02-27 08:34
svenrowanG337: nice, thanks!
#asahi-dev · 2023-02-26 15:18
svenmaybe also order of dwc3 vs. atcphy operations
#asahi-dev · 2023-02-26 15:17
svenyeah, probably
#asahi-dev · 2023-02-26 15:12
svenI remember seeing the dwc3 reset at each mode change in an older xnu version so they must’ve changed or fixed something I guess
#asahi-dev · 2023-02-26 15:10
svenif this worked we’d only need to reset dwc3 on actual unplug events which would made everything so much easier
#asahi-dev · 2023-02-26 15:09
svenxnu seems to be able to transition the pipehandler state while dwc3 is already up but that doesn’t seem to work inside Linux yet :/
#asahi-dev · 2023-02-26 15:09
svenhates atcphy
#asahi-dev · 2023-02-24 20:14
svenyup. looks like apple treats hotplug on *every* bridge using that OOB notification
#asahi-dev · 2023-02-24 20:13
svenAppleThunderboltPCIUpAdapter<0xfffffe167554b800>::upstreamPCIDeviceNotification 🙃
#asahi-dev · 2023-02-24 19:31
svenim going to be very annoyed if it turns out that all hotplug interrupts are routed to some apple-specific thing in the root port
#asahi-dev · 2023-02-24 19:30
svenwhy does it instead access something in the config space if the root port
#asahi-dev · 2023-02-24 19:30
svenuhhh… why does it not access the config space of the bridge that gets the hotplug
#asahi-dev · 2023-02-24 18:41
svenstill doesn’t explain why it gets hotplug interrupts and I don’t though :(
#asahi-dev · 2023-02-24 18:41
svenlooks like that’s a special power state called kIOPCIDevicePausedState
#asahi-dev · 2023-02-24 18:40
svencute, looks like xnu can freeze all drivers on a pci bus, reassign resources and then thaw everything again. looks it supports my usb4 hub to dock to another dock setup that way
#asahi-dev · 2023-02-24 15:49
svenany idea what that could be? can’t find anything related to USB PD called “CF”
#asahi-dev · 2023-02-24 15:49
svenhrm, there’s a “CF VID” that seems to be somehow related to usb4 mode in the tipd chip
#asahi-dev · 2023-02-24 13:14
svenjust need to figure out why dcpext doesn't like dp-over-tbt tunnels
#asahi-dev · 2023-02-24 13:13
svenis looking forward to a picture of this old thunderbolt display I have connected to my mac mini :>
#asahi-dev · 2023-02-24 13:13
sven*:D
#asahi-dev · 2023-02-24 13:13
sven:S
#asahi-dev · 2023-02-24 13:12
svenpovik: nice!
#asahi-dev · 2023-02-24 13:02
svendepends on your log level I think. I have them all patched to dev_err just for good measure *shrug*
#asahi-dev · 2023-02-24 12:58
svennice, thanks!
#asahi-dev · 2023-02-24 12:56
svenprobably because it can trigger bugs in broken hardware and maybe require a reboot I guess
#asahi-dev · 2023-02-24 12:56
svenrowanG337: oh, also lspci -xxxx would be useful but note that lspci claims that's "(dangerous; root only)"
#asahi-dev · 2023-02-24 12:47
svenI essentially want to compare the path and tunnel creation on a host that's known to work with what my m1 driver does
#asahi-dev · 2023-02-24 12:47
svensure :)
#asahi-dev · 2023-02-24 12:45
svenwhat I'm curious about is the output when booting the machine without the hub connected, then connecting only the hub and then connecting another device after the hub
#asahi-dev · 2023-02-24 12:44
svennot really
#asahi-dev · 2023-02-24 12:44
sventhunderbolt.dyndbg=+p in the boot args maybe
#asahi-dev · 2023-02-24 12:43
svenI think there's a way to use dyndbg to just enable it for thunderbolt as well as long as the kernel is compiled with CONFIG_DYNAMIC_DEBUG

plus ›