1. 04 2月, 2021 1 次提交
    • M
      ACPI: Execute platform _OSC also with query bit clear · 719e1f56
      Mario Limonciello 提交于
      The platform _OSC can change the hardware state when query bit is not
      set. According to ACPI spec it is recommended that the OS runs _OSC with
      query bit set until the platform does not mask any of the capabilities.
      Then it should run it with query bit clear in order to actually commit
      the changes. Linux has not been doing this for the reasons that there
      has not been anything to commit, until now.
      
      The ACPI 6.4 introduced _OSC for USB4 to allow the OS to negotiate
      native control over USB4 tunneling. The platform might implement this so
      that it only activates the software connection manager path when the OS
      calls the _OSC with the query bit clear. Otherwise it may default to the
      firmware connection manager, for instance.
      
      For this reason modify the _OSC support so that we first execute it with
      query bit set, then use the returned value as base of the features we
      want to control and run the _OSC again with query bit clear. This also
      follows what Windows is doing.
      
      Also rename the function to better match what it does.
      Signed-off-by: NMario Limonciello <mario.limonciello@dell.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      719e1f56
  2. 03 10月, 2020 1 次提交
  3. 03 9月, 2020 1 次提交
  4. 29 11月, 2019 1 次提交
    • V
      ACPI: bus: Fix NULL pointer check in acpi_bus_get_private_data() · 627ead72
      Vamshi K Sthambamkadi 提交于
      kmemleak reported backtrace:
          [<bbee0454>] kmem_cache_alloc_trace+0x128/0x260
          [<6677f215>] i2c_acpi_install_space_handler+0x4b/0xe0
          [<1180f4fc>] i2c_register_adapter+0x186/0x400
          [<6083baf7>] i2c_add_adapter+0x4e/0x70
          [<a3ddf966>] intel_gmbus_setup+0x1a2/0x2c0 [i915]
          [<84cb69ae>] i915_driver_probe+0x8d8/0x13a0 [i915]
          [<81911d4b>] i915_pci_probe+0x48/0x160 [i915]
          [<4b159af1>] pci_device_probe+0xdc/0x160
          [<b3c64704>] really_probe+0x1ee/0x450
          [<bc029f5a>] driver_probe_device+0x142/0x1b0
          [<d8829d20>] device_driver_attach+0x49/0x50
          [<de71f045>] __driver_attach+0xc9/0x150
          [<df33ac83>] bus_for_each_dev+0x56/0xa0
          [<80089bba>] driver_attach+0x19/0x20
          [<cc73f583>] bus_add_driver+0x177/0x220
          [<7b29d8c7>] driver_register+0x56/0xf0
      
      In i2c_acpi_remove_space_handler(), a leak occurs whenever the
      "data" parameter is initialized to 0 before being passed to
      acpi_bus_get_private_data().
      
      This is because the NULL pointer check in acpi_bus_get_private_data()
      (condition->if(!*data)) returns EINVAL and, in consequence, memory is
      never freed in i2c_acpi_remove_space_handler().
      
      Fix the NULL pointer check in acpi_bus_get_private_data() to follow
      the analogous check in acpi_get_data_full().
      Signed-off-by: NVamshi K Sthambamkadi <vamshi.k.sthambamkadi@gmail.com>
      [ rjw: Subject & changelog ]
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      627ead72
  5. 31 5月, 2019 1 次提交
    • T
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 · c942fddf
      Thomas Gleixner 提交于
      Based on 3 normalized pattern(s):
      
        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 see the gnu general public license for more details
      
        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 [author] [kishon] [vijay] [abraham]
        [i] [kishon]@[ti] [com] 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 see
        the gnu general public license for more details
      
        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 [author] [graeme] [gregory]
        [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
        [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
        [hk] [hemahk]@[ti] [com] 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 see the gnu general public license for more details
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 1105 file(s).
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAllison Randal <allison@lohutok.net>
      Reviewed-by: NRichard Fontana <rfontana@redhat.com>
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c942fddf
  6. 25 3月, 2019 1 次提交
  7. 27 2月, 2019 1 次提交
  8. 07 2月, 2019 1 次提交
  9. 16 1月, 2019 1 次提交
    • R
      ACPI: EC: Look for ECDT EC after calling acpi_load_tables() · b1c03308
      Rafael J. Wysocki 提交于
      Some systems have had functional issues since commit 5a8361f7
      (ACPICA: Integrate package handling with module-level code) that,
      among other things, changed the initial values of the
      acpi_gbl_group_module_level_code and acpi_gbl_parse_table_as_term_list
      global flags in ACPICA which implicitly caused acpi_ec_ecdt_probe() to
      be called before acpi_load_tables() on the vast majority of platforms.
      
      Namely, before commit 5a8361f7, acpi_load_tables() was called from
      acpi_early_init() if acpi_gbl_parse_table_as_term_list was FALSE and
      acpi_gbl_group_module_level_code was TRUE, which almost always was
      the case as FALSE and TRUE were their initial values, respectively.
      The acpi_gbl_parse_table_as_term_list value would be changed to TRUE
      for a couple of platforms in acpi_quirks_dmi_table[], but it remained
      FALSE in the vast majority of cases.
      
      After commit 5a8361f7, the initial values of the two flags have
      been reversed, so in effect acpi_load_tables() has not been called
      from acpi_early_init() any more.  That, in turn, affects
      acpi_ec_ecdt_probe() which is invoked before acpi_load_tables() now
      and it is not possible to evaluate the _REG method for the EC address
      space handler installed by it.  That effectively causes the EC address
      space to be inaccessible to AML on platforms with an ECDT matching the
      EC device definition in the DSDT and functional problems ensue in
      there.
      
      Because the default behavior before commit 5a8361f7 was to call
      acpi_ec_ecdt_probe() after acpi_load_tables(), it should be safe to
      do that again.  Moreover, the EC address space handler installed by
      acpi_ec_ecdt_probe() is only needed for AML to be able to access the
      EC address space and the only AML that can run during acpi_load_tables()
      is module-level code which only is allowed to access address spaces
      with default handlers (memory, I/O and PCI config space).
      
      For this reason, move the acpi_ec_ecdt_probe() invocation back to
      acpi_bus_init(), from where it was taken away by commit d737f333
      (ACPI: probe ECDT before loading AML tables regardless of module-level
      code flag), and put it after the invocation of acpi_load_tables() to
      restore the original code ordering from before commit 5a8361f7.
      
      Fixes: 5a8361f7 ("ACPICA: Integrate package handling with module-level code")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=199981Reported-by: Nstep-ali <sunmooon15@gmail.com>
      Reported-by: NCharles Stanhope <charles.stanhope@gmail.com>
      Tested-by: NCharles Stanhope <charles.stanhope@gmail.com>
      Reported-by: NPaulo Nascimento <paulo.ulusu@googlemail.com>
      Reported-by: NDavid Purton <dcpurton@marshwiggle.net>
      Reported-by: NAdam Harvey <adam@adamharvey.name>
      Reported-by: NZhang Rui <rui.zhang@intel.com>
      Tested-by: NZhang Rui <rui.zhang@intel.com>
      Tested-by: NJean-Marc Lenoir <archlinux@jihemel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b1c03308
  10. 27 11月, 2018 1 次提交
  11. 18 10月, 2018 1 次提交
  12. 06 9月, 2018 1 次提交
    • J
      ACPI / bus: Only call dmi_check_system() on X86 · 5d128fbd
      Jean Delvare 提交于
      Calling dmi_check_system() early only works on X86. Other
      architectures initialize the DMI subsystem later so it's not
      ready yet when ACPI itself gets initialized.
      
      In the best case it results in a useless call to a function which
      will do nothing. But depending on the dmi implementation, it could
      also result in warnings. Best is to not call the function when it
      can't work and isn't needed.
      
      Additionally, if anyone ever needs to add non-x86 quirks, it would
      surprisingly not work, so document the limitation to avoid confusion.
      Signed-off-by: NJean Delvare <jdelvare@suse.de>
      Fixes: cce4f632 (ACPI: fix early DSDT dmi check warnings on ia64)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5d128fbd
  13. 09 8月, 2018 1 次提交
  14. 20 7月, 2018 1 次提交
  15. 19 3月, 2018 1 次提交
  16. 12 2月, 2018 4 次提交
  17. 07 2月, 2018 1 次提交
  18. 04 2月, 2018 2 次提交
  19. 13 12月, 2017 1 次提交
  20. 14 9月, 2017 1 次提交
  21. 20 7月, 2017 1 次提交
  22. 05 7月, 2017 1 次提交
  23. 07 6月, 2017 1 次提交
  24. 06 6月, 2017 1 次提交
  25. 27 4月, 2017 1 次提交
    • H
      ACPI / bus: Introduce a list of ids for "always present" devices · b7ecf663
      Hans de Goede 提交于
      Several Bay / Cherry Trail devices (all of which ship with Windows 10) hide
      the LPSS PWM controller in ACPI, typically the _STA method looks like this:
      
          Method (_STA, 0, NotSerialized)  // _STA: Status
          {
              If (OSID == One)
              {
                  Return (Zero)
              }
      
              Return (0x0F)
          }
      
      Where OSID is some dark magic seen in all Cherry Trail ACPI tables making
      the machine behave differently depending on which OS it *thinks* it is
      booting, this gets set in a number of ways which we cannot control, on
      some newer machines it simple hardcoded to "One" aka win10.
      
      This causes the PWM controller to get hidden, which means Linux cannot
      control the backlight level on cht based tablets / laptops.
      
      Since loading the driver for this does no harm (the only in kernel user
      of it is the i915 driver, which will only uses it when it needs it), this
      commit makes acpi_bus_get_status() always set status to ACPI_STA_DEFAULT
      for the LPSS PWM device, fixing the lack of backlight control.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      [ rjw: Rename the new file to utils.c ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b7ecf663
  26. 11 3月, 2017 1 次提交
  27. 07 2月, 2017 1 次提交
  28. 21 12月, 2016 1 次提交
  29. 30 11月, 2016 1 次提交
  30. 25 11月, 2016 2 次提交
  31. 26 9月, 2016 1 次提交
  32. 22 9月, 2016 1 次提交
  33. 13 9月, 2016 1 次提交
  34. 22 7月, 2016 1 次提交
    • S
      ACPI / processor_idle: Add support for Low Power Idle(LPI) states · a36a7fec
      Sudeep Holla 提交于
      ACPI 6.0 introduced an optional object _LPI that provides an alternate
      method to describe Low Power Idle states. It defines the local power
      states for each node in a hierarchical processor topology. The OSPM can
      use _LPI object to select a local power state for each level of processor
      hierarchy in the system. They used to produce a composite power state
      request that is presented to the platform by the OSPM.
      
      Since multiple processors affect the idle state for any non-leaf hierarchy
      node, coordination of idle state requests between the processors is
      required. ACPI supports two different coordination schemes: Platform
      coordinated and  OS initiated.
      
      This patch adds initial support for Platform coordination scheme of LPI.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a36a7fec
  35. 09 7月, 2016 1 次提交