1. 10 Jan, 2022 1 commit
    • Rafael J. Wysocki's avatar
      Merge branches 'acpi-scan', 'acpi-pm', 'acpi-power' and 'acpi-pci' · b659ea76
      Rafael J. Wysocki authored
      Merge ACPI device enumeration updates, ACPI power management updates
      and PCI host bridge ACPI driver updates for 5.17-rc1:
      
       - Introduce acpi_fetch_acpi_dev() as a replacement for
         acpi_bus_get_device() and use it in the ACPI subsystem (Rafael
         Wysocki).
      
       - Avoid using _CID for device enumaration if _HID is missing or
         invalid (Rafael Wysocki).
      
       - Rework quirk handling during ACPI device enumeration and add some
         new quirks for known broken platforms (Hans de Goede).
      
       - Avoid unnecessary or redundant CPU cache flushing during system
         PM transitions (Kirill A. Shutemov).
      
       - Add PM debug messages related to power resources (Rafael Wysocki).
      
       - Fix kernel-doc comment in the PCI host bridge ACPI driver (Yang Li).
      
      * acpi-scan:
        serdev: Do not instantiate serdevs on boards with known bogus DSDT entries
        i2c: acpi: Do not instantiate I2C-clients on boards with known bogus DSDT entries
        ACPI / x86: Add acpi_quirk_skip_[i2c_client|serdev]_enumeration() helpers
        ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes
        ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device()
        ACPI: scan: Introduce acpi_fetch_acpi_dev()
        ACPI: scan: Do not add device IDs from _CID if _HID is not valid
      
      * acpi-pm:
        ACPI: PM: Remove redundant cache flushing
        ACPI: PM: Avoid CPU cache flush when entering S4
      
      * acpi-power:
        ACPI: PM: Emit debug messages when enabling/disabling wakeup power
      
      * acpi-pci:
        PCI/ACPI: Fix acpi_pci_osc_control_set() kernel-doc comment
      b659ea76
  2. 04 Jan, 2022 1 commit
    • Sudeep Holla's avatar
      ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype · 77e2a047
      Sudeep Holla authored
      PCC OpRegion provides a mechanism to communicate with the platform
      directly from the AML. PCCT provides the list of PCC channel available
      in the platform, a subset or all of them can be used in PCC Opregion.
      
      This patch registers the PCC OpRegion handler before ACPI tables are
      loaded. This relies on the special context data passed to identify and
      set up the PCC channel before the OpRegion handler is executed for the
      first time.
      
      Typical PCC Opregion declaration looks like this:
      
      OperationRegion (PFRM, PCC, 2, 0x74)
      Field (PFRM, ByteAcc, NoLock, Preserve)
      {
          SIGN,   32,
          FLGS,   32,
          LEN,    32,
          CMD,    32,
          DATA,   800
      }
      
      It contains four named double words followed by 100 bytes of buffer
      names DATA.
      
      ASL can fill out the buffer something like:
      
          /* Create global or local buffer */
          Name (BUFF, Buffer (0x0C){})
          /* Create double word fields over the buffer */
          CreateDWordField (BUFF, 0x0, WD0)
          CreateDWordField (BUFF, 0x04, WD1)
          CreateDWordField (BUFF, 0x08, WD2)
      
          /* Fill the named fields */
          WD0 = 0x50434300
          SIGN = BUFF
          WD0 = 1
          FLGS = BUFF
          WD0 = 0x10
          LEN = BUFF
      
          /* Fill the payload in the DATA buffer */
          WD0 = 0
          WD1 = 0x08
          WD2 = 0
          DATA = BUFF
      
          /* Write to CMD field to trigger handler */
          WD0 = 0x4404
          CMD = BUFF
      
      This buffer is received by acpi_pcc_opregion_space_handler. This
      handler will fetch the complete buffer via internal_pcc_buffer.
      
      The setup handler will receive the special PCC context data which will
      contain the PCC channel index which used to set up the channel. The
      buffer pointer and length is saved in region context which is then used
      in the handler.
      
      (kernel test robot: Build failure with CONFIG_ACPI_DEBUGGER)
      Link: https://lore.kernel.org/r/202201041539.feAV0l27-lkp@intel.comReported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      77e2a047
  3. 30 Dec, 2021 5 commits
    • Hans de Goede's avatar
      serdev: Do not instantiate serdevs on boards with known bogus DSDT entries · 0890186a
      Hans de Goede authored
      x86 ACPI devices which ship with only Android as their factory image use
      older kernels which do not yet support ACPI serdev enumeration, as such
      the serdev information in their ACPI tables is not reliable.
      
      For example on the Asus ME176C tablet the serdev describing the Bluetooth
      HCI points to the serdev_controller connected to the GPS and the other way
      around.
      
      Use the new acpi_quirk_skip_serdev_enumeration() helper to identify
      known boards with this issue and then either abort adding the serdev
      controller (creating a tty cdev instead) or only create the controller
      leaving the instantation of the serdev itself up to platform code.
      
      In the case where only the serdev controller is created the necessary
      serdevs will instead be instantiated by the
      drivers/platform/x86/x86-android-tablets.c kernel module.
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0890186a
    • Hans de Goede's avatar
      i2c: acpi: Do not instantiate I2C-clients on boards with known bogus DSDT entries · a6e1445c
      Hans de Goede authored
      x86 ACPI devices which ship with only Android as their factory image
      usually declare a whole bunch of bogus I2C devices in their ACPI tables.
      
      Instantiating I2C clients for these bogus devices causes various issues,
      e.g. GPIO/IRQ resource conflicts because sometimes drivers do bind to them.
      The Android x86 kernel fork shipped on these devices has some special code
      to remove these bogus devices, instead of just fixing the DSDT <sigh>.
      
      Use the new acpi_quirk_skip_i2c_client_enumeration() helper to identify
      known boards / acpi devices with this issue, and skip enumerating these.
      
      Note these boards typically do actually have I2C devices, just
      different ones then the ones described in their DSDT. The devices
      which are actually present are manually instantiated by the
      drivers/platform/x86/x86-android-tablets.c kernel module.
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarWolfram Sang <wsa@kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a6e1445c
    • Hans de Goede's avatar
      ACPI / x86: Add acpi_quirk_skip_[i2c_client|serdev]_enumeration() helpers · 35f9e773
      Hans de Goede authored
      x86 ACPI boards which ship with only Android as their factory image usually
      declare a whole bunch of bogus I2C devs in their ACPI tables and sometimes
      there are issues with serdev devices on these boards too, e.g. the resource
      points to the wrong serdev_controller.
      
      Instantiating I2C / serdev devs for these bogus devs causes various issues,
      e.g. GPIO/IRQ resource conflicts because sometimes drivers do bind to them.
      The Android x86 kernel fork shipped on these devices has some special code
      to remove the bogus I2C clients (and serdevs are ignored completely).
      
      Introduce acpi_quirk_skip_i2c_client_enumeration() and
      acpi_quirk_skip_serdev_enumeration() helpers. Which can be used by the I2C/
      serdev code to skip instantiating any I2C or serdev devs on broken boards.
      
      These 2 helpers are added to drivers/acpi/x86/utils.c so that the DMI table
      can be shared between the I2C and serdev code.
      
      Note these boards typically do actually have I2C and serdev devices, just
      different ones then the ones described in their DSDT. The devices which
      are actually present are manually instantiated by the
      drivers/platform/x86/x86-android-tablets.c kernel module.
      
      The new helpers are only build if CONFIG_X86_ANDROID_TABLETS is enabled,
      otherwise they are empty stubs to not unnecessarily grow the kernel size.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      35f9e773
    • Hans de Goede's avatar
      ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes · f85196bd
      Hans de Goede authored
      BCM4752 and LNV4752 ACPI nodes describe a Broadcom 4752 GPS module
      attached to an UART of the system.
      
      The GPS modules talk a custom protocol which only works with a closed-
      source Android gpsd daemon which knows this protocol.
      
      The ACPI nodes also describe GPIOs to turn the GPS on/off these are
      handled by the net/rfkill/rfkill-gpio.c code. This handling predates the
      addition of enumeration of ACPI instantiated serdevs to the kernel and
      was broken by that addition, because the ACPI scan code now no longer
      instantiates platform_device-s for these nodes.
      
      Rename the i2c_multi_instantiate_ids HID list to ignore_serial_bus_ids
      and add the BCM4752 and LNV4752 HIDs, so that rfkill-gpio gets
      a platform_device to bind to again; and so that a tty cdev for gpsd
      gets created for these.
      
      Fixes: e361d1f8 ("ACPI / scan: Fix enumeration for special UART devices")
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f85196bd
    • Yang Li's avatar
      PCI/ACPI: Fix acpi_pci_osc_control_set() kernel-doc comment · 843438de
      Yang Li authored
      Add the description of @support and remove @req in
      acpi_pci_osc_control_set() kernel-doc comment to remove warnings found
      by running scripts/kernel-doc, which is caused by using 'make W=1'.
      
      drivers/acpi/pci_root.c:337: warning: Excess function parameter 'req'
      description in 'acpi_pci_osc_control_set'
      drivers/acpi/pci_root.c:337: warning: Function parameter or member
      'support' not described in 'acpi_pci_osc_control_set'
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Fixes: 6bc779ee ("PCI/ACPI: Check for _OSC support in acpi_pci_osc_control_set()")
      Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      843438de
  4. 27 Dec, 2021 18 commits
  5. 26 Dec, 2021 4 commits
  6. 25 Dec, 2021 11 commits