1. 29 Nov, 2016 1 commit
    • Chen Yu's avatar
      timekeeping: Ignore the bogus sleep time if pm_trace is enabled · ba58d102
      Chen Yu authored
      Power management suspend/resume tracing (ab)uses the RTC to store
      suspend/resume information persistently. As a consequence the RTC value is
      clobbered when timekeeping is resumed and tries to inject the sleep time.
      
      Commit a4f8f666 ("timekeeping: Cap array access in timekeeping_debug")
      plugged a out of bounds array access in the timekeeping debug code which
      was caused by the clobbered RTC value, but we still use the clobbered RTC
      value for sleep time injection into kernel timekeeping, which will result
      in random adjustments depending on the stored "hash" value.
      
      To prevent this keep track of the RTC clobbering and ignore the invalid RTC
      timestamp at resume. If the system resumed successfully clear the flag,
      which marks the RTC as unusable, warn the user about the RTC clobber and
      recommend to adjust the RTC with 'ntpdate' or 'rdate'.
      
      [jstultz: Fixed up pr_warn formating, and implemented suggestions from Ingo]
      [ tglx: Rewrote changelog ]
      
      Originally-from: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarChen Yu <yu.c.chen@intel.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Acked-by: Pavel Machek's avatarPavel Machek <pavel@ucw.cz>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Xunlei Pang <xlpang@redhat.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: http://lkml.kernel.org/r/1480372524-15181-3-git-send-email-john.stultz@linaro.orgSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      ba58d102
  2. 18 Mar, 2015 1 commit
  3. 16 Oct, 2010 1 commit
    • 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
  4. 26 Feb, 2010 1 commit
    • Rafael J. Wysocki's avatar
      PM: Asynchronous suspend and resume of devices · 5af84b82
      Rafael J. Wysocki authored
      Theoretically, the total time of system sleep transitions (suspend
      to RAM, hibernation) can be reduced by running suspend and resume
      callbacks of device drivers in parallel with each other.  However,
      there are dependencies between devices such that we're not allowed
      to suspend the parent of a device before suspending the device
      itself.  Analogously, we're not allowed to resume a device before
      resuming its parent.
      
      The most straightforward way to take these dependencies into accout
      is to start the async threads used for suspending and resuming
      devices at the core level, so that async_schedule() is called for
      each suspend and resume callback supposed to be executed
      asynchronously.
      
      For this purpose, introduce a new device flag, power.async_suspend,
      used to mark the devices whose suspend and resume callbacks are to be
      executed asynchronously (ie. in parallel with the main suspend/resume
      thread and possibly in parallel with each other) and helper function
      device_enable_async_suspend() allowing one to set power.async_suspend
      for given device (power.async_suspend is unset by default for all
      devices).  For each device with the power.async_suspend flag set the
      PM core will use async_schedule() to execute its suspend and resume
      callbacks.
      
      The async threads started for different devices as a result of
      calling async_schedule() are synchronized with each other and with
      the main suspend/resume thread with the help of completions, in the
      following way:
      (1) There is a completion, power.completion, for each device object.
      (2) Each device's completion is reset before calling async_schedule()
          for the device or, in the case of devices with the
          power.async_suspend flags unset, before executing the device's
          suspend and resume callbacks.
      (3) During suspend, right before running the bus type, device type
          and device class suspend callbacks for the device, the PM core
          waits for the completions of all the device's children to be
          completed.
      (4) During resume, right before running the bus type, device type and
          device class resume callbacks for the device, the PM core waits
          for the completion of the device's parent to be completed.
      (5) The PM core completes power.completion for each device right
          after the bus type, device type and device class suspend (or
          resume) callbacks executed for the device have returned.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      5af84b82
  5. 25 May, 2008 1 commit
  6. 22 Jul, 2007 1 commit
  7. 26 Sep, 2006 1 commit
  8. 24 Jun, 2006 1 commit