https://bugzilla.kernel.org/show_bug.cgi?id=213023

--- Comment #28 from sander44 (ionut_n2...@yahoo.com) ---
My fix working with 5.10 branch:

index c49b35e30..cdff9cb03 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -332,39 +332,22 @@ static void acpi_bus_osc_negotiate_platform_control(void)
        if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
                return;

-       if (ACPI_FAILURE(acpi_run_osc(handle, &context)))
-               return;
-
-       capbuf_ret = context.ret.pointer;
-       if (context.ret.length <= OSC_SUPPORT_DWORD) {
+       if (ACPI_SUCCESS(acpi_run_osc(handle, &context))) {
+               capbuf_ret = context.ret.pointer;
+               if (context.ret.length > OSC_SUPPORT_DWORD) {
+                       osc_sb_apei_support_acked =
+                               capbuf_ret[OSC_SUPPORT_DWORD] &
OSC_SB_APEI_SUPPORT;
+                       osc_pc_lpi_support_confirmed =
+                               capbuf_ret[OSC_SUPPORT_DWORD] &
OSC_SB_PCLPI_SUPPORT;
+                       osc_sb_native_usb4_support_confirmed =
+                               capbuf_ret[OSC_SUPPORT_DWORD] &
OSC_SB_NATIVE_USB4_SUPPORT;
+               }
                kfree(context.ret.pointer);
-               return;
-       }
-
-       /*
-        * Now run _OSC again with query flag clean and with the caps
-        * both platform and OS supports.
-        */
-       capbuf[OSC_QUERY_DWORD] = 0;
-       capbuf[OSC_SUPPORT_DWORD] = capbuf_ret[OSC_SUPPORT_DWORD];
-       kfree(context.ret.pointer);
-
-       if (ACPI_FAILURE(acpi_run_osc(handle, &context)))
-               return;
-
-       capbuf_ret = context.ret.pointer;
-       if (context.ret.length > OSC_SUPPORT_DWORD) {
-               osc_sb_apei_support_acked =
-                       capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT;
-               osc_pc_lpi_support_confirmed =
-                       capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_PCLPI_SUPPORT;
-               osc_sb_native_usb4_support_confirmed =
-                       capbuf_ret[OSC_SUPPORT_DWORD] &
OSC_SB_NATIVE_USB4_SUPPORT;
        }
-
-       kfree(context.ret.pointer);
+       /* do we need to check other returned cap? Sounds no */
 }

+
 /*
  * Native control of USB4 capabilities. If any of the tunneling bits is
  * set it means OS is in control and we use software based connection
-- 
2.30.2

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
acpi-bugzilla mailing list
acpi-bugzilla@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to