]> Git Repo - J-linux.git/commitdiff
Merge tag 'acpi-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <[email protected]>
Mon, 26 Apr 2021 22:03:23 +0000 (15:03 -0700)
committerLinus Torvalds <[email protected]>
Mon, 26 Apr 2021 22:03:23 +0000 (15:03 -0700)
Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to the most recent upstream
  revision including (but not limited to) new material introduced in the
  6.4 version of the spec, update message printing in the ACPI-related
  code, address a few issues and clean up code in a number of places.

  Specifics:

   - Update ACPICA code in the kernel to upstream revision 20210331
     including the following changes:

      * Add parsing for IVRS IVHD 40h and device entry F0h (Alexander
        Monakov).

      * Add new CEDT table for CXL 2.0 and iASL support for it (Ben
        Widawsky, Bob Moore).

      * NFIT: add Location Cookie field (Bob Moore).

      * HMAT: add new fields/flags (Bob Moore).

      * Add new flags in SRAT (Bob Moore).

      * PMTT: add new fields/structures (Bob Moore).

      * Add CSI2Bus resource template (Bob Moore).

      * iASL: Decode subtable type field for VIOT (Bob Moore).

      * Fix various typos and spelling mistakes (Colin Ian King).

      * Add new predefined objects _BPC, _BPS, and _BPT (Erik Kaneda).

      * Add USB4 capabilities UUID (Erik Kaneda).

      * Add CXL ACPI device ID and _CBR object (Erik Kaneda).

      * MADT: add Multiprocessor Wakeup Structure (Erik Kaneda).

      * PCCT: add support for subtable type 5 (Erik Kaneda).

      * PPTT: add new version of subtable type 1 (Erik Kaneda).

      * Add SDEV secure access components (Erik Kaneda).

      * Add support for PHAT table (Erik Kaneda).

      * iASL: Add definitions for the VIOT table (Jean-Philippe
        Brucker).

      * acpisrc: Add missing conversion for VIOT support (Jean-Philippe
        Brucker).

      * IORT: Updates for revision E.b (Shameer Kolothum).

   - Rearrange message printing in ACPI-related code to avoid using the
     ACPICA's internal message printing macros outside ACPICA and do
     some related code cleanups (Rafael Wysocki).

   - Modify the device enumeration code to turn off all of the unused
     ACPI power resources at the end (Rafael Wysocki).

   - Change the ACPI power resources handling code to turn off unused
     ACPI power resources without checking their status which should not
     be necessary by the spec (Rafael Wysocki).

   - Add empty stubs for CPPC-related functions to be used when
     CONFIG_ACPI_CPPC_LIB is not set (Rafael Wysocki).

   - Simplify device enumeration code (Rafael Wysocki).

   - Change device enumeration code to use match_string() for string
     matching (Andy Shevchenko).

   - Modify irqresource_disabled() to retain the resouce flags that have
     been set already (Angela Czubak).

   - Add native backlight whitelist entry for GA401/GA502/GA503 (Luke
     Jones).

   - Modify the ACPI backlight driver to let the native backlight
     handling take over on hardware-reduced systems (Hans de Goede).

   - Introduce acpi_dev_get() and switch over the ACPI core code to
     using it (Andy Shevchenko).

   - Use kobj_attribute as callback argument instead of a local struct
     type in the CPPC linrary code (Nathan Chancellor).

   - Drop unneeded initializatio of a static variable from the ACPI
     processor driver (Tian Tao).

   - Drop unnecessary local variable assignment from the ACPI APEI code
     (Colin Ian King).

   - Document for_each_acpi_dev_match() macro (Andy Shevchenko).

   - Address assorted coding style issues in multiple places (Xiaofei
     Tan).

   - Capitalize TLAs in a few comments (Andy Shevchenko).

   - Correct assorted typos in comments (Tom Saeger)"

* tag 'acpi-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (68 commits)
  ACPI: video: use native backlight for GA401/GA502/GA503
  ACPI: APEI: remove redundant assignment to variable rc
  ACPI: utils: Capitalize abbreviations in the comments
  ACPI: utils: Document for_each_acpi_dev_match() macro
  ACPI: bus: Introduce acpi_dev_get() and reuse it in ACPI code
  ACPI: scan: Utilize match_string() API
  resource: Prevent irqresource_disabled() from erasing flags
  ACPI: CPPC: Replace cppc_attr with kobj_attribute
  ACPI: scan: Call acpi_get_object_info() from acpi_set_pnp_ids()
  ACPI: scan: Drop sta argument from acpi_init_device_object()
  ACPI: scan: Drop sta argument from acpi_add_single_object()
  ACPI: scan: Rearrange checks in acpi_bus_check_add()
  ACPI: scan: Fold acpi_bus_type_and_status() into its caller
  ACPI: video: Check LCD flag on ACPI-reduced-hardware devices
  ACPI: utils: Add acpi_reduced_hardware() helper
  ACPI: dock: fix some coding style issues
  ACPI: sysfs: fix some coding style issues
  ACPI: PM: add a missed blank line after declarations
  ACPI: custom_method: fix a coding style issue
  ACPI: CPPC: fix some coding style issues
  ...

1  2 
Documentation/admin-guide/kernel-parameters.txt
drivers/iio/light/acpi-als.c
include/linux/ioport.h

index 550cf2b2b7e8aeec5330f30dbf19668d3425aa0a,bda4e8e96969eae6e886be969fb9b1a9b4fadc7e..70a30f65bfca09ce4c259e87b39bf684b501bb84
@@@ -50,7 -50,7 +50,7 @@@
                        CONFIG_ACPI_DEBUG must be enabled to produce any ACPI
                        debug output.  Bits in debug_layer correspond to a
                        _COMPONENT in an ACPI source file, e.g.,
-                           #define _COMPONENT ACPI_PCI_COMPONENT
+                           #define _COMPONENT ACPI_EVENTS
                        Bits in debug_level correspond to a level in
                        ACPI_DEBUG_PRINT statements, e.g.,
                            ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
@@@ -60,8 -60,6 +60,6 @@@
  
                        Enable processor driver info messages:
                            acpi.debug_layer=0x20000000
-                       Enable PCI/PCI interrupt routing info messages:
-                           acpi.debug_layer=0x400000
                        Enable AML "Debug" output, i.e., stores to the Debug
                        object while interpreting AML:
                            acpi.debug_layer=0xffffffff acpi.debug_level=0x2
                                   state is kept private from the host.
                                   Not valid if the kernel is running in EL2.
  
 -                      Defaults to VHE/nVHE based on hardware support and
 -                      the value of CONFIG_ARM64_VHE.
 +                      Defaults to VHE/nVHE based on hardware support.
  
        kvm-arm.vgic_v3_group0_trap=
                        [KVM,ARM] Trap guest accesses to GICv3 group-0
  
        nr_uarts=       [SERIAL] maximum number of UARTs to be registered.
  
 -      numa_balancing= [KNL,X86] Enable or disable automatic NUMA balancing.
 +      numa_balancing= [KNL,ARM64,PPC,RISCV,S390,X86] Enable or disable automatic
 +                      NUMA balancing.
                        Allowed values are enable and disable
  
        numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
                        fully seed the kernel's CRNG. Default is controlled
                        by CONFIG_RANDOM_TRUST_CPU.
  
 +      randomize_kstack_offset=
 +                      [KNL] Enable or disable kernel stack offset
 +                      randomization, which provides roughly 5 bits of
 +                      entropy, frustrating memory corruption attacks
 +                      that depend on stack address determinism or
 +                      cross-syscall address exposures. This is only
 +                      available on architectures that have defined
 +                      CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET.
 +                      Format: <bool>  (1/Y/y=enable, 0/N/n=disable)
 +                      Default is CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT.
 +
        ras=option[,option,...] [KNL] RAS-specific options
  
                cec_disable     [X86]
        spia_peddr=
  
        split_lock_detect=
 -                      [X86] Enable split lock detection
 +                      [X86] Enable split lock detection or bus lock detection
  
                        When enabled (and if hardware support is present), atomic
                        instructions that access data across cache line
 -                      boundaries will result in an alignment check exception.
 +                      boundaries will result in an alignment check exception
 +                      for split lock detection or a debug exception for
 +                      bus lock detection.
  
                        off     - not enabled
  
 -                      warn    - the kernel will emit rate limited warnings
 +                      warn    - the kernel will emit rate-limited warnings
                                  about applications triggering the #AC
 -                                exception. This mode is the default on CPUs
 -                                that supports split lock detection.
 +                                exception or the #DB exception. This mode is
 +                                the default on CPUs that support split lock
 +                                detection or bus lock detection. Default
 +                                behavior is by #AC if both features are
 +                                enabled in hardware.
  
                        fatal   - the kernel will send SIGBUS to applications
 -                                that trigger the #AC exception.
 +                                that trigger the #AC exception or the #DB
 +                                exception. Default behavior is by #AC if
 +                                both features are enabled in hardware.
  
                        If an #AC exception is hit in the kernel or in
                        firmware (i.e. not while executing in user mode)
                        the kernel will oops in either "warn" or "fatal"
                        mode.
  
 +                      #DB exception for bus lock is triggered only when
 +                      CPL > 0.
 +
        srbds=          [X86,INTEL]
                        Control the Special Register Buffer Data Sampling
                        (SRBDS) mitigation.
                        See Documentation/admin-guide/mm/transhuge.rst
                        for more details.
  
 +      trusted.source= [KEYS]
 +                      Format: <string>
 +                      This parameter identifies the trust source as a backend
 +                      for trusted keys implementation. Supported trust
 +                      sources:
 +                      - "tpm"
 +                      - "tee"
 +                      If not specified then it defaults to iterating through
 +                      the trust source list starting with TPM and assigns the
 +                      first trust source as a backend which is initialized
 +                      successfully during iteration.
 +
        tsc=            Disable clocksource stability checks for TSC.
                        Format: <string>
                        [x86] reliable: mark tsc clocksource as reliable, this
index 30393f08e0825aa89e63b9381a1ce550283db704,5ad45f137af79d1d6f665e52248af7a0960a9229..0a6ab5761eece0ef9e87e8c483bf0d388214483b
  #include <linux/module.h>
  #include <linux/acpi.h>
  #include <linux/err.h>
 +#include <linux/irq.h>
  #include <linux/mutex.h>
  
  #include <linux/iio/iio.h>
  #include <linux/iio/buffer.h>
 -#include <linux/iio/kfifo_buf.h>
 +#include <linux/iio/trigger.h>
 +#include <linux/iio/triggered_buffer.h>
 +#include <linux/iio/trigger_consumer.h>
  
  #define ACPI_ALS_CLASS                        "als"
  #define ACPI_ALS_DEVICE_NAME          "acpi-als"
  #define ACPI_ALS_NOTIFY_ILLUMINANCE   0x80
  
- ACPI_MODULE_NAME("acpi-als");
  /*
   * So far, there's only one channel in here, but the specification for
   * ACPI0008 says there can be more to what the block can report. Like
@@@ -48,23 -43,24 +46,23 @@@ static const struct iio_chan_spec acpi_
                .info_mask_separate     = BIT(IIO_CHAN_INFO_RAW) |
                                          BIT(IIO_CHAN_INFO_PROCESSED),
        },
 +      IIO_CHAN_SOFT_TIMESTAMP(1),
  };
  
  /*
   * The event buffer contains timestamp and all the data from
   * the ACPI0008 block. There are multiple, but so far we only
 - * support _ALI (illuminance). Once someone adds new channels
 - * to acpi_als_channels[], the evt_buffer below will grow
 - * automatically.
 + * support _ALI (illuminance): One channel, padding and timestamp.
   */
 -#define ACPI_ALS_EVT_NR_SOURCES               ARRAY_SIZE(acpi_als_channels)
  #define ACPI_ALS_EVT_BUFFER_SIZE              \
 -      (sizeof(s64) + (ACPI_ALS_EVT_NR_SOURCES * sizeof(s32)))
 +      (sizeof(s32) + sizeof(s32) + sizeof(s64))
  
  struct acpi_als {
        struct acpi_device      *device;
        struct mutex            lock;
 +      struct iio_trigger      *trig;
  
 -      s32                     evt_buffer[ACPI_ALS_EVT_BUFFER_SIZE];
 +      s32 evt_buffer[ACPI_ALS_EVT_BUFFER_SIZE / sizeof(s32)]  __aligned(8);
  };
  
  /*
@@@ -93,7 -89,7 +91,7 @@@ static int acpi_als_read_value(struct a
                                       &temp_val);
  
        if (ACPI_FAILURE(status)) {
-               ACPI_EXCEPTION((AE_INFO, status, "Error reading ALS %s", prop));
+               acpi_evaluation_failure_warn(als->device->handle, prop, status);
                return -EIO;
        }
  
@@@ -106,19 -102,33 +104,19 @@@ static void acpi_als_notify(struct acpi
  {
        struct iio_dev *indio_dev = acpi_driver_data(device);
        struct acpi_als *als = iio_priv(indio_dev);
 -      s32 *buffer = als->evt_buffer;
 -      s64 time_ns = iio_get_time_ns(indio_dev);
 -      s32 val;
 -      int ret;
 -
 -      mutex_lock(&als->lock);
  
 -      memset(buffer, 0, ACPI_ALS_EVT_BUFFER_SIZE);
 -
 -      switch (event) {
 -      case ACPI_ALS_NOTIFY_ILLUMINANCE:
 -              ret = acpi_als_read_value(als, ACPI_ALS_ILLUMINANCE, &val);
 -              if (ret < 0)
 -                      goto out;
 -              *buffer++ = val;
 -              break;
 -      default:
 -              /* Unhandled event */
 -              dev_dbg(&device->dev, "Unhandled ACPI ALS event (%08x)!\n",
 -                      event);
 -              goto out;
 +      if (iio_buffer_enabled(indio_dev) && iio_trigger_using_own(indio_dev)) {
 +              switch (event) {
 +              case ACPI_ALS_NOTIFY_ILLUMINANCE:
 +                      iio_trigger_poll_chained(als->trig);
 +                      break;
 +              default:
 +                      /* Unhandled event */
 +                      dev_dbg(&device->dev,
 +                              "Unhandled ACPI ALS event (%08x)!\n",
 +                              event);
 +              }
        }
 -
 -      iio_push_to_buffers_with_timestamp(indio_dev, als->evt_buffer, time_ns);
 -
 -out:
 -      mutex_unlock(&als->lock);
  }
  
  static int acpi_als_read_raw(struct iio_dev *indio_dev,
@@@ -149,49 -159,13 +147,49 @@@ static const struct iio_info acpi_als_i
        .read_raw               = acpi_als_read_raw,
  };
  
 +static irqreturn_t acpi_als_trigger_handler(int irq, void *p)
 +{
 +      struct iio_poll_func *pf = p;
 +      struct iio_dev *indio_dev = pf->indio_dev;
 +      struct acpi_als *als = iio_priv(indio_dev);
 +      s32 *buffer = als->evt_buffer;
 +      s32 val;
 +      int ret;
 +
 +      mutex_lock(&als->lock);
 +
 +      ret = acpi_als_read_value(als, ACPI_ALS_ILLUMINANCE, &val);
 +      if (ret < 0)
 +              goto out;
 +      *buffer = val;
 +
 +      /*
 +       * When coming from own trigger via polls, set polling function
 +       * timestamp here. Given ACPI notifier is already in a thread and call
 +       * function directly, there is no need to set the timestamp in the
 +       * notify function.
 +       *
 +       * If the timestamp was actually 0, the timestamp is set one more time.
 +       */
 +      if (!pf->timestamp)
 +              pf->timestamp = iio_get_time_ns(indio_dev);
 +
 +      iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp);
 +out:
 +      mutex_unlock(&als->lock);
 +      iio_trigger_notify_done(indio_dev->trig);
 +
 +      return IRQ_HANDLED;
 +}
 +
  static int acpi_als_add(struct acpi_device *device)
  {
 -      struct acpi_als *als;
 +      struct device *dev = &device->dev;
        struct iio_dev *indio_dev;
 -      struct iio_buffer *buffer;
 +      struct acpi_als *als;
 +      int ret;
  
 -      indio_dev = devm_iio_device_alloc(&device->dev, sizeof(*als));
 +      indio_dev = devm_iio_device_alloc(dev, sizeof(*als));
        if (!indio_dev)
                return -ENOMEM;
  
  
        indio_dev->name = ACPI_ALS_DEVICE_NAME;
        indio_dev->info = &acpi_als_info;
 -      indio_dev->modes = INDIO_BUFFER_SOFTWARE;
        indio_dev->channels = acpi_als_channels;
        indio_dev->num_channels = ARRAY_SIZE(acpi_als_channels);
  
 -      buffer = devm_iio_kfifo_allocate(&device->dev);
 -      if (!buffer)
 +      als->trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name, indio_dev->id);
 +      if (!als->trig)
                return -ENOMEM;
  
 -      iio_device_attach_buffer(indio_dev, buffer);
 +      ret = devm_iio_trigger_register(dev, als->trig);
 +      if (ret)
 +              return ret;
 +      /*
 +       * Set hardware trigger by default to let events flow when
 +       * BIOS support notification.
 +       */
 +      indio_dev->trig = iio_trigger_get(als->trig);
 +
 +      ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
 +                                            iio_pollfunc_store_time,
 +                                            acpi_als_trigger_handler,
 +                                            NULL);
 +      if (ret)
 +              return ret;
  
 -      return devm_iio_device_register(&device->dev, indio_dev);
 +      return devm_iio_device_register(dev, indio_dev);
  }
  
  static const struct acpi_device_id acpi_als_device_ids[] = {
diff --combined include/linux/ioport.h
index 1de6c2e40c3248a0cee3e239b4178012b9b21a7b,647744d8514e0b766d0e55faacf40b246a2fb703..8359c50f99884248807f1df7d3990a9dd37663cf
@@@ -108,7 -108,6 +108,7 @@@ struct resource 
  #define IORESOURCE_MEM_32BIT          (3<<3)
  #define IORESOURCE_MEM_SHADOWABLE     (1<<5)  /* dup: IORESOURCE_SHADOWABLE */
  #define IORESOURCE_MEM_EXPANSIONROM   (1<<6)
 +#define IORESOURCE_MEM_NONPOSTED      (1<<7)
  
  /* PnP I/O specific bits (IORESOURCE_BITS) */
  #define IORESOURCE_IO_16BIT_ADDR      (1<<0)
@@@ -332,7 -331,7 +332,7 @@@ static inline void irqresource_disabled
  {
        res->start = irq;
        res->end = irq;
-       res->flags = IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET;
+       res->flags |= IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET;
  }
  
  extern struct address_space *iomem_get_mapping(void);
This page took 0.100239 seconds and 4 git commands to generate.