1. 08 2月, 2022 2 次提交
    • R
      PM: s2idle: ACPI: Fix wakeup interrupts handling · cb1f65c1
      Rafael J. Wysocki 提交于
      After commit e3728b50 ("ACPI: PM: s2idle: Avoid possible race
      related to the EC GPE") wakeup interrupts occurring immediately after
      the one discarded by acpi_s2idle_wake() may be missed.  Moreover, if
      the SCI triggers again immediately after the rearming in
      acpi_s2idle_wake(), that wakeup may be missed too.
      
      The problem is that pm_system_irq_wakeup() only calls pm_system_wakeup()
      when pm_wakeup_irq is 0, but that's not the case any more after the
      interrupt causing acpi_s2idle_wake() to run until pm_wakeup_irq is
      cleared by the pm_wakeup_clear() call in s2idle_loop().  However,
      there may be wakeup interrupts occurring in that time frame and if
      that happens, they will be missed.
      
      To address that issue first move the clearing of pm_wakeup_irq to
      the point at which it is known that the interrupt causing
      acpi_s2idle_wake() to tun will be discarded, before rearming the SCI
      for wakeup.  Moreover, because that only reduces the size of the
      time window in which the issue may manifest itself, allow
      pm_system_irq_wakeup() to register two second wakeup interrupts in
      a row and, when discarding the first one, replace it with the second
      one.  [Of course, this assumes that only one wakeup interrupt can be
      discarded in one go, but currently that is the case and I am not
      aware of any plans to change that.]
      
      Fixes: e3728b50 ("ACPI: PM: s2idle: Avoid possible race related to the EC GPE")
      Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cb1f65c1
    • R
      ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE · dc0075ba
      Rafael J. Wysocki 提交于
      Commit 4a9af6ca ("ACPI: EC: Rework flushing of EC work while
      suspended to idle") made acpi_ec_dispatch_gpe() check
      pm_wakeup_pending(), but that is before canceling the SCI wakeup,
      so pm_wakeup_pending() is always true.  This causes the loop in
      acpi_ec_dispatch_gpe() to always terminate after one iteration which
      may not be correct.
      
      Address this issue by canceling the SCI wakeup earlier, from
      acpi_ec_dispatch_gpe() itself.
      
      Fixes: 4a9af6ca ("ACPI: EC: Rework flushing of EC work while suspended to idle")
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dc0075ba
  2. 18 12月, 2021 1 次提交
    • K
      ACPI: PM: Remove redundant cache flushing · 3c89857a
      Kirill A. Shutemov 提交于
      ACPICA code takes care about cache flushing on S1/S2/S3 in
      acpi_hw_extended_sleep() and acpi_hw_legacy_sleep().
      
      acpi_suspend_enter() calls into ACPICA code via acpi_enter_sleep_state()
      for S1 or x86_acpi_suspend_lowlevel() for S3.
      
      acpi_sleep_prepare() call tree:
        __acpi_pm_prepare()
          acpi_pm_prepare()
            acpi_suspend_ops::prepare_late()
            acpi_hibernation_ops::pre_snapshot()
            acpi_hibernation_ops::prepare()
          acpi_suspend_begin_old()
            acpi_suspend_begin_old::begin()
        acpi_hibernation_begin_old()
          acpi_hibernation_ops_old::acpi_hibernation_begin_old()
        acpi_power_off_prepare()
          pm_power_off_prepare()
      
      Hibernation (S4) and Power Off (S5) don't require cache flushing, so
      the only interesting callsites are acpi_suspend_ops::prepare_late()
      and acpi_suspend_begin_old::begin(). Both of them have cache flush
      on ->enter() operation in acpi_suspend_enter().
      
      Remove redundant ACPI_FLUSH_CPU_CACHE() in acpi_sleep_prepare() and
      acpi_suspend_enter().
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3c89857a
  3. 08 12月, 2021 2 次提交
    • K
      ACPI: PM: Avoid CPU cache flush when entering S4 · 53d01e20
      Kirill A. Shutemov 提交于
      According to ACPI 6.4, Section 16.2, the CPU cache flushing is
      required on entering to S1, S2, and S3.
      
      No need to flush the caches during hibernation (S4).
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      53d01e20
    • D
      PM: hibernate: Allow ACPI hardware signature to be honoured · 74d95555
      David Woodhouse 提交于
      Theoretically, when the hardware signature in FACS changes, the OS
      is supposed to gracefully decline to attempt to resume from S4:
      
       "If the signature has changed, OSPM will not restore the system
        context and can boot from scratch"
      
      In practice, Windows doesn't do this and many laptop vendors do allow
      the signature to change especially when docking/undocking, so it would
      be a bad idea to simply comply with the specification by default in the
      general case.
      
      However, there are use cases where we do want the compliant behaviour
      and we know it's safe. Specifically, when resuming virtual machines where
      we know the hypervisor has changed sufficiently that resume will fail.
      We really want to be able to *tell* the guest kernel not to try, so it
      boots cleanly and doesn't just crash. This patch provides a way to opt
      in to the spec-compliant behaviour on the command line.
      
      A follow-up patch may do this automatically for certain "known good"
      machines based on a DMI match, or perhaps just for all hypervisor
      guests since there's no good reason a hypervisor would change the
      hardware_signature that it exposes to guests *unless* it wants them
      to obey the ACPI specification.
      Signed-off-by: NDavid Woodhouse <dwmw@amazon.co.uk>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      74d95555
  4. 26 10月, 2021 1 次提交
  5. 14 6月, 2021 1 次提交
  6. 07 6月, 2021 2 次提交
  7. 31 5月, 2021 1 次提交
    • R
      ACPI: power: Rework turning off unused power resources · 6381195a
      Rafael J. Wysocki 提交于
      Make turning off unused power resources (after the enumeration of
      devices and during system-wide resume from S3) more straightforward
      by using the observation that the power resource state stored in
      struct acpi_power_resource can be used to determine whether or not
      the give power resource has any users.
      
      Namely, when the state of the power resource is unknown, its _STA
      method has never been evaluated (or the evaluation of it has failed)
      and its _ON and _OFF methods have never been executed (or they have
      failed to execute), so for all practical purposes it can be assumed
      to have no users (or to be unusable).  Therefore, instead of checking
      the number of power resource users, it is sufficient to check if its
      state is known.
      
      Moreover, if the last known state of a given power resource is "off",
      it is not necessary to turn it off, because it has been used to
      initialize the power state or the wakeup power resources list of at
      least one device and either its _STA method has returned 0 ("off"),
      or its _OFF method has been successfully executed already.
      
      Accordingly, modify acpi_turn_off_unused_power_resources() to do the
      above checks (which are suitable for both uses of it) instead of
      using the number of power resource users or evaluating its _STA
      method, drop its argument (which is not useful any more) and update
      its callers.
      
      Also drop the users field from struct acpi_power_resource as it is
      not useful any more.
      Tested-by: NDave Olsthoorn <dave@bewaar.me>
      Tested-by: NShujun Wang <wsj20369@163.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6381195a
  8. 24 5月, 2021 1 次提交
  9. 18 12月, 2020 1 次提交
    • R
      ACPI: PM: s2idle: Move x86-specific code to the x86 directory · fef98671
      Rafael J. Wysocki 提交于
      Some code in drivers/acpi/sleep.c (which is regarded as a generic
      file) related to suspend-to-idle support has grown direct dependencies
      on x86, but in fact it has been specific to x86 (which is the only
      user of it) anyway for a long time.
      
      For this reason, move that code to a separate file under acpi/x86/
      and make it build and run as before under the right conditions.
      
      While at it, rename a vendor checking function in that code and
      consistently use acpi_handle_debug() for printing debug-related
      information in it.
      
      No expected functional impact.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fef98671
  10. 17 12月, 2020 1 次提交
  11. 25 5月, 2020 1 次提交
  12. 18 5月, 2020 1 次提交
    • R
      ACPI: EC: PM: Avoid flushing EC work when EC GPE is inactive · 607b9df6
      Rafael J. Wysocki 提交于
      Flushing the EC work while suspended to idle when the EC GPE status
      is not set causes some EC wakeup events (notably power button and
      lid ones) to be missed after a series of spurious wakeups on the Dell
      XPS13 9360 in my office.
      
      If that happens, the machine cannot be woken up from suspend-to-idle
      by the power button or lid status change and it needs to be woken up
      in some other way (eg. by a key press).
      
      Flushing the EC work only after successful dispatching the EC GPE,
      which means that its status has been set, avoids the issue, so change
      the code in question accordingly.
      
      Fixes: 7b301750 ("ACPI: EC: PM: Avoid premature returns from acpi_s2idle_wake()")
      Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NChris Chiu <chiu@endlessm.com>
      607b9df6
  13. 11 5月, 2020 1 次提交
  14. 09 5月, 2020 1 次提交
  15. 05 4月, 2020 1 次提交
    • H
      ACPI: PM: Add acpi_[un]register_wakeup_handler() · ddfd9dcf
      Hans de Goede 提交于
      Since commit fdde0ff8 ("ACPI: PM: s2idle: Prevent spurious SCIs from
      waking up the system") the SCI triggering without there being a wakeup
      cause recognized by the ACPI sleep code will no longer wakeup the system.
      
      This works as intended, but this is a problem for devices where the SCI
      is shared with another device which is also a wakeup source.
      
      In the past these, from the pov of the ACPI sleep code, spurious SCIs
      would still cause a wakeup so the wakeup from the device sharing the
      interrupt would actually wakeup the system. This now no longer works.
      
      This is a problem on e.g. Bay Trail-T and Cherry Trail devices where
      some peripherals (typically the XHCI controller) can signal a
      Power Management Event (PME) to the Power Management Controller (PMC)
      to wakeup the system, this uses the same interrupt as the SCI.
      These wakeups are handled through a special INT0002 ACPI device which
      checks for events in the GPE0a_STS for this and takes care of acking
      the PME so that the shared interrupt stops triggering.
      
      The change to the ACPI sleep code to ignore the spurious SCI, causes
      the system to no longer wakeup on these PME events. To make things
      worse this means that the INT0002 device driver interrupt handler will
      no longer run, causing the PME to not get cleared and resulting in the
      system hanging. Trying to wakeup the system after such a PME through e.g.
      the power button no longer works.
      
      Add an acpi_register_wakeup_handler() function which registers
      a handler to be called from acpi_s2idle_wake() and when the handler
      returns true, return true from acpi_s2idle_wake().
      
      The INT0002 driver will use this mechanism to check the GPE0a_STS
      register from acpi_s2idle_wake() and to tell the system to wakeup
      if a PME is signaled in the register.
      
      Fixes: fdde0ff8 ("ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system")
      Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ddfd9dcf
  16. 25 3月, 2020 2 次提交
  17. 22 3月, 2020 1 次提交
  18. 22 2月, 2020 1 次提交
  19. 12 2月, 2020 1 次提交
  20. 11 2月, 2020 1 次提交
    • R
      ACPI: PM: s2idle: Avoid possible race related to the EC GPE · e3728b50
      Rafael J. Wysocki 提交于
      It is theoretically possible for the ACPI EC GPE to be set after the
      s2idle_ops->wake() called from s2idle_loop() has returned and before
      the subsequent pm_wakeup_pending() check is carried out.  If that
      happens, the resulting wakeup event will cause the system to resume
      even though it may be a spurious one.
      
      To avoid that race, first make the ->wake() callback in struct
      platform_s2idle_ops return a bool value indicating whether or not
      to let the system resume and rearrange s2idle_loop() to use that
      value instad of the direct pm_wakeup_pending() call if ->wake() is
      present.
      
      Next, rework acpi_s2idle_wake() to process EC events and check
      pm_wakeup_pending() before re-arming the SCI for system wakeup
      to prevent it from triggering prematurely and add comments to
      that function to explain the rationale for the new code flow.
      
      Fixes: 56b99184 ("PM: sleep: Simplify suspend-to-idle control flow")
      Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e3728b50
  21. 10 12月, 2019 1 次提交
  22. 02 12月, 2019 1 次提交
    • R
      ACPI: PM: s2idle: Rework ACPI events synchronization · 024aa873
      Rafael J. Wysocki 提交于
      Note that the EC GPE processing need not be synchronized in
      acpi_s2idle_wake() after invoking acpi_ec_dispatch_gpe(), because
      that function checks the GPE status and dispatches its handler if
      need be and the SCI action handler is not going to run anyway at
      that point.
      
      Moreover, it is better to drain all of the pending ACPI events
      before restoring the working-state configuration of GPEs in
      acpi_s2idle_restore(), because those events are likely to be related
      to system wakeup, in which case they will not be relevant going
      forward.
      
      Rework the code to take these observations into account.
      Tested-by: NKenneth R. Crudup <kenny@panix.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      024aa873
  23. 10 10月, 2019 1 次提交
  24. 22 8月, 2019 2 次提交
  25. 08 8月, 2019 4 次提交
    • R
      ACPI: PM: s2idle: Execute LPS0 _DSM functions with suspended devices · ac9eafbe
      Rafael J. Wysocki 提交于
      According to Section 3.5 of the "Intel Low Power S0 Idle" document [1],
      Function 5 of the LPS0 _DSM is expected to be invoked when the system
      configuration matches the criteria for entering the target low-power
      state of the platform.  In particular, this means that all devices
      should be suspended and in low-power states already when that function
      is invoked.
      
      This is not the case currently, however, because Function 5 of the
      LPS0 _DSM is invoked by it before the "noirq" phase of device suspend,
      which means that some devices may not have been put into low-power
      states yet at that point.  That is a consequence of the previous
      design of the suspend-to-idle flow that allowed the "noirq" phase of
      device suspend and the "noirq" phase of device resume to be carried
      out for multiple times while "suspended" (if any spurious wakeup
      events were detected) and the point of the LPS0 _DSM Function 5
      invocation was chosen so as to call it (and LPS0 _DSM Function 6
      analogously) once per suspend-resume cycle (regardless of how many
      times the "noirq" phases of device suspend and resume were carried
      out while "suspended").
      
      Now that the suspend-to-idle flow has been redesigned to carry out
      the "noirq" phases of device suspend and resume once in each cycle,
      the code can be reordered to follow the specification that it is
      based on more closely.
      
      For this purpose, add ->prepare_late and ->restore_early platform
      callbacks for suspend-to-idle, to be executed, respectively, after
      the "noirq" phase of suspending devices and before the "noirq"
      phase of resuming them and make ACPI use them for the invocation
      of LPS0 _DSM functions as appropriate.
      
      While at it, move the LPS0 entry requirements check to be made
      before invoking Functions 3 and 5 of the LPS0 _DSM (also once
      per cycle) as follows from the specification [1].
      
      Link: https://uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf # [1]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      ac9eafbe
    • R
      ACPI: PM: s2idle: Eliminate acpi_sleep_no_ec_events() · 6e86633a
      Rafael J. Wysocki 提交于
      Change acpi_ec_suspend() to use pm_suspend_no_platform() instead of
      acpi_sleep_no_ec_events(), which allows the latter to be eliminated
      along with the s2idle_in_progress variable which is only used by it.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      6e86633a
    • R
      ACPI: PM: s2idle: Add acpi.sleep_no_lps0 module parameter · 068b47d0
      Rafael J. Wysocki 提交于
      Add a module parameter to prevent the ACPI LPS0 _DSM functions
      from being invoked (if need be) and rework the suspend-to-idle
      blacklist entries in acpisleep_dmi_table[] to make them simply
      prevent suspend-to-idle from being used by default on the systems
      in question (which really is the original purpose of those entries).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      068b47d0
    • R
      ACPI: PM: s2idle: Rearrange lps0_device_attach() · 2e2c2fdc
      Rafael J. Wysocki 提交于
      To allow a subsequent change to be simpler, rearrange the code in
      lps0_device_attach() to reduce the indentation level and (while
      at it) make it avoid calling lpi_device_get_constraints() when
      lps0_device_handle is not going to be set.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      2e2c2fdc
  26. 30 7月, 2019 1 次提交
    • R
      ACPI: PM: Set up EC GPE for system wakeup from drivers that need it · 10a08fd6
      Rafael J. Wysocki 提交于
      The EC GPE needs to be set up for system wakeup only if there is a
      driver depending on it, either intel-hid or intel-vbtn, bound to a
      button device that is expected to wake up the system from sleep (such
      as the power button on some Dell systems, like the XPS13 9360).  It
      doesn't need to be set up for waking up the system from sleep in any
      other cases and whether or not it is expected to wake up the system
      from sleep doesn't depend on whether or not the LPS0 device is
      present in the ACPI namespace.
      
      For this reason, rearrange the ACPI suspend-to-idle code to make the
      drivers depending on the EC GPE wakeup take care of setting it up and
      decouple that from the LPS0 device handling.
      
      While at it, make intel-hid and intel-vbtn prepare for system wakeup
      only if they are allowed to wake up the system from sleep by user
      space (via sysfs).
      
      [Note that acpi_ec_mark_gpe_for_wake() and acpi_ec_set_gpe_wake_mask()
       are there to prevent the EC GPE from being disabled by the
       acpi_enable_all_wakeup_gpes() call in acpi_s2idle_prepare(), so on
       systems with either intel-hid or intel-vbtn this change doesn't
       affect any interactions with the hardware or platform firmware.]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      10a08fd6
  27. 23 7月, 2019 2 次提交
    • R
      PM: sleep: Simplify suspend-to-idle control flow · 56b99184
      Rafael J. Wysocki 提交于
      After commit 33e4f80e ("ACPI / PM: Ignore spurious SCI wakeups
      from suspend-to-idle") the "noirq" phases of device suspend and
      resume may run for multiple times during suspend-to-idle, if there
      are spurious system wakeup events while suspended.  However, this
      is complicated and fragile and actually unnecessary.
      
      The main reason for doing this is that on some systems the EC may
      signal system wakeup events (power button events, for example) as
      well as events that should not cause the system to resume (spurious
      system wakeup events).  Thus, in order to determine whether or not
      a given event signaled by the EC while suspended is a proper system
      wakeup one, the EC GPE needs to be dispatched and to start with that
      was achieved by allowing the ACPI SCI action handler to run, which
      was only possible after calling resume_device_irqs().
      
      However, dispatching the EC GPE this way turned out to take too much
      time in some cases and some EC events might be missed due to that, so
      commit 68e22011 ("ACPI: EC: Dispatch the EC GPE directly on
      s2idle wake") started to dispatch the EC GPE right after a wakeup
      event has been detected, so in fact the full ACPI SCI action handler
      doesn't need to run any more to deal with the wakeups coming from the
      EC.
      
      Use this observation to simplify the suspend-to-idle control flow
      so that the "noirq" phases of device suspend and resume are each
      run only once in every suspend-to-idle cycle, which is reported to
      significantly reduce power drawn by some systems when suspended to
      idle (by allowing them to reach a deep platform-wide low-power state
      through the suspend-to-idle flow).  [What appears to happen is that
      the "noirq" resume of devices after a spurious EC wakeup brings some
      devices into a state in which they prevent the platform from reaching
      the deep low-power state going forward, even after a subsequent
      "noirq" suspend phase, and on some systems the EC triggers such
      wakeups already when the "noirq" suspend of devices is running for
      the first time in the given suspend/resume cycle, so the platform
      cannot reach the deep low-power state at all.]
      
      First, make acpi_s2idle_wake() use the acpi_ec_dispatch_gpe() return
      value to determine whether or not the wakeup may have been triggered
      by the EC (in which case the system wakeup is canceled and ACPI
      events are processed in order to determine whether or not the event
      is a proper system wakeup one) and use rearm_wake_irq() (introduced
      by a previous change) in it to rearm the ACPI SCI for system wakeup
      detection in case the system will remain suspended.
      
      Second, drop acpi_s2idle_sync(), which is not needed any more, and
      the corresponding global platform suspend-to-idle callback.
      
      Next, drop the pm_wakeup_pending() check (which is an optimization
      only) from __device_suspend_noirq() to prevent it from returning
      errors on system wakeups occurring before the "noirq" phase of
      device suspend is complete (as in the case of suspend-to-idle it is
      not known whether or not these wakeups are suprious at that point),
      in order to avoid having to carry out a "noirq" resume of devices
      on a spurious system wakeup.
      
      Finally, change the code flow in s2idle_loop() to (1) run the
      "noirq" suspend of devices once before starting the loop, (2) check
      for spurious EC wakeups (via the platform ->wake callback) for the
      first time before calling s2idle_enter(), and (3) run the "noirq"
      resume of devices once after leaving the loop.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      56b99184
    • R
      ACPI: PM: Set s2idle_wakeup earlier and clear it later · 41275eb5
      Rafael J. Wysocki 提交于
      The role of the s2idle_wakeup variable is to cause
      acpi_pm_wakeup_event() and acpi_pm_notify_handler() to
      increment pm_abort_suspend and trigger a wakeup from
      suspend-to-idle in case the ACPI SCI wakeup was canceled
      by acpi_s2idle_wake().
      
      However, for this purpose it need not be set in acpi_s2idle_wake()
      and cleared in acpi_s2idle_sync(), respectively.  In fact, it
      may be set as early as in acpi_s2idle_prepare() and cleared as
      late as in acpi_s2idle_restore(), so do that to allow subsequent
      changes to be simpler.
      
      This change is not expected to alter functionality.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      41275eb5
  28. 06 7月, 2019 1 次提交
    • D
      ACPI: PM: Make acpi_sleep_state_supported() non-static · ad5a449b
      Dexuan Cui 提交于
      With some upcoming patches to save/restore the Hyper-V drivers related
      states, a Linux VM running on Hyper-V will be able to hibernate. When
      a Linux VM hibernates, unluckily we must disable the memory hot-add/remove
      and balloon up/down capabilities in the hv_balloon driver
      (drivers/hv/hv_balloon.c), because these can not really work according to
      the design of the related back-end driver on the host.
      
      By default, Hyper-V does not enable the virtual ACPI S4 state for a VM;
      on recent Hyper-V hosts, the administrator is able to enable the virtual
      ACPI S4 state for a VM, so we hope to use the presence of the virtual ACPI
      S4 state as a hint for hv_balloon to disable the aforementioned
      capabilities. In this way, hibernation will work more reliably, from the
      user's perspective.
      
      By marking acpi_sleep_state_supported() non-static, we'll be able to
      implement a hv_is_hibernation_supported() API in the always-built-in
      module arch/x86/hyperv/hv_init.c, and the API will be called by hv_balloon.
      Signed-off-by: NDexuan Cui <decui@microsoft.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ad5a449b
  29. 24 6月, 2019 1 次提交
    • S
      bus_find_device: Unify the match callback with class_find_device · 418e3ea1
      Suzuki K Poulose 提交于
      There is an arbitrary difference between the prototypes of
      bus_find_device() and class_find_device() preventing their callers
      from passing the same pair of data and match() arguments to both of
      them, which is the const qualifier used in the prototype of
      class_find_device().  If that qualifier is also used in the
      bus_find_device() prototype, it will be possible to pass the same
      match() callback function to both bus_find_device() and
      class_find_device(), which will allow some optimizations to be made in
      order to avoid code duplication going forward.  Also with that, constify
      the "data" parameter as it is passed as a const to the match function.
      
      For this reason, change the prototype of bus_find_device() to match
      the prototype of class_find_device() and adjust its callers to use the
      const qualifier in accordance with the new prototype of it.
      
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Andreas Noever <andreas.noever@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: David Kershner <david.kershner@unisys.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Harald Freudenberger <freude@linux.ibm.com>
      Cc: Hartmut Knaack <knaack.h@gmx.de>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michael Jamet <michael.jamet@intel.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Sebastian Ott <sebott@linux.ibm.com>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
      Cc: rafael@kernel.org
      Acked-by: NCorey Minyard <minyard@acm.org>
      Acked-by: NDavid Kershner <david.kershner@unisys.com>
      Acked-by: NMark Brown <broonie@kernel.org>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Acked-by: Wolfram Sang <wsa@the-dreams.de> # for the I2C parts
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      418e3ea1
  30. 14 6月, 2019 1 次提交
  31. 05 6月, 2019 1 次提交