Re: [PATCH v2 6/9] PCI: Rename is_thunderbolt to is_tunneled

From: Mario Limonciello
Date: Mon Nov 06 2023 - 11:59:26 EST


On 11/5/2023 11:39, Lukas Wunner wrote:
On Fri, Nov 03, 2023 at 02:07:55PM -0500, Mario Limonciello wrote:
The `is_thunderbolt` bit has been used to indicate that a PCIe device
contained the Intel VSEC which is used by various parts of the kernel
to change behavior. To later allow usage with USB4 controllers as well,
rename this to `is_tunneled`.

This doesn't seem to make sense. is_thunderbolt indicates that a device
is part of a Thunderbolt controller. See the code comment:

- unsigned int is_thunderbolt:1; /* Thunderbolt controller */

A Thunderbolt controller is not necessarily tunneled. The PCIe switch,
NHI and XHCI of the Thunderbolt host controller are not tunneled at all.

Thanks,

Lukas

I could really use some clarification which PCIe devices actually contain the Intel VSEC.

Is it in all 3 of those PCIe devices and not just the switch?

If so, I think I would rather introduce a separate bit. So after this series we would have:

is_tunneled:1
is_thunderbolt:1
no_command_complete:1

* TBT1 devices would set no_command_complete
- The consumer would be pcie_init()
* All devices with the Intel VSEC would set is_thunderbolt and the two consumers would be:
- apple-gmux.c
- pci_bridge_d3_possible()
* USB4 devices and PCIe switches with the VSEC would set is_tunneled.