]> Git Repo - linux.git/commitdiff
Merge tag 'acpi-part2-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Fri, 9 Feb 2018 17:44:25 +0000 (09:44 -0800)
committerLinus Torvalds <[email protected]>
Fri, 9 Feb 2018 17:44:25 +0000 (09:44 -0800)
Pull more ACPI updates from Rafael Wysocki:
 "These are mostly fixes and cleanups, a few new quirks, a couple of
  updates related to the handling of ACPI tables and ACPICA copyrights
  refreshment.

  Specifics:

   - Update the ACPICA kernel code to upstream revision 20180105
     including:
       * Assorted fixes (Jung-uk Kim)
       * Support for X32 ABI compilation (Anuj Mittal)
       * Update of ACPICA copyrights to 2018 (Bob Moore)

   - Prepare for future modifications to avoid executing the _STA
     control method too early (Hans de Goede)

   - Make the processor performance control library code ignore _PPC
     notifications if they cannot be handled and fix up the C1 idle
     state definition when it is used as a fallback state (Chen Yu,
     Yazen Ghannam)

   - Make it possible to use the SPCR table on x86 and to replace the
     original IORT table with a new one from initrd (Prarit Bhargava,
     Shunyong Yang)

   - Add battery-related quirks for Asus UX360UA and UX410UAK and add
     quirks for table parsing on Dell XPS 9570 and Precision M5530 (Kai
     Heng Feng)

   - Address static checker warnings in the CPPC code (Gustavo Silva)

   - Avoid printing a raw pointer to the kernel log in the smart battery
     driver (Greg Kroah-Hartman)"

* tag 'acpi-part2-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: sbshc: remove raw pointer from printk() message
  ACPI: SPCR: Make SPCR available to x86
  ACPI / CPPC: Use 64-bit arithmetic instead of 32-bit
  ACPI / tables: Add IORT to injectable table list
  ACPI / bus: Parse tables as term_list for Dell XPS 9570 and Precision M5530
  ACPICA: Update version to 20180105
  ACPICA: All acpica: Update copyrights to 2018
  ACPI / processor: Set default C1 idle state description
  ACPI / battery: Add quirk for Asus UX360UA and UX410UAK
  ACPI: processor_perflib: Do not send _PPC change notification if not ready
  ACPI / scan: Use acpi_bus_get_status() to initialize ACPI_TYPE_DEVICE devs
  ACPI / bus: Do not call _STA on battery devices with unmet dependencies
  PCI: acpiphp_ibm: prepare for acpi_get_object_info() no longer returning status
  ACPI: export acpi_bus_get_status_handle()
  ACPICA: Add a missing pair of parentheses
  ACPICA: Prefer ACPI_TO_POINTER() over ACPI_ADD_PTR()
  ACPICA: Avoid NULL pointer arithmetic
  ACPICA: Linux: add support for X32 ABI compilation
  ACPI / video: Use true for boolean value

1  2 
Documentation/admin-guide/kernel-parameters.txt
arch/arm64/kernel/acpi.c
drivers/acpi/Kconfig
drivers/acpi/bus.c
drivers/acpi/processor_idle.c
drivers/pci/hotplug/acpiphp_ibm.c
include/linux/acpi.h
include/linux/serial_core.h

index 39ac9d4fad7ff35e17e7c4e0ac5dd91ae6f63cfe,aecb1c8ef675231a995c4a277aa404de90a6e508..1d1d53f85ddd79ce2218b7274b3114f41493ac3a
                        console=brl,ttyS0
                For now, only VisioBraille is supported.
  
 +      console_msg_format=
 +                      [KNL] Change console messages format
 +              default
 +                      By default we print messages on consoles in
 +                      "[time stamp] text\n" format (time stamp may not be
 +                      printed, depending on CONFIG_PRINTK_TIME or
 +                      `printk_time' param).
 +              syslog
 +                      Switch to syslog format: "<%u>[time stamp] text\n"
 +                      IOW, each message will have a facility and loglevel
 +                      prefix. The format is similar to one used by syslog()
 +                      syscall, or to executing "dmesg -S --raw" or to reading
 +                      from /proc/kmsg.
 +
        consoleblank=   [KNL] The console blank (screen saver) timeout in
                        seconds. A value of 0 disables the blank timer.
                         Defaults to 0.
  
        earlycon=       [KNL] Output early console device and options.
  
-                       When used with no options, the early console is
-                       determined by the stdout-path property in device
-                       tree's chosen node.
+                       [ARM64] The early console is determined by the
+                       stdout-path property in device tree's chosen node,
+                       or determined by the ACPI SPCR table.
+                       [X86] When used with no options the early console is
+                       determined by the ACPI SPCR table.
  
                cdns,<addr>[,options]
                        Start an early, polled-mode console on a Cadence
                        This tests the locking primitive's ability to
                        transition abruptly to and from idle.
  
 -      locktorture.torture_runnable= [BOOT]
 -                      Start locktorture running at boot time.
 -
        locktorture.torture_type= [KNL]
                        Specify the locking implementation to test.
  
                        This is useful when you use a panic=... timeout and
                        need the box quickly up again.
  
 +                      These settings can be accessed at runtime via
 +                      the nmi_watchdog and hardlockup_panic sysctls.
 +
        netpoll.carrier_timeout=
                        [NET] Specifies amount of time (in seconds) that
                        netpoll should wait for a carrier. By default netpoll
        norandmaps      Don't use address space randomization.  Equivalent to
                        echo 0 > /proc/sys/kernel/randomize_va_space
  
 -      noreplace-paravirt      [X86,IA-64,PV_OPS] Don't patch paravirt_ops
 -
        noreplace-smp   [X86-32,SMP] Don't replace SMP instructions
                        with UP alternatives
  
                        the same as for rcuperf.nreaders.
                        N, where N is the number of CPUs
  
 -      rcuperf.perf_runnable= [BOOT]
 -                      Start rcuperf running at boot time.
 -
        rcuperf.perf_type= [KNL]
                        Specify the RCU implementation to test.
  
                        Test RCU's dyntick-idle handling.  See also the
                        rcutorture.shuffle_interval parameter.
  
 -      rcutorture.torture_runnable= [BOOT]
 -                      Start rcutorture running at boot time.
 -
        rcutorture.torture_type= [KNL]
                        Specify the RCU implementation to test.
  
  
        rdt=            [HW,X86,RDT]
                        Turn on/off individual RDT features. List is:
 -                      cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, mba.
 +                      cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, l2cdp,
 +                      mba.
                        E.g. to turn on cmt and turn off mba use:
                                rdt=cmt,!mba
  
                        [KNL, SMP] Set scheduler's default relax_domain_level.
                        See Documentation/cgroup-v1/cpusets.txt.
  
 -      reserve=        [KNL,BUGS] Force the kernel to ignore some iomem area
 +      reserve=        [KNL,BUGS] Force kernel to ignore I/O ports or memory
 +                      Format: <base1>,<size1>[,<base2>,<size2>,...]
 +                      Reserve I/O ports or memory so the kernel won't use
 +                      them.  If <base> is less than 0x10000, the region
 +                      is assumed to be I/O ports; otherwise it is memory.
  
        reservetop=     [X86-32]
                        Format: nn[KMG]
diff --combined arch/arm64/kernel/acpi.c
index 252396a96c78fc187166b893d1c8c9655fe514ca,2aa5609def27a876200a7825c296dfd0c8a6f149..7b09487ff8fb65862db4d20c6bdfcd53cf9eb4e0
@@@ -117,7 -117,7 +117,7 @@@ bool __init acpi_psci_present(void
  }
  
  /* Whether HVC must be used instead of SMC as the PSCI conduit */
 -bool __init acpi_psci_use_hvc(void)
 +bool acpi_psci_use_hvc(void)
  {
        return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC;
  }
@@@ -230,10 -230,10 +230,10 @@@ void __init acpi_boot_table_init(void
  
  done:
        if (acpi_disabled) {
-               if (earlycon_init_is_deferred)
+               if (earlycon_acpi_spcr_enable)
                        early_init_dt_scan_chosen_stdout();
        } else {
-               parse_spcr(earlycon_init_is_deferred);
+               acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
                if (IS_ENABLED(CONFIG_ACPI_BGRT))
                        acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
        }
diff --combined drivers/acpi/Kconfig
index d650c5b6ec90c8f07a4ac36565fdaceed7cc1f3b,ddcb5f40e8ee8fe59aabaed024804196ce0ba9c8..f505e9a01b2d02a656e81884876e52ca6b846dca
@@@ -79,7 -79,12 +79,12 @@@ config ACPI_DEBUGGER_USE
  endif
  
  config ACPI_SPCR_TABLE
-       bool
+       bool "ACPI Serial Port Console Redirection Support"
+       default y if X86
+       help
+         Enable support for Serial Port Console Redirection (SPCR) Table.
+         This table provides information about the configuration of the
+         earlycon console.
  
  config ACPI_LPIT
        bool
@@@ -361,6 -366,22 +366,6 @@@ config ACPI_PCI_SLO
          i.e., segment/bus/device/function tuples, with physical slots in
          the system.  If you are unsure, say N.
  
 -config X86_PM_TIMER
 -      bool "Power Management Timer Support" if EXPERT
 -      depends on X86
 -      default y
 -      help
 -        The Power Management Timer is available on all ACPI-capable,
 -        in most cases even if ACPI is unusable or blacklisted.
 -
 -        This timing source is not affected by power management features
 -        like aggressive processor idling, throttling, frequency and/or
 -        voltage scaling, unlike the commonly used Time Stamp Counter
 -        (TSC) timing source.
 -
 -        You should nearly always say Y here because many modern
 -        systems require this timer. 
 -
  config ACPI_CONTAINER
        bool "Container and Module Devices"
        default (ACPI_HOTPLUG_MEMORY || ACPI_HOTPLUG_CPU)
@@@ -548,19 -569,3 +553,19 @@@ config TPS68470_PMIC_OPREGIO
          using this, are probed.
  
  endif # ACPI
 +
 +config X86_PM_TIMER
 +      bool "Power Management Timer Support" if EXPERT
 +      depends on X86 && (ACPI || JAILHOUSE_GUEST)
 +      default y
 +      help
 +        The Power Management Timer is available on all ACPI-capable,
 +        in most cases even if ACPI is unusable or blacklisted.
 +
 +        This timing source is not affected by power management features
 +        like aggressive processor idling, throttling, frequency and/or
 +        voltage scaling, unlike the commonly used Time Stamp Counter
 +        (TSC) timing source.
 +
 +        You should nearly always say Y here because many modern
 +        systems require this timer.
diff --combined drivers/acpi/bus.c
index f87ed3be779ae3a2f2e9a354e2f55f7badc83c34,5c00e5e18da8c129412a15d4b445405697ecebd1..676c9788e1c8287b5e16311fa3159342702ae637
@@@ -66,10 -66,37 +66,37 @@@ static int set_copy_dsdt(const struct d
        return 0;
  }
  #endif
+ static int set_gbl_term_list(const struct dmi_system_id *id)
+ {
+       acpi_gbl_parse_table_as_term_list = 1;
+       return 0;
+ }
  
- static const struct dmi_system_id dsdt_dmi_table[] __initconst = {
+ static const struct dmi_system_id acpi_quirks_dmi_table[] __initconst = {
+       /*
+        * Touchpad on Dell XPS 9570/Precision M5530 doesn't work under I2C
+        * mode.
+        * https://bugzilla.kernel.org/show_bug.cgi?id=198515
+        */
+       {
+               .callback = set_gbl_term_list,
+               .ident = "Dell Precision M5530",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Precision M5530"),
+               },
+       },
+       {
+               .callback = set_gbl_term_list,
+               .ident = "Dell XPS 15 9570",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "XPS 15 9570"),
+               },
+       },
        /*
         * Invoke DSDT corruption work-around on all Toshiba Satellite.
+        * DSDT will be copied to memory.
         * https://bugzilla.kernel.org/show_bug.cgi?id=14679
         */
        {
        {}
  };
  #else
- static const struct dmi_system_id dsdt_dmi_table[] __initconst = {
+ static const struct dmi_system_id acpi_quirks_dmi_table[] __initconst = {
        {}
  };
  #endif
@@@ -108,6 -135,7 +135,7 @@@ acpi_status acpi_bus_get_status_handle(
        }
        return status;
  }
+ EXPORT_SYMBOL_GPL(acpi_bus_get_status_handle);
  
  int acpi_bus_get_status(struct acpi_device *device)
  {
                return 0;
        }
  
+       /* Battery devices must have their deps met before calling _STA */
+       if (acpi_device_is_battery(device) && device->dep_unmet) {
+               acpi_set_device_status(device, 0);
+               return 0;
+       }
        status = acpi_bus_get_status_handle(device->handle, &sta);
        if (ACPI_FAILURE(status))
                return -ENODEV;
@@@ -785,24 -819,6 +819,24 @@@ const struct acpi_device_id *acpi_match
  }
  EXPORT_SYMBOL_GPL(acpi_match_device);
  
 +void *acpi_get_match_data(const struct device *dev)
 +{
 +      const struct acpi_device_id *match;
 +
 +      if (!dev->driver)
 +              return NULL;
 +
 +      if (!dev->driver->acpi_match_table)
 +              return NULL;
 +
 +      match = acpi_match_device(dev->driver->acpi_match_table, dev);
 +      if (!match)
 +              return NULL;
 +
 +      return (void *)match->driver_data;
 +}
 +EXPORT_SYMBOL_GPL(acpi_get_match_data);
 +
  int acpi_match_device_ids(struct acpi_device *device,
                          const struct acpi_device_id *ids)
  {
@@@ -1019,11 -1035,8 +1053,8 @@@ void __init acpi_early_init(void
  
        acpi_permanent_mmap = true;
  
-       /*
-        * If the machine falls into the DMI check table,
-        * DSDT will be copied to memory
-        */
-       dmi_check_system(dsdt_dmi_table);
+       /* Check machine-specific quirks */
+       dmi_check_system(acpi_quirks_dmi_table);
  
        status = acpi_reallocate_root_table();
        if (ACPI_FAILURE(status)) {
index 5f0071c7e2e11de953c1fe17eb4cf0581d4f24b4,226dc5665d8103cff28f67d3b6f13ec296c306dd..abb559cd28d793d052b6408e606469538e80c65b
@@@ -207,7 -207,6 +207,7 @@@ static void tsc_check_state(int state
        switch (boot_cpu_data.x86_vendor) {
        case X86_VENDOR_AMD:
        case X86_VENDOR_INTEL:
 +      case X86_VENDOR_CENTAUR:
                /*
                 * AMD Fam10h TSC will tick in all
                 * C/P/S0/S1 states when this bit is set.
@@@ -292,6 -291,9 +292,9 @@@ static int acpi_processor_get_power_inf
                pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
                pr->power.states[ACPI_STATE_C1].valid = 1;
                pr->power.states[ACPI_STATE_C1].entry_method = ACPI_CSTATE_HALT;
+               snprintf(pr->power.states[ACPI_STATE_C1].desc,
+                        ACPI_CX_DESC_LEN, "ACPI HLT");
        }
        /* the C0 state only exists as a filler in our array */
        pr->power.states[ACPI_STATE_C0].valid = 1;
index 3903d90fe51cf4985bbd7c0e406a758d322902ca,8472c4a27f700104057aaeb5a42158dc5f943f76..41713f16ff97250aa9c314de3b3a83263c61c77d
@@@ -1,4 -1,3 +1,4 @@@
 +// SPDX-License-Identifier: GPL-2.0+
  /*
   * ACPI PCI Hot Plug IBM Extension
   *
@@@ -7,6 -6,21 +7,6 @@@
   *
   * All rights reserved.
   *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License as published by
 - * the Free Software Foundation; either version 2 of the License, or (at
 - * your option) any later version.
 - *
 - * This program is distributed in the hope that it will be useful, but
 - * WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 - * NON INFRINGEMENT.  See the GNU General Public License for more
 - * details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software
 - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 - *
   * Send feedback to <[email protected]>
   *
   */
@@@ -385,6 -399,7 +385,7 @@@ static acpi_status __init ibm_find_acpi
                u32 lvl, void *context, void **rv)
  {
        acpi_handle *phandle = (acpi_handle *)context;
+       unsigned long long current_status = 0;
        acpi_status status;
        struct acpi_device_info *info;
        int retval = 0;
                return retval;
        }
  
-       if (info->current_status && (info->valid & ACPI_VALID_HID) &&
+       acpi_bus_get_status_handle(handle, &current_status);
+       if (current_status && (info->valid & ACPI_VALID_HID) &&
                        (!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) ||
                         !strcmp(info->hardware_id.string, IBM_HARDWARE_ID2))) {
                pr_debug("found hardware: %s, handle: %p\n",
diff --combined include/linux/acpi.h
index e6d41b65d3962d3e5eca4a548195de1745267b9c,e6b98a32495f318d6a104437e7084d0e2a0d8f97..64e10746f28288107131c2bef7e879c0aa5722f4
@@@ -56,8 -56,6 +56,8 @@@ static inline acpi_handle acpi_device_h
  #define ACPI_COMPANION_SET(dev, adev) set_primary_fwnode(dev, (adev) ? \
        acpi_fwnode_handle(adev) : NULL)
  #define ACPI_HANDLE(dev)              acpi_device_handle(ACPI_COMPANION(dev))
 +#define ACPI_HANDLE_FWNODE(fwnode)    \
 +                              acpi_device_handle(to_acpi_device_node(fwnode))
  
  static inline struct fwnode_handle *acpi_alloc_fwnode_static(void)
  {
@@@ -587,7 -585,6 +587,7 @@@ extern int acpi_nvs_for_each_region(in
  const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
                                               const struct device *dev);
  
 +void *acpi_get_match_data(const struct device *dev);
  extern bool acpi_driver_match_device(struct device *dev,
                                     const struct device_driver *drv);
  int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
@@@ -630,7 -627,6 +630,7 @@@ int acpi_arch_timer_mem_init(struct arc
  #define ACPI_COMPANION(dev)           (NULL)
  #define ACPI_COMPANION_SET(dev, adev) do { } while (0)
  #define ACPI_HANDLE(dev)              (NULL)
 +#define ACPI_HANDLE_FWNODE(fwnode)    (NULL)
  #define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (0), .cls_msk = (0),
  
  struct fwnode_handle;
@@@ -766,11 -762,6 +766,11 @@@ static inline const struct acpi_device_
        return NULL;
  }
  
 +static inline void *acpi_get_match_data(const struct device *dev)
 +{
 +      return NULL;
 +}
 +
  static inline bool acpi_driver_match_device(struct device *dev,
                                            const struct device_driver *drv)
  {
@@@ -994,11 -985,6 +994,11 @@@ struct acpi_gpio_mapping 
        const char *name;
        const struct acpi_gpio_params *data;
        unsigned int size;
 +
 +/* Ignore IoRestriction field */
 +#define ACPI_GPIO_QUIRK_NO_IO_RESTRICTION     BIT(0)
 +
 +      unsigned int quirks;
  };
  
  #if defined(CONFIG_ACPI) && defined(CONFIG_GPIOLIB)
@@@ -1263,9 -1249,12 +1263,12 @@@ static inline bool acpi_has_watchdog(vo
  
  #ifdef CONFIG_ACPI_SPCR_TABLE
  extern bool qdf2400_e44_present;
- int parse_spcr(bool earlycon);
+ int acpi_parse_spcr(bool enable_earlycon, bool enable_console);
  #else
- static inline int parse_spcr(bool earlycon) { return 0; }
+ static inline int acpi_parse_spcr(bool enable_earlycon, bool enable_console)
+ {
+       return 0;
+ }
  #endif
  
  #if IS_ENABLED(CONFIG_ACPI_GENERIC_GSI)
index 4c310c34ddadd49b9e14b1202522bb493782e8a3,aefd0e5115dae30703fdf6b61858c438a76665bf..b32df49a3bd5aa8f791b295919c90adaefeae8e8
@@@ -376,10 -376,10 +376,10 @@@ extern int of_setup_earlycon(const stru
                             const char *options);
  
  #ifdef CONFIG_SERIAL_EARLYCON
- extern bool earlycon_init_is_deferred __initdata;
+ extern bool earlycon_acpi_spcr_enable __initdata;
  int setup_earlycon(char *buf);
  #else
- static const bool earlycon_init_is_deferred;
+ static const bool earlycon_acpi_spcr_enable;
  static inline int setup_earlycon(char *buf) { return 0; }
  #endif
  
@@@ -387,7 -387,7 +387,7 @@@ struct uart_port *uart_get_console(stru
                                   struct console *c);
  int uart_parse_earlycon(char *p, unsigned char *iotype, resource_size_t *addr,
                        char **options);
 -void uart_parse_options(char *options, int *baud, int *parity, int *bits,
 +void uart_parse_options(const char *options, int *baud, int *parity, int *bits,
                        int *flow);
  int uart_set_options(struct uart_port *port, struct console *co, int baud,
                     int parity, int bits, int flow);
@@@ -501,5 -501,9 +501,5 @@@ static inline int uart_handle_break(str
                                         (cflag) & CRTSCTS || \
                                         !((cflag) & CLOCAL))
  
 -/*
 - * Common device tree parsing helpers
 - */
 -void of_get_rs485_mode(struct device_node *np, struct serial_rs485 *rs485conf);
 -
 +void uart_get_rs485_mode(struct device *dev, struct serial_rs485 *rs485conf);
  #endif /* LINUX_SERIAL_CORE_H */
This page took 0.117049 seconds and 4 git commands to generate.