1. 24 8月, 2022 1 次提交
  2. 24 6月, 2022 1 次提交
  3. 23 4月, 2022 1 次提交
  4. 22 4月, 2022 1 次提交
  5. 13 4月, 2022 4 次提交
  6. 18 12月, 2021 1 次提交
  7. 04 11月, 2021 1 次提交
  8. 24 6月, 2021 1 次提交
    • D
      ACPI: PM: postpone bringing devices to D0 unless we need them · f7599be2
      Dmitry Torokhov 提交于
      Currently ACPI power domain brings devices into D0 state in the "resume
      early" phase. Normally this does not cause any issues, as powering up
      happens quickly. However there are peripherals that have certain timing
      requirements for powering on, for example some models of Elan
      touchscreens need 300msec after powering up/releasing reset line before
      they can accept commands from the host. Such devices will dominate
      the time spent in early resume phase and cause increase in overall
      resume time as we wait for early resume to complete before we can
      proceed to the normal resume stage.
      
      There are ways for a driver to indicate that it can tolerate device
      being in the low power mode and that it knows how to power the device
      back up when resuming, bit that requires changes to individual drivers
      that may not really care about details of ACPI controlled power
      management.
      
      This change attempts to solve this issue at ACPI power domain level, by
      postponing powering up device until we get to the normal resume stage,
      unless there is early resume handler defined for the device, or device
      does not declare any resume handlers, in which case we continue powering
      up such devices early. This allows us to shave off several hundred
      milliseconds of resume time on affected systems.
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f7599be2
  9. 16 6月, 2021 2 次提交
  10. 22 5月, 2021 1 次提交
    • R
      ACPI: PM / fan: Put fan device IDs into separate header file · b9370dce
      Rafael J. Wysocki 提交于
      The ACPI fan device IDs are shared between the fan driver and the
      device power management code.  The former is modular, so it needs
      to include the table of device IDs for module autoloading and the
      latter needs that list to avoid attaching the generic ACPI PM domain
      to fan devices (which doesn't make sense) possibly before the fan
      driver module is loaded.
      
      Unfortunately, that requires the list of fan device IDs to be
      updated in two places which is prone to mistakes, so put it into
      a symbol definition in a separate header file so there is only one
      copy of it in case it needs to be updated again in the future.
      
      Fixes: b9ea0bae ("ACPI: PM: Avoid attaching ACPI PM domain to certain devices")
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b9370dce
  11. 12 5月, 2021 1 次提交
  12. 08 4月, 2021 1 次提交
  13. 05 2月, 2021 1 次提交
  14. 07 12月, 2020 2 次提交
    • R
      PM: ACPI: Refresh wakeup device power configuration every time · b93b7ef6
      Rafael J. Wysocki 提交于
      When wakeup signaling is enabled for a bridge for the second (or every
      next) time in a row, its existing device wakeup power configuration
      may not match the new conditions.  For example, some devices below
      it may have been put into low-power states and that changes the
      device wakeup power conditions or similar.  This causes functional
      problems to appear on some systems (for example,  because of it the
      Thunderbolt port on Dell Precision 5550 cannot detect devices plugged
      in after it has been suspended).
      
      For this reason, modify __acpi_device_wakeup_enable() to refresh the
      device wakeup power configuration of the target device on every
      invocation, not just when it is called for that device first time
      in a row.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reported-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Tested-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      b93b7ef6
    • R
      PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup() · 7482c5cb
      Rafael J. Wysocki 提交于
      The idea behind acpi_pm_set_bridge_wakeup() was to allow bridges to
      be reference counted for wakeup enabling, because they may be enabled
      to signal wakeup on behalf of their subordinate devices and that
      may happen for multiple times in a row, whereas for the other devices
      it only makes sense to enable wakeup signaling once.
      
      However, this becomes problematic if the bridge itself is suspended,
      because it is treated as a "regular" device in that case and the
      reference counting doesn't work.
      
      For instance, suppose that there are two devices below a bridge and
      they both can signal wakeup.  Every time one of them is suspended,
      wakeup signaling is enabled for the bridge, so when they both have
      been suspended, the bridge's wakeup reference counter value is 2.
      
      Say that the bridge is suspended subsequently and acpi_pci_wakeup()
      is called for it.  Because the bridge can signal wakeup, that
      function will invoke acpi_pm_set_device_wakeup() to configure it
      and __acpi_pm_set_device_wakeup() will be called with the last
      argument equal to 1.  This causes __acpi_device_wakeup_enable()
      invoked by it to omit the reference counting, because the reference
      counter of the target device (the bridge) is 2 at that time.
      
      Now say that the bridge resumes and one of the device below it
      resumes too, so the bridge's reference counter becomes 0 and
      wakeup signaling is disabled for it, but there is still the other
      suspended device which may need the bridge to signal wakeup on its
      behalf and that is not going to work.
      
      To address this scenario, use wakeup enable reference counting for
      all devices, not just for bridges, so drop the last argument from
      __acpi_device_wakeup_enable() and __acpi_pm_set_device_wakeup(),
      which causes acpi_pm_set_device_wakeup() and
      acpi_pm_set_bridge_wakeup() to become identical, so drop the latter
      and use the former instead of it everywhere.
      
      Fixes: 1ba51a7c ("ACPI / PCI / PM: Rework acpi_pci_propagate_wakeup()")
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: 4.14+ <stable@vger.kernel.org> # 4.14+
      7482c5cb
  15. 08 6月, 2020 1 次提交
    • R
      ACPI: PM: Avoid using power resources if there are none for D0 · 956ad9d9
      Rafael J. Wysocki 提交于
      As recently reported, some platforms provide a list of power
      resources for device power state D3hot, through the _PR3 object,
      but they do not provide a list of power resources for device power
      state D0.
      
      Among other things, this causes acpi_device_get_power() to return
      D3hot as the current state of the device in question if all of the
      D3hot power resources are "on", because it sees the power_resources
      flag set and calls acpi_power_get_inferred_state() which finds that
      D3hot is the shallowest power state with all of the associated power
      resources turned "on", so that's what it returns.  Moreover, that
      value takes precedence over the acpi_dev_pm_explicit_get() return
      value, because it means a deeper power state.  The device may very
      well be in D0 physically at that point, however.
      
      Moreover, the presence of _PR3 without _PR0 for a given device
      means that only one D3-level power state can be supported by it.
      Namely, because there are no power resources to turn "off" when
      transitioning the device from D0 into D3cold (which should be
      supported since _PR3 is present), the evaluation of _PS3 should
      be sufficient to put it straight into D3cold, but this means that
      the effect of turning "on" the _PR3 power resources is unclear,
      so it is better to avoid doing that altogether.  Consequently,
      there is no practical way do distinguish D3cold from D3hot for
      the device in question and the power states of it can be labeled
      so that D3hot is the deepest supported one (and Linux assumes
      that putting a device into D3hot via ACPI may cause power to be
      removed from it anyway, for legacy reasons).
      
      To work around the problem described above modify the ACPI
      enumeration of devices so that power resources are only used
      for device power management if the list of D0 power resources
      is not empty and make it mart D3cold as supported only if that
      is the case and the D3hot list of power resources is not empty
      too.
      
      Fixes: ef85bdbe ("ACPI / scan: Consolidate extraction of power resources lists")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=205057
      Link: https://lore.kernel.org/linux-acpi/20200603194659.185757-1-hdegoede@redhat.com/Reported-by: NHans de Goede <hdegoede@redhat.com>
      Tested-by: NHans de Goede <hdegoede@redhat.com>
      Tested-by: youling257@gmail.com
      Cc: 3.10+ <stable@vger.kernel.org> # 3.10+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NHans de Goede <hdegoede@redhat.com>
      956ad9d9
  16. 27 4月, 2020 1 次提交
  17. 25 4月, 2020 4 次提交
    • R
      PM: sleep: core: Rename dev_pm_smart_suspend_and_suspended() · fa2bfead
      Rafael J. Wysocki 提交于
      Because all callers of dev_pm_smart_suspend_and_suspended use it only
      for checking whether or not to skip driver suspend callbacks for a
      device, rename it to dev_pm_skip_suspend() in analogy with
      dev_pm_skip_resume().
      
      No functional impact.
      Suggested-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      fa2bfead
    • R
      PM: sleep: core: Rename dev_pm_may_skip_resume() · 76c70cb5
      Rafael J. Wysocki 提交于
      The name of dev_pm_may_skip_resume() may be easily confused with the
      power.may_skip_resume flag which is not checked by that function, so
      rename the former as dev_pm_skip_resume().
      
      No functional impact.
      Suggested-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      76c70cb5
    • R
      PM: sleep: core: Rework the power.may_skip_resume handling · 0fe8a1be
      Rafael J. Wysocki 提交于
      Because the power.may_skip_resume device status bit is taken
      into account in combination with the DPM_FLAG_LEAVE_SUSPENDED
      driver flag, it can be set to 'true' for all devices in the
      "suspend" phase of a suspend-resume cycle, so do that.
      
      Then, neither the PM core nor the middle-layer (sybsystem) code
      handling it needs to set it to 'true' any more and it just has
      to be cleared if there is a reason to avoid skipping the "noirq"
      and "early" resume callbacks provided by the driver, so update
      the code in question accordingly.
      Suggested-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      0fe8a1be
    • R
      PM: sleep: core: Do not skip callbacks in the resume phase · 6e176bf8
      Rafael J. Wysocki 提交于
      The current code in device_resume_noirq() causes the entire early
      resume and resume phases of device suspend to be skipped for
      devices for which the noirq resume phase have been skipped (due
      to the LEAVE_SUSPENDED flag being set) on the premise that those
      devices should stay in runtime-suspend after system-wide resume.
      
      However, that may not be correct in two situations.  First, the
      middle layer (subsystem) noirq resume callback may be missing for
      a given device, but its early resume callback may be present and it
      may need to do something even if it decides to skip the driver
      callback.  Second, if the device's wakeup settings were adjusted
      in the suspend phase without resuming the device (that was in
      runtime suspend at that time), they most likely need to be
      adjusted again in the resume phase and so the driver callback
      in that phase needs to be run.
      
      For the above reason, modify the core to allow the middle layer
      ->resume_late callback to run even if its ->resume_noirq callback
      is missing (and the core has skipped the driver-level callback
      in that phase) and to allow all device callbacks to run in the
      resume phase.  Also make the core set the PM-runtime status of
      devices with SMART_SUSPEND set whose resume callbacks are not
      skipped to "active" in the "noirq" resume phase and update the
      affected subsystems (PCI and ACPI) accordingly.
      
      After this change, middle-layer (subsystem) callbacks will always
      be invoked in all phases of system suspend and resume and driver
      callbacks will always run in the prepare, suspend, resume, and
      complete phases for all devices.
      
      For devices with SMART_SUSPEND set, driver callbacks will be
      skipped in the late and noirq phases of system suspend if those
      devices remain in runtime suspend in __device_suspend_late().
      Driver callbacks will also be skipped for them during the
      noirq and early phases of the "thaw" transition related to
      hibernation in that case.
      
      Setting LEAVE_SUSPENDED means that the driver allows its callbacks
      to be skipped in the noirq and early phases of system resume, but
      some additional conditions need to be met for that to happen (among
      other things, the power.may_skip_resume flag needs to be set for the
      device during system suspend for the driver callbacks to be skipped
      during the subsequent resume transition).
      
      For all devices with SMART_SUSPEND set whose driver callbacks are
      invoked during system resume, the PM-runtime status will be set to
      "active" (by the core).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      6e176bf8
  18. 01 4月, 2020 1 次提交
  19. 20 12月, 2019 1 次提交
  20. 10 12月, 2019 1 次提交
  21. 21 8月, 2019 1 次提交
  22. 08 8月, 2019 1 次提交
  23. 02 8月, 2019 1 次提交
  24. 04 7月, 2019 1 次提交
  25. 03 7月, 2019 3 次提交
  26. 27 6月, 2019 2 次提交
    • R
      ACPI: PM: Allow transitions to D0 to occur in special cases · f850a48a
      Rafael J. Wysocki 提交于
      If a device with ACPI PM is left in D0 during a system-wide
      transition to the S3 (suspend-to-RAM) or S4 (hibernation) sleep
      state, the actual state of the device need not be D0 during resume
      from it, although its power.state value will still reflect D0 (that
      is, the power state from before the system-wide transition).
      
      In that case, the acpi_device_set_power() call made to ensure that
      the power state of the device will be D0 going forward has no effect,
      because the new state (D0) is equal to the one reflected by the
      device's power.state value.  That does not affect power resources,
      which are taken care of by acpi_resume_power_resources() called from
      acpi_pm_finish() during resume from system-wide sleep states, but it
      still may be necessary to invoke _PS0 for the device on top of that
      in order to finalize its transition to D0.
      
      For this reason, modify acpi_device_set_power() to allow transitions
      to D0 to occur even if D0 is the current power state of the device
      according to its power.state value.
      
      That will not affect power resources, which are assumed to be in
      the right configuration already (as reflected by the current values
      of their reference counters), but it may cause _PS0 to be evaluated
      for the device.  However, evaluating _PS0 for a device already in D0
      may lead to confusion in general, so invoke _PSC (if present) to
      check the device's current power state upfront and only evaluate
      _PS0 for it if _PSC has returned a power state different from D0.
      [If _PSC is not present or the evaluation of it fails, the power
      state of the device is assumed to be D0 at this point.]
      
      Fixes: 20dacb71 (ACPI / PM: Rework device power management to follow ACPI 6)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      f850a48a
    • R
      ACPI: PM: Avoid evaluating _PS3 on transitions from D3hot to D3cold · 21ba2379
      Rafael J. Wysocki 提交于
      If the power state of a device with ACPI PM is changed from D3hot to
      D3cold, it merely is a matter of dropping references to additional
      power resources (specifically, those in the list returned by _PR3),
      and the _PS3 method should not be invoked for the device then (as
      it has already been evaluated during the previous transition to
      D3hot).
      
      Fixes: 20dacb71 (ACPI / PM: Rework device power management to follow ACPI 6)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      21ba2379
  27. 31 5月, 2019 1 次提交
  28. 27 5月, 2019 1 次提交
  29. 09 4月, 2019 1 次提交
    • S
      treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively · d75f773c
      Sakari Ailus 提交于
      %pF and %pf are functionally equivalent to %pS and %ps conversion
      specifiers. The former are deprecated, therefore switch the current users
      to use the preferred variant.
      
      The changes have been produced by the following command:
      
      	git grep -l '%p[fF]' | grep -v '^\(tools\|Documentation\)/' | \
      	while read i; do perl -i -pe 's/%pf/%ps/g; s/%pF/%pS/g;' $i; done
      
      And verifying the result.
      
      Link: http://lkml.kernel.org/r/20190325193229.23390-1-sakari.ailus@linux.intel.com
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: sparclinux@vger.kernel.org
      Cc: linux-um@lists.infradead.org
      Cc: xen-devel@lists.xenproject.org
      Cc: linux-acpi@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Cc: linux-mmc@vger.kernel.org
      Cc: linux-nvdimm@lists.01.org
      Cc: linux-pci@vger.kernel.org
      Cc: linux-scsi@vger.kernel.org
      Cc: linux-btrfs@vger.kernel.org
      Cc: linux-f2fs-devel@lists.sourceforge.net
      Cc: linux-mm@kvack.org
      Cc: ceph-devel@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Acked-by: David Sterba <dsterba@suse.com> (for btrfs)
      Acked-by: Mike Rapoport <rppt@linux.ibm.com> (for mm/memblock.c)
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (for drivers/pci)
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NPetr Mladek <pmladek@suse.com>
      d75f773c