1. 14 Sep, 2009 1 commit
  2. 12 Jun, 2009 3 commits
    • Rafael J. Wysocki's avatar
      PM/Hibernate: Rename disk.c to hibernate.c · 8b759b84
      Rafael J. Wysocki authored
      Change the name of kernel/power/disk.c to kernel/power/hibernate.c
      in analogy with the file names introduced by the changes that
      separated the suspend to RAM and standby funtionality from the
      common PM functions.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
    • Alan Stern's avatar
      PM core: rename suspend and resume functions · d1616302
      Alan Stern authored
      This patch (as1241) renames a bunch of functions in the PM core.
      Rather than go through a boring list of name changes, suffice it to
      say that in the end we have a bunch of pairs of functions:
      	device_resume_noirq	dpm_resume_noirq
      	device_resume		dpm_resume
      	device_complete		dpm_complete
      	device_suspend_noirq	dpm_suspend_noirq
      	device_suspend		dpm_suspend
      	device_prepare		dpm_prepare
      in which device_X does the X operation on a single device and dpm_X
      invokes device_X for all devices in the dpm_list.
      In addition, the old dpm_power_up and device_resume_noirq have been
      combined into a single function (dpm_resume_noirq).
      Lastly, dpm_suspend_start and dpm_resume_end are the renamed versions
      of the former top-level device_suspend and device_resume routines.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Acked-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    • Magnus Damm's avatar
      PM: Rename device_power_down/up() · e39a71ef
      Magnus Damm authored
      Rename the functions performing "_noirq" dev_pm_ops
      operations from device_power_down() and device_power_up()
      to device_suspend_noirq() and device_resume_noirq().
      The new function names are chosen to show that the functions
      are responsible for calling the _noirq() versions to finalize
      the suspend/resume operation. The current function names do
      not perform power down/up anymore so the names may be misleading.
      Global function renames:
      - device_power_down() -> device_suspend_noirq()
      - device_power_up() -> device_resume_noirq()
      Static function renames:
      - suspend_device_noirq() -> __device_suspend_noirq()
      - resume_device_noirq() -> __device_resume_noirq()
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: default avatarLen Brown <lenb@kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
  3. 24 May, 2009 1 commit
    • Rafael J. Wysocki's avatar
      PM: Do not hold dpm_list_mtx while disabling/enabling nonboot CPUs · 32bdfac5
      Rafael J. Wysocki authored
      We shouldn't hold dpm_list_mtx while executing
      [disable|enable]_nonboot_cpus(), because theoretically this may lead
      to a deadlock as shown by the following example (provided by Johannes
      CPU 3       CPU 2                     CPU 1
                  rtnl_lock()               device_pm_lock()
                                             -> mutex_lock(&dpm_list_mtx)
       -> rtnl_lock()
                                             -> flush CPU 3 workqueue
      Fortunately, device drivers are supposed to stop any activities that
      might lead to the registration of new device objects way before
      disable_nonboot_cpus() is called, so it shouldn't be necessary to
      hold dpm_list_mtx over the entire late part of device suspend and
      early part of device resume.
      Thus, during the late suspend and the early resume of devices acquire
      dpm_list_mtx only when dpm_list is going to be traversed and release
      it right after that.
      This patch is reported to fix the regressions tracked as
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarMiles Lane <miles.lane@gmail.com>
      Tested-by: default avatarMing Lei <tom.leiming@gmail.com>
  4. 15 May, 2009 1 commit
  5. 24 Apr, 2009 1 commit
    • Rafael J. Wysocki's avatar
      PM/Hibernate: Fix waiting for image device to appear on resume · 0c8454f5
      Rafael J. Wysocki authored
      Commit c7510859
       ("PM/Hibernate: Wait for
      SCSI devices scan to complete during resume") added a call to
      scsi_complete_async_scans() to software_resume(), so that it waited for
      the SCSI scanning to complete, but the call was added at a wrong place.
      Namely, it should have been added after wait_for_device_probe(), which
      is called only if the image partition hasn't been specified yet.  Also,
      it's reasonable to check if the image partition is present and only wait
      for the device probing and SCSI scanning to complete if it is not the
      Additionally, since noresume is checked right at the beginning of
      software_resume() and the function returns immediately if it's set, it
      doesn't make sense to check it once again later.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  6. 13 Apr, 2009 1 commit
  7. 01 Apr, 2009 1 commit
  8. 30 Mar, 2009 3 commits
    • Rafael J. Wysocki's avatar
      PM: Change hibernation code ordering · 4aecd671
      Rafael J. Wysocki authored
      Change the ordering of the hibernation core code so that the platform
      "prepare" callbacks are executed and the nonboot CPUs are disabled
      after calling device drivers' "late suspend" methods.
      This change (along with the previous analogous change of the suspend
      core code) will allow us to rework the PCI PM core so that the power
      state of devices is changed in the "late" phase of suspend (and
      analogously in the "early" phase of resume), which in turn will allow
      us to avoid the race condition where a device using shared interrupts
      is put into a low power state with interrupts enabled and then an
      interrupt (for another device) comes in and confuses its driver.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
    • Rafael J. Wysocki's avatar
      PM: Rework handling of interrupts during suspend-resume · 2ed8d2b3
      Rafael J. Wysocki authored
      Use the functions introduced in by the previous patch,
      suspend_device_irqs(), resume_device_irqs() and check_wakeup_irqs(),
      to rework the handling of interrupts during suspend (hibernation) and
      resume.  Namely, interrupts will only be disabled on the CPU right
      before suspending sysdevs, while device drivers will be prevented
      from receiving interrupts, with the help of the new helper function,
      before their "late" suspend callbacks run (and analogously during
      In addition, since the device interrups are now disabled before the
      CPU has turned all interrupts off and the CPU will ACK the interrupts
      setting the IRQ_PENDING bit for them, check in sysdev_suspend() if
      any wake-up interrupts are pending and abort suspend if that's the
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
    • Nick Andrew's avatar
      trivial: Fix misspelling of firmware · 877d0310
      Nick Andrew authored
      Fix misspelling of firmware.
      Signed-off-by: default avatarNick Andrew <nick@nick-andrew.net>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
  9. 22 Feb, 2009 1 commit
  10. 21 Feb, 2009 1 commit
  11. 27 Jan, 2009 1 commit
    • Rafael J. Wysocki's avatar
      Hibernation: Introduce system_entering_hibernation · abfe2d7b
      Rafael J. Wysocki authored
      Introduce boolean function system_entering_hibernation() returning
      'true' during the last phase of hibernation, in which devices are
      being put into low power states and the sleep state (for example,
      ACPI S4) is finally entered.
      Some device drivers need such a function to check if the system is
      in the final phase of hibernation.  In particular, some SATA drivers
      are going to use it for blacklisting systems in which the disks
      should not be spun down during the last phase of hibernation (the
      BIOS will do that anyway).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
  12. 19 Dec, 2008 1 commit
  13. 23 Nov, 2008 1 commit
  14. 21 Oct, 2008 1 commit
  15. 16 Oct, 2008 1 commit
  16. 28 Aug, 2008 1 commit
  17. 12 Jun, 2008 1 commit
    • Rafael J. Wysocki's avatar
      Suspend-related patches for 2.6.27 · d8f3de0d
      Rafael J. Wysocki authored
      ACPI PM: Add possibility to change suspend sequence
      There are some systems out there that don't work correctly with
      our current suspend/hibernation code ordering.  Provide a workaround
      for these systems allowing them to pass 'acpi_sleep=old_ordering' in
      the kernel command line so that it will use the pre-ACPI 2.0 ("old")
      suspend code ordering.
      Unfortunately, this requires us to add a platform hook to the
      resuming of devices for recovering the platform in case one of the
      device drivers' .suspend() routines returns error code.  Namely,
      ACPI 1.0 specifies that _PTS should be called before suspending
      devices, but _WAK still should be called before resuming them in
      order to undo the changes made by _PTS.  However, if there is an
      error during suspending devices, they are automatically resumed
      without returning control to the PM core, so the _WAK has to be
      called from within device_resume() in that cases.
      The patch also reorders and refactors the ACPI suspend/hibernation
      code to avoid duplication as far as reasonably possible.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@suse.cz>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
  18. 10 Jun, 2008 1 commit
    • Rafael J. Wysocki's avatar
      Introduce new top level suspend and hibernation callbacks · 1eede070
      Rafael J. Wysocki authored
      Introduce 'struct pm_ops' and 'struct pm_ext_ops' ('ext' meaning
      'extended') representing suspend and hibernation operations for bus
      types, device classes, device types and device drivers.
      Modify the PM core to use 'struct pm_ops' and 'struct pm_ext_ops'
      objects, if defined, instead of the ->suspend(), ->resume(),
      ->suspend_late(), and ->resume_early() callbacks (the old callbacks
      will be considered as legacy and gradually phased out).
      The main purpose of doing this is to separate suspend (aka S2RAM and
      standby) callbacks from hibernation callbacks in such a way that the
      new callbacks won't take arguments and the semantics of each of them
      will be clearly specified.  This has been requested for multiple
      times by many people, including Linus himself, and the reason is that
      within the current scheme if ->resume() is called, for example, it's
      difficult to say why it's been called (ie. is it a resume from RAM or
      from hibernation or a suspend/hibernation failure etc.?).
      The second purpose is to make the suspend/hibernation callbacks more
      flexible so that device drivers can handle more than they can within
      the current scheme.  For example, some drivers may need to prevent
      new children of the device from being registered before their
      ->suspend() callbacks are executed or they may want to carry out some
      operations requiring the availability of some other devices, not
      directly bound via the parent-child relationship, in order to prepare
      for the execution of ->suspend(), etc.
      Ultimately, we'd like to stop using the freezing of tasks for suspend
      and therefore the drivers' suspend/hibernation code will have to take
      care of the handling of the user space during suspend/hibernation.
      That, in turn, would be difficult within the current scheme, without
      the new ->prepare() and ->complete() callbacks.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
  19. 23 Feb, 2008 1 commit
    • Rafael J. Wysocki's avatar
      PM: Introduce PM_EVENT_HIBERNATE callback state · 3a2d5b70
      Rafael J. Wysocki authored
      During the last step of hibernation in the "platform" mode (with the
      help of ACPI) we use the suspend code, including the devices'
      ->suspend() methods, to prepare the system for entering the ACPI S4
      system sleep state.
      But at least for some devices the operations performed by the
      ->suspend() callback in that case must be different from its operations
      during regular suspend.
      For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
      pass it to the device drivers' ->suspend() methods during the last phase
      of hibernation, so that they can distinguish this case and handle it as
      appropriate.  Modify the drivers that handle PM_EVENT_SUSPEND in a
      special way and need to handle PM_EVENT_HIBERNATE in the same way.
      These changes are necessary to fix a hibernation regression related
      to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Tested-by: default avatarJeff Chua <jeff.chua.linux@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  20. 05 Feb, 2008 1 commit
  21. 01 Feb, 2008 7 commits
  22. 24 Jan, 2008 3 commits
  23. 14 Nov, 2007 1 commit
  24. 18 Oct, 2007 5 commits