ACPI: Run USB4 _OSC() first with query bit set
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 14 Nov 2023 12:06:11 +0000 (14:06 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 20 Nov 2023 16:52:31 +0000 (17:52 +0100)
commit6d392d8daa7514a431678521c2af8be10fc31bc1
tree96f005153cfe5b35081df57aa86d53afe01b92aa
parent98b1cc82c4affc16f5598d4fa14b1858671b2263
ACPI: Run USB4 _OSC() first with query bit set

The platform can deny certain tunneling from the OS and it does that by
clearing the control bits it does not want the OS to get and returning
with OSC_CAPABILITIES_MASK_ERROR bit set. Currently we do not handle
this properly so if this happens, for example when the platform denies
PCIe tunneling, we just fail the whole negotiation and revert back to
what the Thunderbolt driver is doing to figure out whether the
controller is running firmware connection manager or not. However, we
should honor what the platform returns.

For this reason run the USB4 _OSC() first with query bit set, and then
use the returned control double word (that may contain some of the bits
cleared by the platform) and run it second time with query bit clear.

While there, remove an extra space from the assignment of the control
double word.

Reported-by: NaamaX Shachar <naamax.shachar@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/bus.c