An error occurred fetching the project authors.
  1. 08 Dec, 2011 1 commit
  2. 23 Nov, 2011 1 commit
  3. 19 Nov, 2011 1 commit
  4. 31 Oct, 2011 1 commit
  5. 16 Oct, 2011 2 commits
    • Rafael J. Wysocki's avatar
      PM: Fix build issue in main.c for CONFIG_PM_SLEEP unset · ca123102
      Rafael J. Wysocki authored
      Suspend statistics should depend on CONFIG_PM_SLEEP, so make that
      happen.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      ca123102
    • ShuoX Liu's avatar
      PM / Suspend: Add statistics debugfs file for suspend to RAM · 2a77c46d
      ShuoX Liu authored
      Record S3 failure time about each reason and the latest two failed
      devices' names in S3 progress.
      We can check it through 'suspend_stats' entry in debugfs.
      
      The motivation of the patch:
      
      We are enabling power features on Medfield. Comparing with PC/notebook,
      a mobile enters/exits suspend-2-ram (we call it s3 on Medfield) far
      more frequently. If it can't enter suspend-2-ram in time, the power
      might be used up soon.
      
      We often find sometimes, a device suspend fails. Then, system retries
      s3 over and over again. As display is off, testers and developers
      don't know what happens.
      
      Some testers and developers complain they don't know if system
      tries suspend-2-ram, and what device fails to suspend. They need
      such info for a quick check. The patch adds suspend_stats under
      debugfs for users to check suspend to RAM statistics quickly.
      
      If not using this patch, we have other methods to get info about
      what device fails. One is to turn on  CONFIG_PM_DEBUG, but users
      would get too much info and testers need recompile the system.
      
      In addition, dynamic debug is another good tool to dump debug info.
      But it still doesn't match our utilization scenario closely.
      1) user need write a user space parser to process the syslog output;
      2) Our testing scenario is we leave the mobile for at least hours.
         Then, check its status. No serial console available during the
         testing. One is because console would be suspended, and the other
         is serial console connecting with spi or HSU devices would consume
         power. These devices are powered off at suspend-2-ram.
      Signed-off-by: default avatarShuoX Liu <shuox.liu@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      2a77c46d
  6. 15 Jul, 2011 1 commit
  7. 17 May, 2011 1 commit
    • Rafael J. Wysocki's avatar
      PM / Hibernate: Add sysfs knob to control size of memory for drivers · ddeb6487
      Rafael J. Wysocki authored
      Martin reports that on his system hibernation occasionally fails due
      to the lack of memory, because the radeon driver apparently allocates
      too much of it during the device freeze stage.  It turns out that the
      amount of memory allocated by radeon during hibernation (and
      presumably during system suspend too) depends on the utilization of
      the GPU (e.g. hibernating while there are two KDE 4 sessions with
      compositing enabled causes radeon to allocate more memory than for
      one KDE 4 session).
      
      In principle it should be possible to use image_size to make the
      memory preallocation mechanism free enough memory for the radeon
      driver, but in practice it is not easy to guess the right value
      because of the way the preallocation code uses image_size.  For this
      reason, it seems reasonable to allow users to control the amount of
      memory reserved for driver allocations made after the hibernate
      preallocation, which currently is constant and amounts to 1 MB.
      
      Introduce a new sysfs file, /sys/power/reserved_size, whose value
      will be used as the amount of memory to reserve for the
      post-preallocation reservations made by device drivers, in bytes.
      For backwards compatibility, set its default (and initial) value to
      the currently used number (1 MB).
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=34102Reported-and-tested-by: default avatarMartin Steigerwald <Martin@Lichtvoll.de>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      ddeb6487
  8. 31 Mar, 2011 1 commit
  9. 14 Mar, 2011 2 commits
  10. 16 Feb, 2011 1 commit
  11. 16 Oct, 2010 4 commits
    • James Hogan's avatar
      PM: Add sysfs attr for rechecking dev hash from PM trace · d33ac60b
      James Hogan authored
      If the device which fails to resume is part of a loadable kernel module
      it won't be checked at startup against the magic number stored in the
      RTC.
      
      Add a read-only sysfs attribute /sys/power/pm_trace_dev_match which
      contains a list of newline separated devices (usually just the one)
      which currently match the last magic number. This allows the device
      which is failing to resume to be found after the modules are loaded
      again.
      Signed-off-by: default avatarJames Hogan <james@albanarts.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      d33ac60b
    • Rafael J. Wysocki's avatar
      PM / Wakeup: Introduce wakeup source objects and event statistics (v3) · 074037ec
      Rafael J. Wysocki authored
      Introduce struct wakeup_source for representing system wakeup sources
      within the kernel and for collecting statistics related to them.
      Make the recently introduced helper functions pm_wakeup_event(),
      pm_stay_awake() and pm_relax() use struct wakeup_source objects
      internally, so that wakeup statistics associated with wakeup devices
      can be collected and reported in a consistent way (the definition of
      pm_relax() is changed, which is harmless, because this function is
      not called directly by anyone yet).  Introduce new wakeup-related
      sysfs device attributes in /sys/devices/.../power for reporting the
      device wakeup statistics.
      
      Change the global wakeup events counters event_count and
      events_in_progress into atomic variables, so that it is not necessary
      to acquire a global spinlock in pm_wakeup_event(), pm_stay_awake()
      and pm_relax(), which should allow us to avoid lock contention in
      these functions on SMP systems with many wakeup devices.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      074037ec
    • Rafael J. Wysocki's avatar
      PM / Hibernate: Make default image size depend on total RAM size · ac5c24ec
      Rafael J. Wysocki authored
      The default hibernation image size is currently hard coded and euqal
      to 500 MB, which is not a reasonable default on many contemporary
      systems.  Make it equal 2/5 of the total RAM size (this is slightly
      below the maximum, i.e. 1/2 of the total RAM size, and seems to be
      generally suitable).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Tested-by: default avatarM. Vefa Bicakci <bicave@superonline.com>
      ac5c24ec
    • Rafael J. Wysocki's avatar
      PM / Runtime: Use alloc_workqueue() for creating the PM workqueue · bcb5ba8b
      Rafael J. Wysocki authored
      Although we need the PM workqueue to be freezable, we don't need it
      to be singlethread.  Also, the number of concurrent work items
      running on a single CPU need not be constrained.  For these reasons
      use alloc_workqueue() directly, with suitable arguments, instead of
      create_freezeable_workqueue(), to create the runtime PM workqueue.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      bcb5ba8b
  12. 18 Jul, 2010 1 commit
    • Rafael J. Wysocki's avatar
      PM: Make it possible to avoid races between wakeup and system sleep · c125e96f
      Rafael J. Wysocki authored
      One of the arguments during the suspend blockers discussion was that
      the mainline kernel didn't contain any mechanisms making it possible
      to avoid races between wakeup and system suspend.
      
      Generally, there are two problems in that area.  First, if a wakeup
      event occurs exactly when /sys/power/state is being written to, it
      may be delivered to user space right before the freezer kicks in, so
      the user space consumer of the event may not be able to process it
      before the system is suspended.  Second, if a wakeup event occurs
      after user space has been frozen, it is not generally guaranteed that
      the ongoing transition of the system into a sleep state will be
      aborted.
      
      To address these issues introduce a new global sysfs attribute,
      /sys/power/wakeup_count, associated with a running counter of wakeup
      events and three helper functions, pm_stay_awake(), pm_relax(), and
      pm_wakeup_event(), that may be used by kernel subsystems to control
      the behavior of this attribute and to request the PM core to abort
      system transitions into a sleep state already in progress.
      
      The /sys/power/wakeup_count file may be read from or written to by
      user space.  Reads will always succeed (unless interrupted by a
      signal) and return the current value of the wakeup events counter.
      Writes, however, will only succeed if the written number is equal to
      the current value of the wakeup events counter.  If a write is
      successful, it will cause the kernel to save the current value of the
      wakeup events counter and to abort the subsequent system transition
      into a sleep state if any wakeup events are reported after the write
      has returned.
      
      [The assumption is that before writing to /sys/power/state user space
      will first read from /sys/power/wakeup_count.  Next, user space
      consumers of wakeup events will have a chance to acknowledge or
      veto the upcoming system transition to a sleep state.  Finally, if
      the transition is allowed to proceed, /sys/power/wakeup_count will
      be written to and if that succeeds, /sys/power/state will be written
      to as well.  Still, if any wakeup events are reported to the PM core
      by kernel subsystems after that point, the transition will be
      aborted.]
      
      Additionally, put a wakeup events counter into struct dev_pm_info and
      make these per-device wakeup event counters available via sysfs,
      so that it's possible to check the activity of various wakeup event
      sources within the kernel.
      
      To illustrate how subsystems can use pm_wakeup_event(), make the
      low-level PCI runtime PM wakeup-handling code use it.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: default avatarmarkgross <markgross@thegnar.org>
      Reviewed-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      c125e96f
  13. 26 Feb, 2010 1 commit
  14. 06 Dec, 2009 1 commit
  15. 22 Aug, 2009 1 commit
    • Rafael J. Wysocki's avatar
      PM: Introduce core framework for run-time PM of I/O devices (rev. 17) · 5e928f77
      Rafael J. Wysocki authored
      Introduce a core framework for run-time power management of I/O
      devices.  Add device run-time PM fields to 'struct dev_pm_info'
      and device run-time PM callbacks to 'struct dev_pm_ops'.  Introduce
      a run-time PM workqueue and define some device run-time PM helper
      functions at the core level.  Document all these things.
      
      Special thanks to Alan Stern for his help with the design and
      multiple detailed reviews of the pereceding versions of this patch
      and to Magnus Damm for testing feedback.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@igel.co.jp>
      5e928f77
  16. 12 Jun, 2009 4 commits
  17. 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
  18. 19 Apr, 2009 1 commit
    • Rafael J. Wysocki's avatar
      PM/Suspend: Introduce two new platform callbacks to avoid breakage · 6a7c7eaf
      Rafael J. Wysocki authored
      Commit 900af0d9 (PM: Change suspend
      code ordering) changed the ordering of suspend code in such a way
      that the platform .prepare() callback is now executed after the
      device drivers' late suspend callbacks have run.  Unfortunately, this
      turns out to break ARM platforms that need to talk via I2C to power
      control devices during the .prepare() callback.
      
      For this reason introduce two new platform suspend callbacks,
      .prepare_late() and .wake(), that will be called just prior to
      disabling non-boot CPUs and right after bringing them back on line,
      respectively, and use them instead of .prepare() and .finish() for
      ACPI suspend.  Make the PM core execute the .prepare() and .finish()
      platform suspend callbacks where they were executed previously (that
      is, right after calling the regular suspend methods provided by
      device drivers and right before executing their regular resume
      methods, respectively).
      
      It is not necessary to make analogous changes to the hibernation
      code and data structures at the moment, because they are only used
      by ACPI platforms.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Reported-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: default avatarLen Brown <len.brown@intel.com>
      6a7c7eaf
  19. 30 Mar, 2009 2 commits
    • Rafael J. Wysocki's avatar
      PM: Change suspend code ordering · 900af0d9
      Rafael J. Wysocki authored
      Change the ordering of the suspend core code so that the platform
      "prepare" callback is executed and the nonboot CPUs are disabled
      after calling device drivers' "late suspend" methods.
      
      This change 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>
      900af0d9
    • 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
  20. 22 Feb, 2009 1 commit
  21. 16 Jan, 2009 1 commit
  22. 06 Jan, 2009 1 commit
  23. 23 Nov, 2008 1 commit
  24. 18 Nov, 2008 1 commit
  25. 16 Oct, 2008 1 commit
  26. 27 Aug, 2008 1 commit
    • Steven Rostedt's avatar
      ftrace: disable tracing for suspend to ram · f42ac38c
      Steven Rostedt authored
      I've been painstakingly debugging the issue with suspend to ram and
      ftraced. The 2.6.28 code does not have this issue, but since the mcount
      recording is not going to be in 27, this must be solved for the ftrace
      daemon version.
      
      The resume from suspend to ram would reboot because it was triple
      faulting. Debugging further, I found that calling the mcount function
      itself was not an issue, but it would fault when it incremented
      preempt_count. preempt_count is on the tasks info structure that is on the
      low memory address of the task's stack.  For some reason, it could not
      write to it. Resuming out of suspend to ram does quite a lot of funny
      tricks to get to work, so it is not surprising at all that simply doing a
      preempt_disable() would cause a fault.
      
      Thanks to Rafael for suggesting to add a "while (1);" to find the place in
      resuming that is causing the fault. I would place the loop somewhere in
      the code, compile and reboot and see if it would either reboot (hit the
      fault) or simply hang (hit the loop).  Doing this over and over again, I
      narrowed it down that it was happening in enable_nonboot_cpus.
      
      At this point, I found that it is easier to simply disable tracing around
      the suspend code, instead of searching for the particular function that
      can not handle doing a preempt_disable.
      
      This patch disables the tracer as it suspends and reenables it on resume.
      
      I tested this patch on my Laptop, and it can resume fine with the patch.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Acked-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f42ac38c
  27. 26 Jul, 2008 1 commit
  28. 24 Jul, 2008 1 commit
    • David Brownell's avatar
      pm: boot time suspend selftest · 77437fd4
      David Brownell authored
      Boot-time test for system suspend states (STR or standby).  The generic
      RTC framework triggers wakeup alarms, which are used to exit those states.
      
        - Measures some aspects of suspend time ... this uses "jiffies" until
          someone converts it to use a timebase that works properly even while
          timer IRQs are disabled.
      
        - Triggered by a command line parameter.  By default nothing even
          vaguely troublesome will happen, but "test_suspend=mem" will give
          you a brief STR test during system boot.  (Or you may need to use
          "test_suspend=standby" instead, if your hardware needs that.)
      
      This isn't without problems.  It fires early enough during boot that for
      example both PCMCIA and MMC stacks have misbehaved.  The workaround in
      those cases was to boot without such media cards inserted.
      
      [matthltc@us.ibm.com: fix compile failure in boot time suspend selftest]
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Pavel Machek <pavel@suse.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: default avatarMatt Helsley <matthltc@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      77437fd4
  29. 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
  30. 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
  31. 01 Feb, 2008 1 commit