1. 08 Jul, 2009 1 commit
  2. 12 Jun, 2009 4 commits
  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
      Berg):
      
      CPU 3       CPU 2                     CPU 1
                                            suspend/hibernate
                  something:
                  rtnl_lock()               device_pm_lock()
                                             -> mutex_lock(&dpm_list_mtx)
      
                  mutex_lock(&dpm_list_mtx)
      
      linkwatch_work
       -> rtnl_lock()
                                            disable_nonboot_cpus()
                                             -> 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
      http://bugzilla.kernel.org/show_bug.cgi?id=13245
      
      .
      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>
      32bdfac5
  4. 30 Mar, 2009 1 commit
    • 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
      resume).
      
      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
      case.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      2ed8d2b3
  5. 24 Mar, 2009 1 commit
  6. 22 Feb, 2009 1 commit
  7. 06 Jan, 2009 2 commits
  8. 16 Oct, 2008 2 commits
    • Bjorn Helgaas's avatar
      vsprintf: use new vsprintf symbolic function pointer format · c80cfb04
      Bjorn Helgaas authored
      
      
      Use the '%pF' format to get rid of an "#ifdef DEBUG" and make some printks
      atomic.
      
      This removes the last in-tree uses of print_fn_descriptor_symbol().  I
      marked print_fn_descriptor_symbol() deprecated and scheduled it for
      removal next year to give time for out-of-tree modules to be updated.
      
      parisc's print_fn_descriptor_symbol() is currently broken there (it needs
      to dereference the function pointer similar to ia64 and power).  This
      patch shouldn't make anything worse, but it means we need to fix
      dereference_function_descriptor() instead of print_fn_descriptor_symbol()
      to get meaningful initcall_debug output.
      Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c80cfb04
    • Arjan van de Ven's avatar
      debug: use dev_WARN() rather than WARN_ON() in device_pm_add() · 728f0893
      Arjan van de Ven authored
      
      
      device_pm_add() has a WARN_ON that is showing relatively high on
      kerneloops.org, but unfortunately the WARN_ON is less than useful
      in that it doesn't print any information about what device is causing
      the issue.
      
      This patch fixes this by turning the WARN_ON() into the newly
      introduces dev_WARN() which will print information about the
      device in question.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      728f0893
  9. 12 Oct, 2008 1 commit
  10. 07 Sep, 2008 1 commit
    • Jeremy Fitzhardinge's avatar
      x86: check for and defend against BIOS memory corruption · 5394f80f
      Jeremy Fitzhardinge authored
      
      
      Some BIOSes have been observed to corrupt memory in the low 64k.  This
      change:
       - Reserves all memory which does not have to be in that area, to
         prevent it from being used as general memory by the kernel.  Things
         like the SMP trampoline are still in the memory, however.
       - Clears the reserved memory so we can observe changes to it.
       - Adds a function check_for_bios_corruption() which checks and reports on
         memory becoming unexpectedly non-zero.  Currently it's called in the
         x86 fault handler, and the powermanagement debug output.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      5394f80f
  11. 21 Aug, 2008 2 commits
  12. 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>
      d8f3de0d
  13. 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>
      1eede070
  14. 15 May, 2008 1 commit
  15. 22 Apr, 2008 1 commit
  16. 19 Apr, 2008 5 commits
    • Rafael J. Wysocki's avatar
      PM: Remove destroy_suspended_device() · b844eba2
      Rafael J. Wysocki authored
      
      
      After 2.6.24 there was a plan to make the PM core acquire all device
      semaphores during a suspend/hibernation to protect itself from
      concurrent operations involving device objects.  That proved to be
      too heavy-handed and we found a better way to achieve the goal, but
      before it happened, we had introduced the functions
      device_pm_schedule_removal() and destroy_suspended_device() to allow
      drivers to "safely" destroy a suspended device and we had adapted some
      drivers to use them.  Now that these functions are no longer necessary,
      it seems reasonable to remove them and modify their users to use the
      normal device unregistration instead.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b844eba2
    • Alan Stern's avatar
      PM: Make wakeup flags available whenever CONFIG_PM is set · d288e47c
      Alan Stern authored
      The various wakeup flags and their accessor macros in struct
      dev_pm_info should be available whenever CONFIG_PM is enabled, not
      just when CONFIG_PM_SLEEP is on.  Otherwise remote wakeup won't always
      be configurable for runtime power management.  This patch (as1056b)
      fixes the oversight.
      
      David Brownell adds:
      	More accurately, fixes the "regression" ... as noted sometime
      	last summer, after 296699de
      
      
      	introduced CONFIG_SUSPEND.  But that didn't make the regression
      	list for that kernel, ergo the delay in fixing it.
      
      [rjw: rebased]
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d288e47c
    • Rafael J. Wysocki's avatar
      Driver core: Call device_pm_add() after bus_add_device() in device_add() · 57eee3d2
      Rafael J. Wysocki authored
      
      
      Include dpm_sysfs_add() into device_pm_add(), in analogy with
      device_pm_remove(), and modify device_add() to call the latter after
      bus_add_device(), to avoid situations in which the PM core may
      attempt to suspend a device the registration of which has not been
      successful.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      57eee3d2
    • Rafael J. Wysocki's avatar
      PM: Handle device registrations during suspend/resume · 58aca232
      Rafael J. Wysocki authored
      
      
      Modify the PM core to protect its data structures, specifically the
      dpm_active list, from being corrupted if a child of the currently
      suspending device is registered concurrently with its ->suspend()
      callback.  In that case, since the new device (the child) is added
      to dpm_active after its parent, the PM core will attempt to
      suspend it after the parent, which is wrong.
      
      Introduce a new member of struct dev_pm_info, called 'sleeping',
      and use it to check if the parent of the device being added to
      dpm_active has been suspended, in which case the device registration
      fails.  Also, use 'sleeping' for checking if the ordering of devices
      on dpm_active is correct.
      
      Introduce variable 'all_sleeping' that will be set to 'true' once all
      devices have been suspended and make new device registrations fail
      until 'all_sleeping' is reset to 'false', in order to avoid having
      unsuspended devices around while the system is going into a sleep state.
      
      Remove pm_sleep_rwsem which is not necessary any more.
      
      Special thanks to Alan Stern for discussions and suggestions that
      lead to the creation of this patch.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      58aca232
    • Pavel Machek's avatar
      power_state: remove it from driver core · 35d313b8
      Pavel Machek authored
      
      
      power_state is scheduled for removal, and it is used only for debug
      prints by driver core. Remove it.
      Signed-off-by: default avatarPavel Machek <pavel@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      35d313b8
  17. 04 Mar, 2008 2 commits
  18. 21 Feb, 2008 3 commits
  19. 02 Feb, 2008 1 commit
  20. 24 Jan, 2008 1 commit
    • Rafael J. Wysocki's avatar
      PM: Acquire device locks on suspend · 775b64d2
      Rafael J. Wysocki authored
      
      
      This patch reorganizes the way suspend and resume notifications are
      sent to drivers.  The major changes are that now the PM core acquires
      every device semaphore before calling the methods, and calls to
      device_add() during suspends will fail, while calls to device_del()
      during suspends will block.
      
      It also provides a way to safely remove a suspended device with the
      help of the PM core, by using the device_pm_schedule_removal() callback
      introduced specifically for this purpose, and updates two drivers (msr
      and cpuid) that need to use it.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      775b64d2
  21. 28 Nov, 2007 1 commit
  22. 12 Oct, 2007 1 commit
  23. 11 Jul, 2007 2 commits
  24. 27 Apr, 2007 1 commit
  25. 11 Apr, 2007 1 commit
  26. 30 Jun, 2006 1 commit