Merge tag 'acpica-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Jul 2015 00:11:28 +0000 (17:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Jul 2015 00:11:28 +0000 (17:11 -0700)
Pull ACPICA updates from Rafael Wysocki:
 "Additional ACPICA material for v4.2-rc1

  This will update the ACPICA code in the kernel to upstream revision
  20150619 (a bug-fix release mostly including stable-candidate fixes)
  and restore an earlier ACPICA commit that had to be reverted due to a
  regression introduced by it (the regression is addressed by
  blacklisting the only known system affected by it to date).

  The only new feature added by this update is the support for
  overriding objects in the ACPI namespace and a new ACPI table that can
  be used for that called the Override System Definition Table (OSDT).
  That should allow us to "patch" the ACPI namespace built from
  incomplete or incorrect ACPI System Definition tables (DSDT, SSDT)
  during system startup without the need to provide replacements for all
  of those tables in the future.

  Specifics:

   - Fix system resume problems related to 32-bit and 64-bit versions of
     the Firmware ACPI Control Structure (FACS) in the firmare (Lv
     Zheng)

   - Fix double initialization of the FACS (Lv Zheng)

   - Add _CLS object processing code to ACPICA (Suravee Suthikulpanit)

   - Add support for the (currently missing) new GIC version field in
     the Multiple APIC Description Table (MADT) (Hanjun Guo)

   - Add support for overriding objects in the ACPI namespace to ACPICA
     and OSDT support (Lv Zheng, Bob Moore, Zhang Rui)

   - Updates related to the TCPA and TPM2 ACPI tables (Bob Moore)

   - Restore the commit modifying _REV to always return "2" (as required
     by ACPI 6) and add a blacklisting mechanism for systems that may be
     affected by that change (Rafael J Wysocki)

   - Assorted fixes and cleanups (Bob Moore, Lv Zheng, Sascha Wildner)"

* tag 'acpica-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (28 commits)
  Revert 'Revert "ACPICA: Permanently set _REV to the value '2'."'
  ACPI / init: Make it possible to override _REV
  ACPICA: Update version to 20150619
  ACPICA: Comment update, no functional change
  ACPICA: Update TPM2 ACPI table
  ACPICA: Update definitions for the TCPA and TPM2 ACPI tables
  ACPICA: Split C library prototypes to new header
  ACPICA: De-macroize calls to standard C library functions
  ACPI / acpidump: Update acpidump manual
  ACPICA: acpidump: Convert the default behavior to dump from /sys/firmware/acpi/tables
  ACPICA: acpidump: Allow customized tables to be dumped without accessing /dev/mem
  ACPICA: Cleanup output for the ASL Debug object
  ACPICA: Update for acpi_install_table memory types
  ACPICA: Namespace: Change namespace override to avoid node deletion
  ACPICA: Namespace: Add support of OSDT table
  ACPICA: Namespace: Add support to allow overriding objects
  ACPICA: ACPI 6.0: Add values for MADT GIC version field
  ACPICA: Utilities: Add _CLS processing
  ACPICA: Add dragon_fly support to unix file mapping file
  ACPICA: EFI: Add EFI interface definitions to eliminate dependency of GNU EFI
  ...

1  2 
Documentation/kernel-parameters.txt
drivers/acpi/Kconfig
drivers/acpi/internal.h
drivers/acpi/osl.c

index afe7e2bbbc23cbc01eef6224824f1c4d199833c7,180102480fc06dc8b0c4d048d7f0cc75ac6c5702..1d6f0459cd7bbe531b7acc2d85722ff62185729e
@@@ -179,6 -179,11 +179,6 @@@ bytes respectively. Such letter suffixe
  
                        See also Documentation/power/runtime_pm.txt, pci=noacpi
  
 -      acpi_rsdp=      [ACPI,EFI,KEXEC]
 -                      Pass the RSDP address to the kernel, mostly used
 -                      on machines running EFI runtime service to boot the
 -                      second kernel for kdump.
 -
        acpi_apic_instance=     [ACPI, IOAPIC]
                        Format: <int>
                        2: use 2nd APIC table, if available
                        (e.g. thinkpad_acpi, sony_acpi, etc.) instead
                        of the ACPI video.ko driver.
  
 +      acpica_no_return_repair [HW, ACPI]
 +                      Disable AML predefined validation mechanism
 +                      This mechanism can repair the evaluation result to make
 +                      the return objects more ACPI specification compliant.
 +                      This option is useful for developers to identify the
 +                      root cause of an AML interpreter issue when the issue
 +                      has something to do with the repair mechanism.
 +
        acpi.debug_layer=       [HW,ACPI,ACPI_DEBUG]
        acpi.debug_level=       [HW,ACPI,ACPI_DEBUG]
                        Format: <int>
                        unusable.  The "log_buf_len" parameter may be useful
                        if you need to capture more output.
  
 +      acpi_enforce_resources= [ACPI]
 +                      { strict | lax | no }
 +                      Check for resource conflicts between native drivers
 +                      and ACPI OperationRegions (SystemIO and SystemMemory
 +                      only). IO ports and memory declared in ACPI might be
 +                      used by the ACPI subsystem in arbitrary AML code and
 +                      can interfere with legacy drivers.
 +                      strict (default): access to resources claimed by ACPI
 +                      is denied; legacy drivers trying to access reserved
 +                      resources will fail to bind to device using them.
 +                      lax: access to resources claimed by ACPI is allowed;
 +                      legacy drivers trying to access reserved resources
 +                      will bind successfully but a warning message is logged.
 +                      no: ACPI OperationRegions are not marked as reserved,
 +                      no further checks are performed.
 +
        acpi_force_table_verification   [HW,ACPI]
                        Enable table checksum verification during early stage.
                        By default, this is disabled due to x86 early mapping
                        This feature is enabled by default.
                        This option allows to turn off the feature.
  
 +      acpi_no_memhotplug [ACPI] Disable memory hotplug.  Useful for kdump
 +                         kernels.
 +
        acpi_no_static_ssdt     [HW,ACPI]
                        Disable installation of static SSDTs at early boot time
                        By default, SSDTs contained in the RSDT/XSDT will be
                        dynamic table installation which will install SSDT
                        tables to /sys/firmware/acpi/tables/dynamic.
  
 -      acpica_no_return_repair [HW, ACPI]
 -                      Disable AML predefined validation mechanism
 -                      This mechanism can repair the evaluation result to make
 -                      the return objects more ACPI specification compliant.
 -                      This option is useful for developers to identify the
 -                      root cause of an AML interpreter issue when the issue
 -                      has something to do with the repair mechanism.
 +      acpi_rsdp=      [ACPI,EFI,KEXEC]
 +                      Pass the RSDP address to the kernel, mostly used
 +                      on machines running EFI runtime service to boot the
 +                      second kernel for kdump.
  
        acpi_os_name=   [HW,ACPI] Tell ACPI BIOS the name of the OS
                        Format: To spoof as Windows 98: ="Microsoft Windows"
  
+       acpi_rev_override [ACPI] Override the _REV object to return 5 (instead
+                       of 2 which is mandated by ACPI 6) as the supported ACPI
+                       specification revision (when using this switch, it may
+                       be necessary to carry out a cold reboot _twice_ in a
+                       row to make it take effect on the platform firmware).
        acpi_osi=       [HW,ACPI] Modify list of supported OS interface strings
                        acpi_osi="string1"      # add string1
                        acpi_osi="!string2"     # remove string2
                        Use timer override. For some broken Nvidia NF5 boards
                        that require a timer override, but don't have HPET
  
 -      acpi_enforce_resources= [ACPI]
 -                      { strict | lax | no }
 -                      Check for resource conflicts between native drivers
 -                      and ACPI OperationRegions (SystemIO and SystemMemory
 -                      only). IO ports and memory declared in ACPI might be
 -                      used by the ACPI subsystem in arbitrary AML code and
 -                      can interfere with legacy drivers.
 -                      strict (default): access to resources claimed by ACPI
 -                      is denied; legacy drivers trying to access reserved
 -                      resources will fail to bind to device using them.
 -                      lax: access to resources claimed by ACPI is allowed;
 -                      legacy drivers trying to access reserved resources
 -                      will bind successfully but a warning message is logged.
 -                      no: ACPI OperationRegions are not marked as reserved,
 -                      no further checks are performed.
 -
 -      acpi_no_memhotplug [ACPI] Disable memory hotplug.  Useful for kdump
 -                         kernels.
 -
        add_efi_memmap  [EFI; X86] Include EFI memory map in
                        kernel's map of available physical RAM.
  
        cpuidle.off=1   [CPU_IDLE]
                        disable the cpuidle sub-system
  
 +      cpu_init_udelay=N
 +                      [X86] Delay for N microsec between assert and de-assert
 +                      of APIC INIT to start processors.  This delay occurs
 +                      on every CPU online, such as boot, and resume from suspend.
 +                      Default: 10000
 +
        cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
                        Format:
                        <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
                        Enable debug messages at boot time.  See
                        Documentation/dynamic-debug-howto.txt for details.
  
 +      nompx           [X86] Disables Intel Memory Protection Extensions.
 +                      See Documentation/x86/intel_mpx.txt for more
 +                      information about the feature.
 +
        eagerfpu=       [X86]
                        on      enable eager fpu restore
                        off     disable eager fpu restore
                        auto    selects the default scheme, which automatically
                                enables eagerfpu restore for xsaveopt.
  
 +      module.async_probe [KNL]
 +                      Enable asynchronous probe on this module.
 +
        early_ioremap_debug [KNL]
                        Enable debug messages in early_ioremap support. This
                        is useful for tracking down temporary early mappings
                uart[8250],io,<addr>[,options]
                uart[8250],mmio,<addr>[,options]
                uart[8250],mmio32,<addr>[,options]
 +              uart[8250],mmio32be,<addr>[,options]
                uart[8250],0x<addr>[,options]
                        Start an early, polled-mode console on the 8250/16550
                        UART at the specified I/O port or MMIO address.
                        MMIO inter-register address stride is either 8-bit
 -                      (mmio) or 32-bit (mmio32).
 -                      If none of [io|mmio|mmio32], <addr> is assumed to be
 -                      equivalent to 'mmio'. 'options' are specified in the
 -                      same format described for "console=ttyS<n>"; if
 +                      (mmio) or 32-bit (mmio32 or mmio32be).
 +                      If none of [io|mmio|mmio32|mmio32be], <addr> is assumed
 +                      to be equivalent to 'mmio'. 'options' are specified
 +                      in the same format described for "console=ttyS<n>"; if
                        unspecified, the h/w is not initialized.
  
                pl011,<addr>
                        earlyprintk=serial[,0x...[,baudrate]]
                        earlyprintk=ttySn[,baudrate]
                        earlyprintk=dbgp[debugController#]
 +                      earlyprintk=pciserial,bus:device.function[,baudrate]
  
                        earlyprintk is useful when the kernel crashes before
                        the normal console is initialized. It is not enabled by
                        The list of supported hash algorithms is defined
                        in crypto/hash_info.h.
  
 -      ima_tcb         [IMA]
 +      ima_policy=     [IMA]
 +                      The builtin measurement policy to load during IMA
 +                      setup.  Specyfing "tcb" as the value, measures all
 +                      programs exec'd, files mmap'd for exec, and all files
 +                      opened with the read mode bit set by either the
 +                      effective uid (euid=0) or uid=0.
 +                      Format: "tcb"
 +
 +      ima_tcb         [IMA] Deprecated.  Use ima_policy= instead.
                        Load a policy which meets the needs of the Trusted
                        Computing Base.  This means IMA will measure all
                        programs exec'd, files mmap'd for exec, and all files
  
        ima_template=   [IMA]
                        Select one of defined IMA measurements template formats.
 -                      Formats: { "ima" | "ima-ng" }
 +                      Formats: { "ima" | "ima-ng" | "ima-sig" }
                        Default: "ima-ng"
  
        ima_template_fmt=
                        By default, super page will be supported if Intel IOMMU
                        has the capability. With this option, super page will
                        not be supported.
 +              ecs_off [Default Off]
 +                      By default, extended context tables will be supported if
 +                      the hardware advertises that it has support both for the
 +                      extended tables themselves, and also PASID support. With
 +                      this option set, extended tables will not be used even
 +                      on hardware which claims to support them.
  
        intel_idle.max_cstate=  [KNL,HW,ACPI,X86]
                        0       disables intel_idle and fall back on acpi_idle.
  
                        * [no]ncq: Turn on or off NCQ.
  
 +                      * [no]ncqtrim: Turn off queued DSM TRIM.
 +
                        * nohrst, nosrst, norst: suppress hard, soft
                            and both resets.
  
  
        nomca           [IA-64] Disable machine check abort handling
  
 -      nomce           [X86-32] Machine Check Exception
 +      nomce           [X86-32] Disable Machine Check Exception
  
        nomfgpt         [X86-32] Disable Multi-Function General Purpose
                        Timer usage (for AMD Geode machines).
                        Set maximum number of finished RCU callbacks to
                        process in one batch.
  
 +      rcutree.dump_tree=      [KNL]
 +                      Dump the structure of the rcu_node combining tree
 +                      out at early boot.  This is used for diagnostic
 +                      purposes, to verify correct tree setup.
 +
 +      rcutree.gp_cleanup_delay=       [KNL]
 +                      Set the number of jiffies to delay each step of
 +                      RCU grace-period cleanup.  This only has effect
 +                      when CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP is set.
 +
        rcutree.gp_init_delay=  [KNL]
                        Set the number of jiffies to delay each step of
                        RCU grace-period initialization.  This only has
 -                      effect when CONFIG_RCU_TORTURE_TEST_SLOW_INIT is
 -                      set.
 +                      effect when CONFIG_RCU_TORTURE_TEST_SLOW_INIT
 +                      is set.
 +
 +      rcutree.gp_preinit_delay=       [KNL]
 +                      Set the number of jiffies to delay each step of
 +                      RCU grace-period pre-initialization, that is,
 +                      the propagation of recent CPU-hotplug changes up
 +                      the rcu_node combining tree.  This only has effect
 +                      when CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT is set.
 +
 +      rcutree.rcu_fanout_exact= [KNL]
 +                      Disable autobalancing of the rcu_node combining
 +                      tree.  This is used by rcutorture, and might
 +                      possibly be useful for architectures having high
 +                      cache-to-cache transfer latencies.
  
        rcutree.rcu_fanout_leaf= [KNL]
                        Increase the number of CPUs assigned to each
                        test, hence the "fake".
  
        rcutorture.nreaders= [KNL]
 -                      Set number of RCU readers.
 +                      Set number of RCU readers.  The value -1 selects
 +                      N-1, where N is the number of CPUs.  A value
 +                      "n" less than -1 selects N-n-2, where N is again
 +                      the number of CPUs.  For example, -2 selects N
 +                      (the number of CPUs), -3 selects N+1, and so on.
  
        rcutorture.object_debug= [KNL]
                        Enable debug-object double-call_rcu() testing.
diff --combined drivers/acpi/Kconfig
index f15db002be8ec238dabac8114e862b8ec140255a,2b652f1d4edb9279ba576cfde69262666fab5d58..114cf48085abd34eacb341fae1f246e2fdfb4b41
@@@ -54,9 -54,6 +54,9 @@@ config ACPI_GENERIC_GS
  config ACPI_SYSTEM_POWER_STATES_SUPPORT
        bool
  
 +config ACPI_CCA_REQUIRED
 +      bool
 +
  config ACPI_SLEEP
        bool
        depends on SUSPEND || HIBERNATION
@@@ -65,7 -62,7 +65,7 @@@
  
  config ACPI_PROCFS_POWER
        bool "Deprecated power /proc/acpi directories"
 -      depends on PROC_FS
 +      depends on X86 && PROC_FS
        help
          For backwards compatibility, this option allows
            deprecated power /proc/acpi/ directories to exist, even when
  
          Say N to delete power /proc/acpi/ directories that have moved to /sys/
  
+ config ACPI_REV_OVERRIDE_POSSIBLE
+       bool "Allow supported ACPI revision to be overriden"
+       depends on X86
+       default y
+       help
+         The platform firmware on some systems expects Linux to return "5" as
+         the supported ACPI revision which makes it expose system configuration
+         information in a special way.
+         For example, based on what ACPI exports as the supported revision,
+         Dell XPS 13 (2015) configures its audio device to either work in HDA
+         mode or in I2S mode, where the former is supposed to be used on Linux
+         until the latter is fully supported (in the kernel as well as in user
+         space).
+         This option enables a DMI-based quirk for the above Dell machine (so
+         that HDA audio is exposed by the platform firmware to the kernel) and
+         makes it possible to force the kernel to return "5" as the supported
+         ACPI revision via the "acpi_rev_override" command line switch.
  config ACPI_EC_DEBUGFS
        tristate "EC read/write access through /sys/kernel/debug/ec"
        default n
@@@ -386,32 -403,6 +406,32 @@@ config ACPI_REDUCED_HARDWARE_ONL
  
          If you are unsure what to do, do not enable this option.
  
 +config ACPI_NFIT
 +      tristate "ACPI NVDIMM Firmware Interface Table (NFIT)"
 +      depends on PHYS_ADDR_T_64BIT
 +      depends on BLK_DEV
 +      select LIBNVDIMM
 +      help
 +        Infrastructure to probe ACPI 6 compliant platforms for
 +        NVDIMMs (NFIT) and register a libnvdimm device tree.  In
 +        addition to storage devices this also enables libnvdimm to pass
 +        ACPI._DSM messages for platform/dimm configuration.
 +
 +        To compile this driver as a module, choose M here:
 +        the module will be called nfit.
 +
 +config ACPI_NFIT_DEBUG
 +      bool "NFIT DSM debug"
 +      depends on ACPI_NFIT
 +      depends on DYNAMIC_DEBUG
 +      default n
 +      help
 +        Enabling this option causes the nfit driver to dump the
 +        input and output buffers of _DSM operations on the ACPI0012
 +        device and its children.  This can be very verbose, so leave
 +        it disabled unless you are debugging a hardware / firmware
 +        issue.
 +
  source "drivers/acpi/apei/Kconfig"
  
  config ACPI_EXTLOG
diff --combined drivers/acpi/internal.h
index 787c629bc9b41e83ac11496f76bb646437d3b077,42f3042888293cc3cc7f3c07994e6a18eb67d90c..4683a96932b917fcc5f3efc04e290eb07012efad
@@@ -58,6 -58,7 +58,7 @@@ void acpi_cmos_rtc_init(void)
  #else
  static inline void acpi_cmos_rtc_init(void) {}
  #endif
+ int acpi_rev_override_setup(char *str);
  
  extern bool acpi_force_hot_remove;
  
@@@ -138,8 -139,6 +139,8 @@@ struct acpi_ec 
        struct transaction *curr;
        spinlock_t lock;
        struct work_struct work;
 +      unsigned long timestamp;
 +      unsigned long nr_pending_queries;
  };
  
  extern struct acpi_ec *first_ec;
@@@ -183,11 -182,16 +184,11 @@@ static inline int suspend_nvs_save(void
  static inline void suspend_nvs_restore(void) {}
  #endif
  
 -/*--------------------------------------------------------------------------
 -                                      Video
 -  -------------------------------------------------------------------------- */
 -#if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE)
 -bool acpi_osi_is_win8(void);
 -#endif
 -
  /*--------------------------------------------------------------------------
                                Device properties
    -------------------------------------------------------------------------- */
 +#define ACPI_DT_NAMESPACE_HID "PRP0001"
 +
  void acpi_init_properties(struct acpi_device *adev);
  void acpi_free_properties(struct acpi_device *adev);
  
diff --combined drivers/acpi/osl.c
index a5dc9034efeeda6f06044521600518f70bd322d3,37e592798cd5212d76074fdac28ac7ac27181702..c262e4acd68d827cba1273d79e28515c6ebe95fa
@@@ -175,10 -175,14 +175,10 @@@ static void __init acpi_request_region 
        if (!addr || !length)
                return;
  
 -      /* Resources are never freed */
 -      if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO)
 -              request_region(addr, length, desc);
 -      else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
 -              request_mem_region(addr, length, desc);
 +      acpi_reserve_region(addr, length, gas->space_id, 0, desc);
  }
  
 -static int __init acpi_reserve_resources(void)
 +static void __init acpi_reserve_resources(void)
  {
        acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length,
                "ACPI PM1a_EVT_BLK");
        if (!(acpi_gbl_FADT.gpe1_block_length & 0x1))
                acpi_request_region(&acpi_gbl_FADT.xgpe1_block,
                               acpi_gbl_FADT.gpe1_block_length, "ACPI GPE1_BLK");
 -
 -      return 0;
  }
 -device_initcall(acpi_reserve_resources);
  
  void acpi_os_printf(const char *fmt, ...)
  {
@@@ -530,13 -537,26 +530,26 @@@ acpi_os_get_physical_address(void *virt
  }
  #endif
  
+ #ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
+ static bool acpi_rev_override;
+ int __init acpi_rev_override_setup(char *str)
+ {
+       acpi_rev_override = true;
+       return 1;
+ }
+ __setup("acpi_rev_override", acpi_rev_override_setup);
+ #else
+ #define acpi_rev_override     false
+ #endif
  #define ACPI_MAX_OVERRIDE_LEN 100
  
  static char acpi_os_name[ACPI_MAX_OVERRIDE_LEN];
  
  acpi_status
  acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
 -                          acpi_string * new_val)
 +                          char **new_val)
  {
        if (!init_val || !new_val)
                return AE_BAD_PARAMETER;
                *new_val = acpi_os_name;
        }
  
+       if (!memcmp(init_val->name, "_REV", 4) && acpi_rev_override) {
+               printk(KERN_INFO PREFIX "Overriding _REV return value to 5\n");
+               *new_val = (char *)5;
+       }
        return AE_OK;
  }
  
@@@ -1680,12 -1705,6 +1698,12 @@@ int acpi_resources_are_enforced(void
  }
  EXPORT_SYMBOL(acpi_resources_are_enforced);
  
 +bool acpi_osi_is_win8(void)
 +{
 +      return acpi_gbl_osi_data >= ACPI_OSI_WIN_8;
 +}
 +EXPORT_SYMBOL(acpi_osi_is_win8);
 +
  /*
   * Deallocate the memory for a spinlock.
   */
@@@ -1844,7 -1863,6 +1862,7 @@@ acpi_status __init acpi_os_initialize(v
  
  acpi_status __init acpi_os_initialize1(void)
  {
 +      acpi_reserve_resources();
        kacpid_wq = alloc_workqueue("kacpid", 0, 1);
        kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 1);
        kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0);