On Fri, Feb 11, 2022 at 01:32:41PM -0600, Mario Limonciello wrote:
`pci_bridge_d3_possible` currently checks explicitly for a Thunderbolt controller to indicate that D3 is possible. As this is used solely for older Apple systems, move it into a quirk that enumerates across all Intel TBT controllers.
I'm not so sure if it is only needed on Apple systems.
@@ -2954,10 +2960,6 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge) if (pci_bridge_d3_force) return true;
/* Even the oldest 2010 Thunderbolt controller supports D3. */
if (bridge->is_thunderbolt)
return true;
- /* Platform might know better if the bridge supports D3 */ if (platform_pci_bridge_d3(bridge)) return true;
The fact that Thunderbolt PCIe ports support D3 is a property of those devices. It's not a property of the platform or a quirk of a particular vendor.
Hence in my view the current location of the check (pci_bridge_d3_possible()) makes sense wheras the location you're moving it to does not.
+/* Apple machines as old as 2010 can do D3 with Thunderbolt controllers, but don't specify
- it in the ACPI tables
- */
Apple started shipping Thunderbolt in 2011. Intel brought the first chips to market in 2010.
The date is meaningful at the code's current location in pci_bridge_d3_possible() because a few lines further down there's a 2015 BIOS cut-off date.
Microsoft came up with an ACPI property that BIOS vendors may set so that Windows knows it may put a Thunderbolt controller into D3cold. I'm not even sure if that property was ever officially adopted by the ACPI spec or if it's just a Microsoft-defined "standard".
Apple had been using its own scheme to put Thunderbolt controllers into D3cold when nothing is plugged in, about a decade before Microsoft defined the ACPI property.
I'm not sure if other vendors came up with their own schemes to power-manage Thunderbolt. We may regress those with the present patch.
Thanks,
Lukas