12 ms·
Thunderbolt devices appear in the OS as a PCIe switch, so you need two additional bus numbers (one for the Switch Upstream Port and one for the Switch Downstrea
by l1k 4y ago
Thunderbolt devices appear in the OS as a PCIe switch, so you need two additional bus numbers (one for the Switch Upstream Port and one for the Switch Downstream Port). If the device is hotplugged to a port which has run out of bus numbers, you'll get this error message.
Mika Westerberg is constantly fine-tuning the allocation of PCI resources in the Linux kernel to avoid such scenarios. Some recent patches:
https://lore.kernel.org/linux-pci/20220905080232.36087-1-mika.westerberg@linux.intel.com/ https://lore.kernel.org/linux-pci/20220905080232.36087-1-mik...
https://lore.kernel.org/linux-pci/20221130112221.66612-1-mika.westerberg@linux.intel.com/ https://lore.kernel.org/linux-pci/20221130112221.66612-1-mik...
On macOS, it's possible to pause the PCI bus, reallocate resources and unpause the bus:
https://developer.apple.com/library/archive/documentation/HardwareDrivers/Conceptual/ThunderboltDevGuide/Basics02/Basics02.html https://developer.apple.com/library/archive/documentation/Ha... (search for "Supporting PCIe Pause")
We don't have that on Linux unfortunately, so we depend on getting the initial resource allocation right.
Sergei Miroshnichenko has worked on such a reallocation feature for Linux but it hasn't been accepted into mainline yet and he hasn't posted a new version of his patches for almost two years, so the effort seems stalled:
https://lore.kernel.org/linux-pci/20201218174011.340514-1-s.miroshnichenko@yadro.com/ https://lore.kernel.org/linux-pci/20201218174011.340514-1-s....
- nneonneo 4y agoIt sounds like the pause/unpause might be the way to fix this properly, since trying to be heuristically smarter sounds like a recipe for never-ending corner case bugs like the OP’s issue. The patch for pausing and unpausing seems quite reasonable, except that it does require driver support (unsurprising - you’re literally reallocating the resources used by the driver!). I suppose if you had at least a few movable devices then you should be ok in the event of a hotplug event, so you’d have to hope that enough drivers bother to support the feature. I wonder what is necessary to get people to care about the patch enough to fix it up and mainline it? I suppose the problem it fixes is still niche enough that not so many people are clamoring for the fix.
- AnIdiotOnTheNet 4y agoWhat is the point in having all of the drivers be open sourced and mainlined if we're not willing to fix them to support this?
- blueflow 4y ago
- jodrellblank 4y agoYou are free to comment on the question raised, instead of a dismissive empty ad-hom.
- arghwhat 4y agoWhile tongue in cheek, the answer is accurate: open source does not mean "free service contract", it means that you can take the code and modify yourself (and preferably upstream the fix). Patches come both from vendors and users experiencing an issue. Vendors take care of most things, but for esoteric problems you might only have a handful of people experiencing it. The vendor is unlikely to care, so if you do not write the patch or pay someone to do it, who will? Still better than the competition, where such problems will never be fixed unless it generates sufficient bad PR...
- jodrellblank 4y agoYou're doing the same thing, dragging the original conversation off into berating the commentor for not fixing it themselves because you owe them nothing and they shouldn't be so entitled. > "Still better than the competition, where such problems will never be fixed unless it generates sufficient bad PR..." The competition comes under "pay someone else to do it".
- elsjaako 4y agoWhat OS are you using where you can get the vendor to implement kernel features to fix obscure driver issues? I'm sure there's an amount of money you can throw at Microsoft to get something done. I don't know how much it is, but I'm guessing it's more than it would cost to find a vendor to do it for Linux. The serious answer to " What is the point in having all of the drivers be open sourced and mainlined if we're not willing to fix them to support this?" is "There are many points to this, but one of them is that it's possible to fix them to support it, if someone wants to put in the effort. It's worth something that it's theoretically possible if you really need it, even if no one else has done it yet.". The answer "You can do it yourself" is meant to help them understand "Anyone can do it, someone needs to step up to the plate. But it's also true that it costs resources. If you're wondering why no one else has done it yet, it's the same reason you haven't done it yet".
- mrb 4y agoThe key takeaway, especially for the author who wants things to "just work", is that he should have used a USB external disk, instead of a Thunderbolt external disk. OSes tend to have more issues with Thunderbolt disks (such as this issue you explained in details) than with USB disks, because the latter is more common, so more corner case bugs have been eliminated.
- bhewes 4y agoYeah, first thing I thought was oh that drive looks esoteric.
- fabiensanglard 4y agoAny book or documentation you recommend to read to someone interested in getting involved?