1. 19 9月, 2012 1 次提交
  2. 07 9月, 2012 1 次提交
  3. 18 8月, 2012 1 次提交
    • T
      PM / Sleep: Print name of wakeup source that aborts suspend · a938da06
      Todd Poynor 提交于
      A driver or app may repeatedly request a wakeup source while the system
      is attempting to enter suspend, which may indicate a bug or at least
      point out a highly active system component that is responsible for
      decreased battery life on a mobile device.  Even when the incidence
      of suspend abort is not severe, identifying wakeup sources that
      frequently abort suspend can be a useful clue for power management
      analysis.
      
      In some cases the existing stats can point out the offender where there is
      an unexpectedly high activation count that stands out from the others, but
      in other cases the wakeup source frequently taken just after the rest of
      the system thinks its time to suspend might not stand out in the overall
      stats.
      
      It is also often useful to have information about what's been happening
      recently, rather than totals of all activity for the system boot.
      
      It's suggested to dump a line about which wakeup source
      aborted suspend to aid analysis of these situations.
      Signed-off-by: NTodd Poynor <toddpoynor@google.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      a938da06
  4. 09 8月, 2012 1 次提交
  5. 01 8月, 2012 1 次提交
  6. 30 7月, 2012 3 次提交
    • M
      common: dma-mapping: introduce dma_get_sgtable() function · d2b7428e
      Marek Szyprowski 提交于
      This patch adds dma_get_sgtable() function which is required to let
      drivers to share the buffers allocated by DMA-mapping subsystem. Right
      now the driver gets a dma address of the allocated buffer and the kernel
      virtual mapping for it. If it wants to share it with other device (= map
      into its dma address space) it usually hacks around kernel virtual
      addresses to get pointers to pages or assumes that both devices share
      the DMA address space. Both solutions are just hacks for the special
      cases, which should be avoided in the final version of buffer sharing.
      
      To solve this issue in a generic way, a new call to DMA mapping has been
      introduced - dma_get_sgtable(). It allocates a scatter-list which
      describes the allocated buffer and lets the driver(s) to use it with
      other device(s) by calling dma_map_sg() on it.
      
      This patch provides a generic implementation based on virt_to_page()
      call. Architectures which require more sophisticated translation might
      provide their own get_sgtable() methods.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d2b7428e
    • M
      common: dma-mapping: add support for generic dma_mmap_* calls · 64ccc9c0
      Marek Szyprowski 提交于
      Commit 9adc5374 ('common: dma-mapping: introduce mmap method') added a
      generic method for implementing mmap user call to dma_map_ops structure.
      
      This patch converts ARM and PowerPC architectures (the only providers of
      dma_mmap_coherent/dma_mmap_writecombine calls) to use this generic
      dma_map_ops based call and adds a generic cross architecture
      definition for dma_mmap_attrs, dma_mmap_coherent, dma_mmap_writecombine
      functions.
      
      The generic mmap virt_to_page-based fallback implementation is provided for
      architectures which don't provide their own implementation for mmap method.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NKyungmin Park <kyungmin.park@samsung.com>
      64ccc9c0
    • A
      new helper: done_path_create() · 921a1650
      Al Viro 提交于
      releases what needs to be released after {kern,user}_path_create()
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      921a1650
  7. 20 7月, 2012 1 次提交
  8. 19 7月, 2012 5 次提交
    • C
      PM / Sleep: call early resume handlers when suspend_noirq fails · 064b021f
      Colin Cross 提交于
      Commit cf579dfb (PM / Sleep: Introduce
      "late suspend" and "early resume" of devices) introduced a bug where
      suspend_late handlers would be called, but if dpm_suspend_noirq returned
      an error the early_resume handlers would never be called.  All devices
      would end up on the dpm_late_early_list, and would never be resumed
      again.
      
      Fix it by calling dpm_resume_early when dpm_suspend_noirq returns
      an error.
      Signed-off-by: NColin Cross <ccross@android.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      064b021f
    • L
      Make wait_for_device_probe() also do scsi_complete_async_scans() · eea03c20
      Linus Torvalds 提交于
      Commit a7a20d10 ("sd: limit the scope of the async probe domain")
      make the SCSI device probing run device discovery in it's own async
      domain.
      
      However, as a result, the partition detection was no longer synchronized
      by async_synchronize_full() (which, despite the name, only synchronizes
      the global async space, not all of them).  Which in turn meant that
      "wait_for_device_probe()" would not wait for the SCSI partitions to be
      parsed.
      
      And "wait_for_device_probe()" was what the boot time init code relied on
      for mounting the root filesystem.
      
      Now, most people never noticed this, because not only is it
      timing-dependent, but modern distributions all use initrd.  So the root
      filesystem isn't actually on a disk at all.  And then before they
      actually mount the final disk filesystem, they will have loaded the
      scsi-wait-scan module, which not only does the expected
      wait_for_device_probe(), but also does scsi_complete_async_scans().
      
      [ Side note: scsi_complete_async_scans() had also been partially broken,
        but that was fixed in commit 43a8d39d ("fix async probe
        regression"), so that same commit a7a20d10 had actually broken
        setups even if you used scsi-wait-scan explicitly ]
      
      Solve this problem by just moving the scsi_complete_async_scans() call
      into wait_for_device_probe().  Everybody who wants to wait for device
      probing to finish really wants the SCSI probing to complete, so there's
      no reason not to do this.
      
      So now "wait_for_device_probe()" really does what the name implies, and
      properly waits for device probing to finish.  This also removes the now
      unnecessary extra calls to scsi_complete_async_scans().
      Reported-and-tested-by: NArtem S. Tashkinov <t.artem@mailcity.com>
      Cc: Dan Williams <dan.j.williams@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: James Bottomley <jbottomley@parallels.com>
      Cc: Borislav Petkov <bp@amd64.org>
      Cc: linux-scsi <linux-scsi@vger.kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eea03c20
    • S
      PM / QoS: Use NULL pointer instead of plain integer in qos.c · ad0446eb
      Sachin Kamat 提交于
      Fix the following sparse warning:
      drivers/base/power/qos.c:465:29: warning: Using plain integer as NULL pointer
      Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      ad0446eb
    • S
      PM / Sleep: Add missing static storage class specifiers in main.c · 7664e969
      Sachin Kamat 提交于
      Fix the following sparse warnings:
      drivers/base/power/main.c:48:1: warning: symbol 'dpm_prepared_list' was not declared. Should it be static?
      drivers/base/power/main.c:49:1: warning: symbol 'dpm_suspended_list' was not declared. Should it be static?
      drivers/base/power/main.c:50:1: warning: symbol 'dpm_late_early_list' was not declared. Should it be static?
      drivers/base/power/main.c:51:1: warning: symbol 'dpm_noirq_list' was not declared. Should it be static?
      Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      7664e969
    • D
  9. 18 7月, 2012 1 次提交
  10. 17 7月, 2012 5 次提交
  11. 14 7月, 2012 1 次提交
    • A
      get rid of kern_path_parent() · 79714f72
      Al Viro 提交于
      all callers want the same thing, actually - a kinda-sorta analog of
      kern_path_create().  I.e. they want parent vfsmount/dentry (with
      ->i_mutex held, to make sure the child dentry is still their child)
      + the child dentry.
      
      Signed-off-by Al Viro <viro@zeniv.linux.org.uk>
      79714f72
  12. 13 7月, 2012 2 次提交
  13. 11 7月, 2012 3 次提交
    • S
      PM / Domains: Replace plain integer with NULL pointer in domain.c file · db79e53d
      Sachin Kamat 提交于
      Fixes the following sparse warning:
      drivers/base/power/domain.c:1679:55: warning: Using plain integer as NULL pointer
      Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      db79e53d
    • S
      PM / Domains: Add missing static storage class specifier in domain.c file · 8951ef02
      Sachin Kamat 提交于
      Fixes the folloiwng sparse warning:
      drivers/base/power/domain.c:149:5:
      warning: symbol '__pm_genpd_poweron' was not declared. Should it be static?
      Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      8951ef02
    • P
      PM / cpuidle: System resume hang fix with cpuidle · 8651f97b
      Preeti U Murthy 提交于
      On certain bios, resume hangs if cpus are allowed to enter idle states
      during suspend [1].
      
      This was fixed in apci idle driver [2].But intel_idle driver does not
      have this fix. Thus instead of replicating the fix in both the idle
      drivers, or in more platform specific idle drivers if needed, the
      more general cpuidle infrastructure could handle this.
      
      A suspend callback in cpuidle_driver could handle this fix. But
      a cpuidle_driver provides only basic functionalities like platform idle
      state detection capability and mechanisms to support entry and exit
      into CPU idle states. All other cpuidle functions are found in the
      cpuidle generic infrastructure for good reason that all cpuidle
      drivers, irrepective of their platforms will support these functions.
      
      One option therefore would be to register a suspend callback in cpuidle
      which handles this fix. This could be called through a PM_SUSPEND_PREPARE
      notifier. But this is too generic a notfier for a driver to handle.
      
      Also, ideally the job of cpuidle is not to handle side effects of suspend.
      It should expose the interfaces which "handle cpuidle 'during' suspend"
      or any other operation, which the subsystems call during that respective
      operation.
      
      The fix demands that during suspend, no cpus should be allowed to enter
      deep C-states. The interface cpuidle_uninstall_idle_handler() in cpuidle
      ensures that. Not just that it also kicks all the cpus which are already
      in idle out of their idle states which was being done during cpu hotplug
      through a CPU_DYING_FROZEN callbacks.
      
      Now the question arises about when during suspend should
      cpuidle_uninstall_idle_handler() be called. Since we are dealing with
      drivers it seems best to call this function during dpm_suspend().
      Delaying the call till dpm_suspend_noirq() does no harm, as long as it is
      before cpu_hotplug_begin() to avoid race conditions with cpu hotpulg
      operations. In dpm_suspend_noirq(), it would be wise to place this call
      before suspend_device_irqs() to avoid ugly interactions with the same.
      
      Ananlogously, during resume.
      
      References:
      [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/674075.
      [2] http://marc.info/?l=linux-pm&m=133958534231884&w=2Reported-and-tested-by: NDave Hansen <dave@linux.vnet.ibm.com>
      Signed-off-by: NPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Reviewed-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      8651f97b
  14. 06 7月, 2012 3 次提交
    • M
      regmap: Add hook for printk logging for debugging during early init · 1044c180
      Mark Brown 提交于
      Sometimes for failures during very early init the trace infrastructure
      isn't available early enough to be used.  For this sort of problem
      defining LOG_DEVICE will add printks for basic register I/O on a specific
      device, allowing trace to be extracted when the trace system doesn't come
      up early enough to work with.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      1044c180
    • R
      PM / Domains: Allow device callbacks to be added at any time · 62d44902
      Rafael J. Wysocki 提交于
      Make it possible to modify device callbacks used by the generic PM
      domains core code at any time, not only after the device has been
      added to a domain.  This will allow device drivers to provide their
      own device PM domain callbacks even if they are registered before
      adding the devices to PM domains.
      
      For this purpose, use the observation that the struct
      generic_pm_domain_data object containing the relevant callback
      pointers may be allocated by pm_genpd_add_callbacks() and the
      callbacks may be set before __pm_genpd_add_device() is run for
      the given device.  This object will then be used by
      __pm_genpd_add_device(), but it has to be protected from
      premature removal by reference counting.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      62d44902
    • R
      PM / Domains: Add device domain data reference counter · 1d5fcfec
      Rafael J. Wysocki 提交于
      Add a mechanism for counting references to the
      struct generic_pm_domain_data object pointed to by
      dev->power.subsys_data->domain_data if the device in question
      belongs to a generic PM domain.
      
      This change is necessary for a subsequent patch making it possible to
      allocate that object from within pm_genpd_add_callbacks(), so that
      drivers can attach their PM domain device callbacks to devices before
      those devices are added to PM domains.
      
      This patch has been tested on the SH7372 Mackerel board.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      1d5fcfec
  15. 04 7月, 2012 1 次提交
    • R
      PM / Domains: Add preliminary support for cpuidle, v2 · cbc9ef02
      Rafael J. Wysocki 提交于
      On some systems there are CPU cores located in the same power
      domains as I/O devices.  Then, power can only be removed from the
      domain if all I/O devices in it are not in use and the CPU core
      is idle.  Add preliminary support for that to the generic PM domains
      framework.
      
      First, the platform is expected to provide a cpuidle driver with one
      extra state designated for use with the generic PM domains code.
      This state should be initially disabled and its exit_latency value
      should be set to whatever time is needed to bring up the CPU core
      itself after restoring power to it, not including the domain's
      power on latency.  Its .enter() callback should point to a procedure
      that will remove power from the domain containing the CPU core at
      the end of the CPU power transition.
      
      The remaining characteristics of the extra cpuidle state, referred to
      as the "domain" cpuidle state below, (e.g. power usage, target
      residency) should be populated in accordance with the properties of
      the hardware.
      
      Next, the platform should execute genpd_attach_cpuidle() on the PM
      domain containing the CPU core.  That will cause the generic PM
      domains framework to treat that domain in a special way such that:
      
       * When all devices in the domain have been suspended and it is about
         to be turned off, the states of the devices will be saved, but
         power will not be removed from the domain.  Instead, the "domain"
         cpuidle state will be enabled so that power can be removed from
         the domain when the CPU core is idle and the state has been chosen
         as the target by the cpuidle governor.
      
       * When the first I/O device in the domain is resumed and
         __pm_genpd_poweron(() is called for the first time after
         power has been removed from the domain, the "domain" cpuidle
         state will be disabled to avoid subsequent surprise power removals
         via cpuidle.
      
      The effective exit_latency value of the "domain" cpuidle state
      depends on the time needed to bring up the CPU core itself after
      restoring power to it as well as on the power on latency of the
      domain containing the CPU core.  Thus the "domain" cpuidle state's
      exit_latency has to be recomputed every time the domain's power on
      latency is updated, which may happen every time power is restored
      to the domain, if the measured power on latency is greater than
      the latency stored in the corresponding generic_pm_domain structure.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      cbc9ef02
  16. 01 7月, 2012 4 次提交
    • R
      PM / Domains: Do not stop devices after restoring their states · 80de3d7f
      Rafael J. Wysocki 提交于
      While resuming a device belonging to a PM domain,
      pm_genpd_runtime_resume() calls __pm_genpd_restore_device() to
      restore its state, if necessary.  The latter starts the device,
      using genpd_start_dev(), restores its state, using
      genpd_restore_dev(), and then stops it, using genpd_stop_dev().
      However, this last operation is not necessary, because the
      device is supposed to be operational after pm_genpd_runtime_resume()
      has returned and because of it pm_genpd_runtime_resume() has to
      call genpd_start_dev() once again for the "restored" device, which
      is inefficient.
      
      To make things more efficient, remove the call to genpd_stop_dev()
      from __pm_genpd_restore_device() and the direct call to
      genpd_start_dev() from pm_genpd_runtime_resume().  [Of course,
      genpd_start_dev() still has to be called by it for devices with the
      power.irq_safe flag set, because __pm_genpd_restore_device() is not
      executed for them.]
      
      This change has been tested on the SH7372 Mackerel board.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      80de3d7f
    • R
      PM / Domains: Use subsystem runtime suspend/resume callbacks by default · 0b589741
      Rafael J. Wysocki 提交于
      Currently, the default "save state" and "restore state" routines
      for generic PM domains, pm_genpd_default_save_state() and
      pm_genpd_default_restore_state(), respectively, only use runtime PM
      callbacks provided by device drivers, but in general those callbacks
      need not provide the entire necessary functionality.  Namely, in
      general it may be necessary to execute subsystem (i.e. device type,
      device class or bus type) callbacks that will carry out all of the
      necessary operations.
      
      For this reason, modify pm_genpd_default_save_state() and
      pm_genpd_default_restore_state() to execute subsystem callbacks,
      if they are provided, and fall back to driver callbacks otherwise.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      0b589741
    • R
      PM / Sleep: Separate printing suspend times from initcall_debug · b2df1d4f
      Rafael J. Wysocki 提交于
      Change the behavior of the newly introduced
      /sys/power/pm_print_times attribute so that its initial value
      depends on initcall_debug, but setting it to 0 will cause device
      suspend/resume times not to be printed, even if initcall_debug has
      been set.  This way, the people who use initcall_debug for reasons
      other than PM debugging will be able to switch the suspend/resume
      times printing off, if need be.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Reviewed-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2df1d4f
    • S
      PM / Sleep: add knob for printing device resume times · 4b7760ba
      Sameer Nanda 提交于
      Added a new knob called /sys/power/pm_print_times. Setting it to 1
      enables printing of time taken by devices to suspend and resume.
      Setting it to 0 disables this printing (unless overridden by
      initcall_debug kernel command line option).
      Signed-off-by: NSameer Nanda <snanda@chromium.org>
      Acked-by: NGreg KH <gregkh@linuxfoundation.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      4b7760ba
  17. 25 6月, 2012 1 次提交
  18. 19 6月, 2012 1 次提交
  19. 18 6月, 2012 2 次提交
  20. 15 6月, 2012 1 次提交
  21. 14 6月, 2012 1 次提交