]> Git Repo - J-linux.git/commitdiff
Merge tag 'acpi-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <[email protected]>
Sun, 21 Feb 2021 05:50:59 +0000 (21:50 -0800)
committerLinus Torvalds <[email protected]>
Sun, 21 Feb 2021 05:50:59 +0000 (21:50 -0800)
Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to upstream revision
  20210105, fix and clean up the handling of device properties, add
  support for setting global profile of the platform, clean up device
  enumeration, the CPPC library, the APEI support and more, update the
  documentation, consolidate the printing of messages in several places
  and make assorted janitorial changes.

  Specifics:

   - Update ACPICA code in the kernel to upstream revision 20201113 with
     changes as follows:

      * Remove the MTMR (Mid-Timer) table (Al Stone).
      * Remove the VRTC table (Al Stone).
      * Add type casts for string functions (Bob Moore).
      * Update all copyrights to 2021 (Bob Moore).
      * Fix exception code class checks (Maximilian Luz).
      * Clean up exception code class checks (Maximilian Luz).
      * Fix -Wfallthrough (Nick Desaulniers).

   - Add support for setting and reading global profile of the platform
     along with documentation (Mark Pearson, Hans de Goede, Jiaxun
     Yang).

   - Fix fwnode properties matching and clean up the code handling
     device properties and its documentation (Rafael Wysocki, Andy
     Shevchenko).

   - Clean up ACPI-based device enumeration code (Rafael Wysocki).

   - Clean up the CPPC support library code (Ionela Voinescu).

   - Clean up the APEI support code (Yang Li, Yazen Ghannam).

   - Update GPIO-related properties documentation (Flavio Suligoi).

   - Consolidate and clean up the printing of messages in several places
     (Rafael Wysocki).

   - Fix error code path in configfs handling code (Qinglang Miao).

   - Use DEVICE_ATTR_<RW|RO|WO> macros where applicable (Dwaipayan Ray).

   - Replace tests for !ACPI_FAILURE with tests for ACPI_SUCCESS in
     multiple places (Bjorn Helgaas)"

* tag 'acpi-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (44 commits)
  ACPI: property: Satisfy kernel doc validator (part 2)
  ACPI: property: Satisfy kernel doc validator (part 1)
  ACPI: property: Make acpi_node_prop_read() static
  ACPI: property: Remove dead code
  ACPI: property: Fix fwnode string properties matching
  ACPI: OSL: Clean up printing messages
  ACPI: OSL: Rework acpi_check_resource_conflict()
  ACPI: APEI: ERST: remove unneeded semicolon
  ACPI: thermal: Clean up printing messages
  ACPI: video: Clean up printing messages
  ACPI: button: Clean up printing messages
  ACPI: battery: Clean up printing messages
  ACPI: AC: Clean up printing messages
  ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more
  ACPI: utils: Clean up printing messages
  ACPI: scan: Clean up printing messages
  ACPI: bus: Clean up printing messages
  ACPI: PM: Clean up printing messages
  ACPI: power: Clean up printing messages
  ACPI: APEI: Add is_generic_error() to identify GHES sources
  ...

1  2 
drivers/acpi/bus.c
include/linux/acpi.h

diff --combined drivers/acpi/bus.c
index 9c3fe08e8f180cc29f89bc0ad84f75ec7f4e3387,c4b0328a0010536098d475fcd26aa210d5a7cb6a..be7da23fad76f4a17f69ad12a039015b38fc92e3
@@@ -5,6 -5,8 +5,8 @@@
   *  Copyright (C) 2001, 2002 Paul Diefenbaugh <[email protected]>
   */
  
+ #define pr_fmt(fmt) "ACPI: " fmt
  #include <linux/module.h>
  #include <linux/init.h>
  #include <linux/ioport.h>
@@@ -31,9 -33,6 +33,6 @@@
  
  #include "internal.h"
  
- #define _COMPONENT            ACPI_BUS_COMPONENT
- ACPI_MODULE_NAME("bus");
  struct acpi_device *acpi_root;
  struct proc_dir_entry *acpi_root_dir;
  EXPORT_SYMBOL(acpi_root_dir);
@@@ -47,8 -46,7 +46,7 @@@ static inline int set_copy_dsdt(const s
  #else
  static int set_copy_dsdt(const struct dmi_system_id *id)
  {
-       printk(KERN_NOTICE "%s detected - "
-               "force copy of DSDT to local memory\n", id->ident);
+       pr_notice("%s detected - force copy of DSDT to local memory\n", id->ident);
        acpi_gbl_copy_dsdt_locally = 1;
        return 0;
  }
@@@ -116,13 -114,11 +114,11 @@@ int acpi_bus_get_status(struct acpi_dev
        acpi_set_device_status(device, sta);
  
        if (device->status.functional && !device->status.present) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]: "
-                      "functional but not present;\n",
-                       device->pnp.bus_id, (u32)sta));
+               pr_debug("Device [%s] status [%08x]: functional but not present\n",
+                        device->pnp.bus_id, (u32)sta);
        }
  
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n",
-                         device->pnp.bus_id, (u32)sta));
+       pr_debug("Device [%s] status [%08x]\n", device->pnp.bus_id, (u32)sta);
        return 0;
  }
  EXPORT_SYMBOL(acpi_bus_get_status);
@@@ -281,16 -277,10 +277,16 @@@ bool osc_sb_apei_support_acked
  bool osc_pc_lpi_support_confirmed;
  EXPORT_SYMBOL_GPL(osc_pc_lpi_support_confirmed);
  
 +/*
 + * ACPI 6.4 Operating System Capabilities for USB.
 + */
 +bool osc_sb_native_usb4_support_confirmed;
 +EXPORT_SYMBOL_GPL(osc_sb_native_usb4_support_confirmed);
 +
  static u8 sb_uuid_str[] = "0811B06E-4A27-44F9-8D60-3CBBC22E7B48";
 -static void acpi_bus_osc_support(void)
 +static void acpi_bus_osc_negotiate_platform_control(void)
  {
 -      u32 capbuf[2];
 +      u32 capbuf[2], *capbuf_ret;
        struct acpi_osc_context context = {
                .uuid_str = sb_uuid_str,
                .rev = 1,
        if (IS_ENABLED(CONFIG_SCHED_MC_PRIO))
                capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_DIVERSE_HIGH_SUPPORT;
  
 +      if (IS_ENABLED(CONFIG_USB4))
 +              capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_NATIVE_USB4_SUPPORT;
 +
        if (!ghes_disable)
                capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_APEI_SUPPORT;
        if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
                return;
 -      if (ACPI_SUCCESS(acpi_run_osc(handle, &context))) {
 -              u32 *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;
 -              }
 +
 +      if (ACPI_FAILURE(acpi_run_osc(handle, &context)))
 +              return;
 +
 +      capbuf_ret = context.ret.pointer;
 +      if (context.ret.length <= OSC_SUPPORT_DWORD) {
                kfree(context.ret.pointer);
 +              return;
 +      }
 +
 +      /*
 +       * Now run _OSC again with query flag clear and with the caps
 +       * supported by both the OS and the platform.
 +       */
 +      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;
        }
 -      /* do we need to check other returned cap? Sounds no */
 +
 +      kfree(context.ret.pointer);
 +}
 +
 +/*
 + * 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
 + * manager.
 + */
 +u32 osc_sb_native_usb4_control;
 +EXPORT_SYMBOL_GPL(osc_sb_native_usb4_control);
 +
 +static void acpi_bus_decode_usb_osc(const char *msg, u32 bits)
 +{
 +      printk(KERN_INFO PREFIX "%s USB3%c DisplayPort%c PCIe%c XDomain%c\n", msg,
 +             (bits & OSC_USB_USB3_TUNNELING) ? '+' : '-',
 +             (bits & OSC_USB_DP_TUNNELING) ? '+' : '-',
 +             (bits & OSC_USB_PCIE_TUNNELING) ? '+' : '-',
 +             (bits & OSC_USB_XDOMAIN) ? '+' : '-');
 +}
 +
 +static u8 sb_usb_uuid_str[] = "23A0D13A-26AB-486C-9C5F-0FFA525A575A";
 +static void acpi_bus_osc_negotiate_usb_control(void)
 +{
 +      u32 capbuf[3];
 +      struct acpi_osc_context context = {
 +              .uuid_str = sb_usb_uuid_str,
 +              .rev = 1,
 +              .cap.length = sizeof(capbuf),
 +              .cap.pointer = capbuf,
 +      };
 +      acpi_handle handle;
 +      acpi_status status;
 +      u32 control;
 +
 +      if (!osc_sb_native_usb4_support_confirmed)
 +              return;
 +
 +      if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
 +              return;
 +
 +      control = OSC_USB_USB3_TUNNELING | OSC_USB_DP_TUNNELING |
 +                OSC_USB_PCIE_TUNNELING | OSC_USB_XDOMAIN;
 +
 +      capbuf[OSC_QUERY_DWORD] = 0;
 +      capbuf[OSC_SUPPORT_DWORD] = 0;
 +      capbuf[OSC_CONTROL_DWORD] = control;
 +
 +      status = acpi_run_osc(handle, &context);
 +      if (ACPI_FAILURE(status))
 +              return;
 +
 +      if (context.ret.length != sizeof(capbuf)) {
 +              printk(KERN_INFO PREFIX "USB4 _OSC: returned invalid length buffer\n");
 +              goto out_free;
 +      }
 +
 +      osc_sb_native_usb4_control =
 +              control & ((u32 *)context.ret.pointer)[OSC_CONTROL_DWORD];
 +
 +      acpi_bus_decode_usb_osc("USB4 _OSC: OS supports", control);
 +      acpi_bus_decode_usb_osc("USB4 _OSC: OS controls",
 +                              osc_sb_native_usb4_control);
 +
 +out_free:
 +      kfree(context.ret.pointer);
  }
  
  /* --------------------------------------------------------------------------
@@@ -1009,9 -911,9 +1005,9 @@@ static int acpi_device_probe(struct dev
                return ret;
  
        acpi_dev->driver = acpi_drv;
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                         "Driver [%s] successfully bound to device [%s]\n",
-                         acpi_drv->name, acpi_dev->pnp.bus_id));
+       pr_debug("Driver [%s] successfully bound to device [%s]\n",
+                acpi_drv->name, acpi_dev->pnp.bus_id);
  
        if (acpi_drv->ops.notify) {
                ret = acpi_device_install_notify_handler(acpi_dev);
                }
        }
  
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found driver [%s] for device [%s]\n",
-                         acpi_drv->name, acpi_dev->pnp.bus_id));
+       pr_debug("Found driver [%s] for device [%s]\n", acpi_drv->name,
+                acpi_dev->pnp.bus_id);
        get_device(dev);
        return 0;
  }
@@@ -1089,15 -992,15 +1086,15 @@@ static int __init acpi_bus_init_irq(voi
                message = "platform specific model";
                break;
        default:
-               printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n");
+               pr_info("Unknown interrupt routing model\n");
                return -ENODEV;
        }
  
-       printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message);
+       pr_info("Using %s for interrupt routing\n", message);
  
        status = acpi_execute_simple_method(NULL, "\\_PIC", acpi_irq_model);
        if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC"));
+               pr_info("_PIC evaluation failed: %s\n", acpi_format_exception(status));
                return -ENODEV;
        }
  
@@@ -1121,7 -1024,7 +1118,7 @@@ void __init acpi_early_init(void
        if (acpi_disabled)
                return;
  
-       printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
+       pr_info("Core revision %08x\n", ACPI_CA_VERSION);
  
        /* enable workarounds, unless strict ACPI spec. compliance */
        if (!acpi_strict)
  
        status = acpi_reallocate_root_table();
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX
-                      "Unable to reallocate ACPI tables\n");
+               pr_err("Unable to reallocate ACPI tables\n");
                goto error0;
        }
  
        status = acpi_initialize_subsystem();
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX
-                      "Unable to initialize the ACPI Interpreter\n");
+               pr_err("Unable to initialize the ACPI Interpreter\n");
                goto error0;
        }
  
@@@ -1196,7 -1097,7 +1191,7 @@@ void __init acpi_subsystem_init(void
  
        status = acpi_enable_subsystem(~ACPI_NO_ACPI_ENABLE);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Unable to enable ACPI\n");
+               pr_err("Unable to enable ACPI\n");
                disable_acpi();
        } else {
                /*
@@@ -1225,8 -1126,7 +1220,7 @@@ static int __init acpi_bus_init(void
  
        status = acpi_load_tables();
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX
-                      "Unable to load the System Description Tables\n");
+               pr_err("Unable to load the System Description Tables\n");
                goto error1;
        }
  
  
        status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX
-                      "Unable to start the ACPI Interpreter\n");
+               pr_err("Unable to start the ACPI Interpreter\n");
                goto error1;
        }
  
        status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n");
+               pr_err("Unable to initialize ACPI objects\n");
                goto error1;
        }
  
         * _OSC method may exist in module level code,
         * so it must be run after ACPI_FULL_INITIALIZATION
         */
 -      acpi_bus_osc_support();
 +      acpi_bus_osc_negotiate_platform_control();
 +      acpi_bus_osc_negotiate_usb_control();
  
        /*
         * _PDC control method may load dynamic SSDT tables,
         */
        acpi_ec_dsdt_probe();
  
-       printk(KERN_INFO PREFIX "Interpreter enabled\n");
+       pr_info("Interpreter enabled\n");
  
        /* Initialize sleep structures */
        acpi_sleep_init();
            acpi_install_notify_handler(ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY,
                                        &acpi_bus_notify, NULL);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX
-                      "Unable to register for device notifications\n");
+               pr_err("Unable to register for system notifications\n");
                goto error1;
        }
  
@@@ -1328,13 -1225,13 +1320,13 @@@ static int __init acpi_init(void
        int result;
  
        if (acpi_disabled) {
-               printk(KERN_INFO PREFIX "Interpreter disabled.\n");
+               pr_info("Interpreter disabled.\n");
                return -ENODEV;
        }
  
        acpi_kobj = kobject_create_and_add("acpi", firmware_kobj);
        if (!acpi_kobj) {
-               printk(KERN_WARNING "%s: kset create error\n", __func__);
+               pr_debug("%s: kset create error\n", __func__);
                acpi_kobj = NULL;
        }
  
diff --combined include/linux/acpi.h
index 68eef9e67dcbb9d7196746c697ebc4bce8367764,dc6e1f39dc6fcab494f45c973a73590fe90252ce..d33c3cfb179434d09741009f24df1b26819744bd
@@@ -546,19 -546,9 +546,19 @@@ acpi_status acpi_run_osc(acpi_handle ha
  #define OSC_SB_OSLPI_SUPPORT                  0x00000100
  #define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT               0x00001000
  #define OSC_SB_GENERIC_INITIATOR_SUPPORT      0x00002000
 +#define OSC_SB_NATIVE_USB4_SUPPORT            0x00040000
  
  extern bool osc_sb_apei_support_acked;
  extern bool osc_pc_lpi_support_confirmed;
 +extern bool osc_sb_native_usb4_support_confirmed;
 +
 +/* USB4 Capabilities */
 +#define OSC_USB_USB3_TUNNELING                        0x00000001
 +#define OSC_USB_DP_TUNNELING                  0x00000002
 +#define OSC_USB_PCIE_TUNNELING                        0x00000004
 +#define OSC_USB_XDOMAIN                               0x00000008
 +
 +extern u32 osc_sb_native_usb4_control;
  
  /* PCI Host Bridge _OSC: Capabilities DWORD 2: Support Field */
  #define OSC_PCI_EXT_CONFIG_SUPPORT            0x00000001
@@@ -1124,14 -1114,6 +1124,6 @@@ acpi_data_add_props(struct acpi_device_
  
  int acpi_node_prop_get(const struct fwnode_handle *fwnode, const char *propname,
                       void **valptr);
- int acpi_dev_prop_read_single(struct acpi_device *adev,
-                             const char *propname, enum dev_prop_type proptype,
-                             void *val);
- int acpi_node_prop_read(const struct fwnode_handle *fwnode,
-                       const char *propname, enum dev_prop_type proptype,
-                       void *val, size_t nval);
- int acpi_dev_prop_read(const struct acpi_device *adev, const char *propname,
-                      enum dev_prop_type proptype, void *val, size_t nval);
  
  struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
                                            struct fwnode_handle *child);
@@@ -1233,30 -1215,6 +1225,6 @@@ static inline int acpi_node_prop_get(co
        return -ENXIO;
  }
  
- static inline int acpi_dev_prop_read_single(const struct acpi_device *adev,
-                                           const char *propname,
-                                           enum dev_prop_type proptype,
-                                           void *val)
- {
-       return -ENXIO;
- }
- static inline int acpi_node_prop_read(const struct fwnode_handle *fwnode,
-                                     const char *propname,
-                                     enum dev_prop_type proptype,
-                                     void *val, size_t nval)
- {
-       return -ENXIO;
- }
- static inline int acpi_dev_prop_read(const struct acpi_device *adev,
-                                    const char *propname,
-                                    enum dev_prop_type proptype,
-                                    void *val, size_t nval)
- {
-       return -ENXIO;
- }
  static inline struct fwnode_handle *
  acpi_get_next_subnode(const struct fwnode_handle *fwnode,
                      struct fwnode_handle *child)
This page took 0.086828 seconds and 4 git commands to generate.