1. 30 6月, 2016 1 次提交
    • O
      ACPI: Execute _PTS before system reboot · 2c85025c
      Ocean He 提交于
      The _PTS control method is defined in the section 7.4.1 of acpi 6.0
      spec. The _PTS control method is executed by the OS during the sleep
      transition process for S1, S2, S3, S4, and for orderly S5 shutdown.
      
      The _PTS control method provides the BIOS a mechanism for performing
      some housekeeping, such as writing the sleep type value to the embedded
      controller, before entering the system sleeping state. Note that some
      Lenovo Server BIOS use this mechanism to detect reboot event and
      prompt user by popped dialog box.
      
      According to section 7.5 of acpi 6.0 spec, _PTS should run after _TTS.
      Add a _PTS evaulation to the existing _TTS reboot notifier and change
      the notifier name to reflect the fact that it's not for _TTS only any
      more.
      Signed-off-by: NOcean He <hehy1@lenovo.com>
      Signed-off-by: NNagananda Chumbalkar <nchumbalkar@lenovo.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2c85025c
  2. 09 4月, 2016 1 次提交
  3. 23 3月, 2016 1 次提交
    • L
      ACPI / PM: Runtime resume devices when waking from hibernate · fbda4b38
      Lukas Wunner 提交于
      Commit 58a1fbbb ("PM / PCI / ACPI: Kick devices that might have been
      reset by firmware") added a runtime resume for devices that were runtime
      suspended when the system entered suspend-to-RAM.
      
      Briefly, the motivation was to ensure that devices did not remain in a
      reset-power-on state after resume, potentially preventing deep SoC-wide
      low-power states from being entered on idle.
      
      Currently we're not doing the same when leaving suspend-to-disk and this
      asymmetry is a problem if drivers rely on the automatic resume triggered
      by pm_complete_with_resume_check(). Fix it.
      
      Fixes: 58a1fbbb (PM / PCI / ACPI: Kick devices that might have been reset by firmware)
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: 4.4+ <stable@vger.kernel.org> # 4.4+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fbda4b38
  4. 22 2月, 2016 1 次提交
  5. 05 1月, 2016 1 次提交
    • R
      ACPICA: Drop Linux-specific waking vector functions · e3e9b577
      Rafael J. Wysocki 提交于
      Commit f06147f9 (ACPICA: Hardware: Enable firmware waking vector
      for both 32-bit and 64-bit FACS) added three functions that aren't
      present in upstream ACPICA, acpi_hw_set_firmware_waking_vectors(),
      acpi_set_firmware_waking_vectors() and acpi_set_firmware_waking_vector64(),
      to allow Linux to use the previously existing API for setting the
      platform firmware waking vector.
      
      However, that wasn't necessary, since the ACPI sleep support code
      in Linux can be modified to use the upstream ACPICA's API easily
      and the additional functions may be dropped which reduces the code
      size and puts the kernel's ACPICA code more in line with the upstream.
      
      Make the changes as per the above.  While at it, make the relevant
      function desctiption comments reflect the upstream ACPICA's ones.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NLv Zheng <lv.zheng@intel.com>
      e3e9b577
  6. 26 10月, 2015 1 次提交
    • C
      ACPI / PM: Fix incorrect wakeup IRQ setting during suspend-to-idle · 8c01275e
      Chen Yu 提交于
      For an ACPI compatible system, the SCI (ACPI System Control
      Interrupt) is used to wake the system up from suspend-to-idle.
      Once the CPU is woken up by the SCI, the interrupt handler will
      first check if the current IRQ has been configured for system
      wakeup, so irq_pm_check_wakeup() is invoked to validate the IRQ
      number.  However, during suspend-to-idle, enable_irq_wake() is
      called for acpi_gbl_FADT.sci_interrupt, although the IRQ number
      that the SCI handler has been installed for should be passed to
      it instead.  Thus, if acpi_gbl_FADT.sci_interrupt happens to be
      different from that number, ACPI interrupts will not be able to
      wake up the system from sleep.
      
      Fix this problem by passing the IRQ number returned by
      acpi_gsi_to_irq() to enable_irq_wake() instead of
      acpi_gbl_FADT.sci_interrupt.
      
      Cc: 3.18+ <stable@vger.kernel.org> # 3.18+
      Acked-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NChen Yu <yu.c.chen@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8c01275e
  7. 14 10月, 2015 1 次提交
    • R
      PM / sleep: Add flags to indicate platform firmware involvement · ef25ba04
      Rafael J. Wysocki 提交于
      There are quite a few cases in which device drivers, bus types or
      even the PM core itself may benefit from knowing whether or not
      the platform firmware will be involved in the upcoming system power
      transition (during system suspend) or whether or not it was involved
      in it (during system resume).
      
      For this reason, introduce global system suspend flags that can be
      used by the platform code to expose that information for the benefit
      of the other parts of the kernel and make the ACPI core set them
      as appropriate.
      
      Users of the new flags will be added later.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ef25ba04
  8. 30 3月, 2015 1 次提交
  9. 18 3月, 2015 1 次提交
  10. 24 1月, 2015 1 次提交
  11. 02 12月, 2014 1 次提交
  12. 01 10月, 2014 1 次提交
    • R
      ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle · a8d46b9e
      Rafael J. Wysocki 提交于
      The ACPI GPE wakeup from suspend-to-idle is currently based on using
      the IRQF_NO_SUSPEND flag for the ACPI SCI, but that is problematic
      for a couple of reasons.  First, in principle the ACPI SCI may be
      shared and IRQF_NO_SUSPEND does not really work well with shared
      interrupts.  Second, it may require the ACPI subsystem to special-case
      the handling of device notifications depending on whether or not
      they are received during suspend-to-idle in some places which would
      lead to fragile code.  Finally, it's better the handle ACPI wakeup
      interrupts consistently with wakeup interrupts from other sources.
      
      For this reason, remove the IRQF_NO_SUSPEND flag from the ACPI SCI
      and use enable_irq_wake()/disable_irq_wake() with it instead, which
      requires two additional platform hooks to be added to struct
      platform_freeze_ops.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a8d46b9e
  13. 24 7月, 2014 1 次提交
  14. 07 6月, 2014 1 次提交
    • T
      PM / sleep: trace events for suspend/resume · bb3632c6
      Todd E Brandt 提交于
      Adds trace events that give finer resolution into suspend/resume. These
      events are graphed in the timelines generated by the analyze_suspend.py
      script. They represent large areas of time consumed that are typical to
      suspend and resume.
      
      The event is triggered by calling the function "trace_suspend_resume"
      with three arguments: a string (the name of the event to be displayed
      in the timeline), an integer (case specific number, such as the power
      state or cpu number), and a boolean (where true is used to denote the start
      of the timeline event, and false to denote the end).
      
      The suspend_resume trace event reproduces the data that the machine_suspend
      trace event did, so the latter has been removed.
      Signed-off-by: NTodd Brandt <todd.e.brandt@intel.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bb3632c6
  15. 16 5月, 2014 1 次提交
    • R
      ACPI / PM: Hold ACPI scan lock over the "freeze" sleep state · 1f0b6386
      Rafael J. Wysocki 提交于
      The "freeze" sleep state suffers from the same issue that was
      addressed by commit ad07277e (ACPI / PM: Hold acpi_scan_lock over
      system PM transitions) for ACPI sleep states, that is, things break
      if ->remove() is called for devices whose system resume callbacks
      haven't been executed yet.
      
      It also can be addressed in the same way, by holding the ACPI scan
      lock over the "freeze" sleep state and PM transitions to and from
      that state, but ->begin() and ->end() platform operations for the
      "freeze" sleep state are needed for this purpose.
      
      This change has been tested on Acer Aspire S5 with Thunderbolt.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1f0b6386
  16. 10 5月, 2014 1 次提交
  17. 14 3月, 2014 1 次提交
    • R
      ACPI / sleep: Add extra checks for HW Reduced ACPI mode sleep states · a4e90bed
      Rafael J. Wysocki 提交于
      If the HW Reduced ACPI mode bit is set in the FADT, ACPICA uses
      the optional sleep control and sleep status registers for making
      the system enter sleep states (including S5), so it is not possible
      to use system sleep states or power it off using ACPI if the HW
      Reduced ACPI mode bit is set and those registers are not available.
      
      For this reason, add a new function, acpi_sleep_state_supported(),
      checking if the HW Reduced ACPI mode bit is set and whether or not
      system sleep states are usable in that case in addition to checking
      the return value of acpi_get_sleep_type_data() and make the ACPI
      sleep setup routines use that function to check the availability of
      system sleep states.
      
      Among other things, this prevents the kernel from attempting to
      use ACPI for powering off HW Reduced ACPI systems without the sleep
      control and sleep status registers, because ACPI power off doesn't
      have a chance to work on them.  That allows alternative power off
      mechanisms that may actually work to be used on those systems.  The
      affected machines include Dell Venue 8 Pro, Asus T100TA, Haswell
      Desktop SDP and Ivy Bridge EP Demo depot.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=70931Reported-by: NAdam Williamson <awilliam@redhat.com>
      Tested-by: NAubrey Li <aubrey.li@linux.intel.com>
      Cc: 3.4+ <stable@vger.kernel.org> # 3.4+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a4e90bed
  18. 10 3月, 2014 1 次提交
  19. 03 3月, 2014 1 次提交
  20. 11 1月, 2014 1 次提交
  21. 07 12月, 2013 2 次提交
    • H
      ACPI / sleep: Drop redundant acpi_disabled check · 100eb0b0
      Hanjun Guo 提交于
      acpi_sleep_init() is only called from acpi_bus_init() and the
      code logic shows that it doesn't need to check acpi_disabled:
      
      acpi_init();
      	if (acpi_disabled) return;
      	acpi_bus_init();
      		acpi_sleep_init();
      			if (acpi_disabled)
      				return 0;
      Signed-off-by: NHanjun Guo <hanjun.guo@linaro.org>
      [rjw: Subject and changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      100eb0b0
    • L
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng 提交于
      Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
      <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
      inclusions and remove some inclusions of those files that aren't
      necessary.
      
      First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
      should not be included directly from any files that are built for
      CONFIG_ACPI unset, because that generally leads to build warnings about
      undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
      <linux/acpi.h> includes those files and for CONFIG_ACPI unset it
      provides stub ACPI symbols to be used in that case.
      
      Second, there are ordering dependencies between those files that always
      have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
      prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
      latter depends on are always there.  And <acpi/acpi.h> which provides
      basic ACPICA type declarations should always be included prior to any other
      ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
      <linux/acpi.h> as appropriate.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  22. 21 11月, 2013 1 次提交
  23. 21 8月, 2013 1 次提交
  24. 08 8月, 2013 1 次提交
  25. 15 7月, 2013 1 次提交
  26. 20 6月, 2013 1 次提交
  27. 27 3月, 2013 1 次提交
  28. 04 3月, 2013 1 次提交
  29. 06 2月, 2013 1 次提交
  30. 20 1月, 2013 1 次提交
  31. 17 1月, 2013 1 次提交
    • R
      ACPI: Drop power resources driver · 781d737c
      Rafael J. Wysocki 提交于
      The ACPI power resources driver is not very useful, because the only
      thing it really does is to restore the state of the power resources
      that were "on" before system suspend or hibernation, but that may be
      achieved in a different way.
      
      Drop the ACPI power resources driver entirely and add
      acpi_resume_power_resources() that will walk the list of all
      registered power resources during system resume and turn on the ones
      that were "on" before the preceding system suspend or hibernation.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      781d737c
  32. 30 11月, 2012 1 次提交
  33. 22 11月, 2012 1 次提交
  34. 15 11月, 2012 6 次提交
    • K
      ACPI / Sleep: add acpi_sleep=nonvs_s3 parameter · 1bad2f19
      Kristen Carlson Accardi 提交于
      The ACPI specificiation would like us to save NVS at hibernation time,
      but makes no mention of saving NVS over S3.  Not all versions of
      Windows do this either, and it is clear that not all machines need NVS
      saved/restored over S3.  Allow the user to improve their suspend/resume
      time by disabling the NVS save/restore at S3 time, but continue to do
      the NVS save/restore for S4 as specified.
      Signed-off-by: NKristen Carlson Accardi <kristen@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1bad2f19
    • R
      ACPI / PM: Move device PM functions related to sleep states · a6ae7594
      Rafael J. Wysocki 提交于
      Introduce helper function returning the target sleep state of the
      system and use it to move the remaining device power management
      functions from sleep.c to device_pm.c.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a6ae7594
    • R
      ACPI / PM: Split device wakeup management routines · dee8370c
      Rafael J. Wysocki 提交于
      Two device wakeup management routines in device_pm.c and sleep.c,
      acpi_pm_device_run_wake() and acpi_pm_device_sleep_wake(), take a
      device pointer argument and use it to obtain the ACPI handle of the
      corresponding ACPI namespace node.  That handle is then used to get
      the address of the struct acpi_device object corresponding to the
      struct device passed as the argument.
      
      Unfortunately, that last operation may be costly, because it involves
      taking the global ACPI namespace mutex, so it shouldn't be carried
      out too often.  However, the callers of those routines usually call
      them in a row with acpi_pm_device_sleep_state() which also takes that
      mutex for the same reason, so it would be more efficient if they ran
      acpi_bus_get_device() themselves to obtain a pointer to the struct
      acpi_device object in question and then passed that pointer to the
      appropriate PM routines.
      
      To make that possible, split each of the PM routines mentioned above
      in two parts, one taking a struct acpi_device pointer argument and
      the other implementing the current interface for compatibility.
      
      Additionally, change acpi_pm_device_run_wake() to actually return
      an error code if there is an error while setting up runtime remote
      wakeup for the device.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dee8370c
    • R
      ACPI / PM: Move runtime remote wakeup setup routine to device_pm.c · cd7bd02d
      Rafael J. Wysocki 提交于
      The ACPI function for setting up devices to do runtime remote
      wakeup is now located in drivers/acpi/sleep.c, but
      drivers/acpi/device_pm.c is a more logical place for it, so move it
      there.
      
      No functional changes should result from this modification.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cd7bd02d
    • R
      ACPI / PM: Move device power state selection routine to device_pm.c · 86b3832c
      Rafael J. Wysocki 提交于
      The ACPI function for choosing device power state is now located
      in drivers/acpi/sleep.c, but drivers/acpi/device_pm.c is a more
      logical place for it, so move it there.
      
      However, instead of moving the function entirely, move its core only
      under a different name and with a different list of arguments, so
      that it is more flexible, and leave a wrapper around it in the
      original location.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      86b3832c
    • R
      ACPI / PM: Fix device PM kernedoc comments and #ifdefs · bdda27fb
      Rafael J. Wysocki 提交于
      The kerneldoc comments for acpi_pm_device_sleep_state(),
      acpi_pm_device_run_wake(), and acpi_pm_device_sleep_wake() are
      outdated or otherwise inaccurate and/or don't follow the common
      kerneldoc patterns, so fix them.
      
      Additionally, notice that acpi_pm_device_run_wake() should be under
      CONFIG_PM_RUNTIME rather than under CONFIG_PM_SLEEP, so fix that too.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bdda27fb