Re: [PATCH 0/2] Mark USB4 controllers as is_thunderbolt

Lukas Wunner
2022-02-07T18:02:18Z

On Mon, Feb 07, 2022 at 03:52:13PM +0000, Deucher, Alexander wrote:
> > From: Mika Westerberg <mika.westerberg@linux.intel.com>
> > The other option is to look for ACPI companion (ACPI_COMPANION()) of the
> > device. AFAICT dGPUs don't have one (as the BIOS does not know in advance
> > what will be connected to the hotplug ports) whereas internal does typically
> > have one.
>
> Yeah, this is probably the right way to do this.

No, that doesn't work. At least Apple represents the first few devices
in the Thunderbolt daisy-chain in the ACPI namespace, so IIUC you'd find
an ACPI companion for those but not for the remainder of the daisy-chain.
This is from a 2019/2020 MacBookPro16,1:

$ grep 'Device ' acpidump/mbp161/ssdt6.dsl
Device (UPSB)
Device (DSB0)
Device (NHI0)
Device (DSB1)
Device (UPS0)
Device (DSB0)
Device (DEV0)
Device (DSB3)
Device (UPS0)
Device (DSB0)
Device (DEV0)
Device (DSB3)
Device (DEV0)
...

There's a *reason* why I introduced the is_thunderbolt flag,
there is no other reliable way to detect externally attached devices.

Thanks,

Lukas