Skip to content

Commit 8be056a

Browse files
committed
Merge branches 'acpi-osl', 'acpi-bus' and 'acpi-tables'
Merge low-level ACPICA interface changes, an _SB-scope _OSC handshake update and a data-only ACPI tables parsing code update for 6.8-rc1: - Switch over ACPI to using a threaded interrupt handler for the SCI (Rafael J. Wysocki). - Allow ACPI Notify () handlers to run on all CPUs and clean up the ACPI interface for deferred events processing (Rafael J. Wysocki). - Switch over the ACPI EC driver to using a threaded handler for the dedicated IRQ on systems without the EC GPE (Rafael J. Wysocki). - Adjust code using ACPICA spinlocks and the ACPI EC driver spinlock to keep local interrupts on (Rafael J. Wysocki). - Adjust the USB4 _OSC handshake to correctly handle cases in which certain types of OS control are denied by the platform (Mika Westerberg). - Correct and clean up the generic function for parsing ACPI data-only tables with array structure (Yuntao Wang). * acpi-osl: ACPI: EC: Use a spin lock without disabing interrupts ACPI: EC: Use a threaded handler for dedicated IRQ ACPI: OSL: Use spin locks without disabling interrupts ACPI: OSL: Allow Notify () handlers to run on all CPUs ACPI: OSL: Rearrange workqueue selection in acpi_os_execute() ACPI: OSL: Rework error handling in acpi_os_execute() ACPI: OSL: Use a threaded interrupt handler for SCI * acpi-bus: ACPI: Run USB4 _OSC() first with query bit set * acpi-tables: ACPI: tables: Correct and clean up the logic of acpi_parse_entries_array()
4 parents e3f4440 + eb9299b + 6d392d8 + 4b3805d commit 8be056a

File tree

4 files changed

+120
-135
lines changed

4 files changed

+120
-135
lines changed

drivers/acpi/bus.c

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static void acpi_bus_decode_usb_osc(const char *msg, u32 bits)
408408
static u8 sb_usb_uuid_str[] = "23A0D13A-26AB-486C-9C5F-0FFA525A575A";
409409
static void acpi_bus_osc_negotiate_usb_control(void)
410410
{
411-
u32 capbuf[3];
411+
u32 capbuf[3], *capbuf_ret;
412412
struct acpi_osc_context context = {
413413
.uuid_str = sb_usb_uuid_str,
414414
.rev = 1,
@@ -428,7 +428,12 @@ static void acpi_bus_osc_negotiate_usb_control(void)
428428
control = OSC_USB_USB3_TUNNELING | OSC_USB_DP_TUNNELING |
429429
OSC_USB_PCIE_TUNNELING | OSC_USB_XDOMAIN;
430430

431-
capbuf[OSC_QUERY_DWORD] = 0;
431+
/*
432+
* Run _OSC first with query bit set, trying to get control over
433+
* all tunneling. The platform can then clear out bits in the
434+
* control dword that it does not want to grant to the OS.
435+
*/
436+
capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE;
432437
capbuf[OSC_SUPPORT_DWORD] = 0;
433438
capbuf[OSC_CONTROL_DWORD] = control;
434439

@@ -441,8 +446,29 @@ static void acpi_bus_osc_negotiate_usb_control(void)
441446
goto out_free;
442447
}
443448

449+
/*
450+
* Run _OSC again now with query bit clear and the control dword
451+
* matching what the platform granted (which may not have all
452+
* the control bits set).
453+
*/
454+
capbuf_ret = context.ret.pointer;
455+
456+
capbuf[OSC_QUERY_DWORD] = 0;
457+
capbuf[OSC_CONTROL_DWORD] = capbuf_ret[OSC_CONTROL_DWORD];
458+
459+
kfree(context.ret.pointer);
460+
461+
status = acpi_run_osc(handle, &context);
462+
if (ACPI_FAILURE(status))
463+
return;
464+
465+
if (context.ret.length != sizeof(capbuf)) {
466+
pr_info("USB4 _OSC: returned invalid length buffer\n");
467+
goto out_free;
468+
}
469+
444470
osc_sb_native_usb4_control =
445-
control & acpi_osc_ctx_get_pci_control(&context);
471+
control & acpi_osc_ctx_get_pci_control(&context);
446472

447473
acpi_bus_decode_usb_osc("USB4 _OSC: OS supports", control);
448474
acpi_bus_decode_usb_osc("USB4 _OSC: OS controls",

0 commit comments

Comments
 (0)