On Mon, Jan 02, 2023 at 09:56:18AM +0100, Christian Schaubschläger wrote: > Hi, (and happy new year!) > > >> If I just remove the module without un- and re-plugging the cable, the > >> connection is not there in the firmware after the reboot. > > Right because the driver leaves all the tunnels up so the boot firmware > > then finds the PCIe tunnels established. > > So maybe it's a firmware issue? If the kernel leaves the tunnels in > place, but the firmware doesn't see them? It probably sees them and that's the issue. > > One more experiment if you will. > > > > Same steps 1-3 as above but then do this: > > > > 4. Disconnect the PCIe tunnel directly: > > > > # echo 0 > /sys/bus/thunderbolt/devices/DEVICE/authorized > > > > (where DEVICE is typically 0-1 or 0-3 in Intel platforms) > > > > 5. Check in lspci that it is not visible anymore > > 6. Soft boot the system. > > > > In other words this leaves the USB4 link and other tunnels up but not > > PCIe. > After echoing 0 to the 'authorized' file, the devices disappear in > linux from the PCI bus, but unfortunately don't show up in the > firmware after the reboot... Okay it may be that the USB 3 tunnel that is still up makes the CM in BIOS to think the hardware is in unexected state or so. This was Thunderbolt 4 dock, right? Do you happen to have Thunderbolt 3 device or Thunderbolt 3 active cable around? If yes then there is only the PCIe tunnel so doing the above de-authorization should in theory work. If no then one option is to add the ->shutdown() hook to tear down the tunnels.