1. 17 10月, 2010 18 次提交
    • M
      PM: runtime: add missed pm_request_autosuspend · 5fc62aad
      Ming Lei 提交于
      The patch "PM / Runtime: Implement autosuspend support" introduces
      "autosuspend" facility for runtime PM, but misses helper function
      of pm_request_autosuspend, so add it.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      5fc62aad
    • R
      PM / Hibernate: Make some boot messages look less scary · d0941ead
      Rafael J. Wysocki 提交于
      The hibernate resume code checks if there is an image to resume from
      on every boot and, if the kernel is built with CONFIG_PM_DEBUG set
      and the image is not present, it prints some scary messages
      suggesting there was a boot error of some sort.  Apparently, some
      users are confused by them, so make them look less scary and adjust
      the other hibernate resume debug messages to match them.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      d0941ead
    • A
      PM / Runtime: Implement autosuspend support · 15bcb91d
      Alan Stern 提交于
      This patch (as1427) implements the "autosuspend" facility for runtime
      PM.  A few new fields are added to the dev_pm_info structure and
      several new PM helper functions are defined, for telling the PM core
      whether or not a device uses autosuspend, for setting the autosuspend
      delay, and for marking periods of device activity.
      
      Drivers that do not want to use autosuspend can continue using the
      same helper functions as before; their behavior will not change.  In
      addition, drivers supporting autosuspend can also call the old helper
      functions to get the old behavior.
      
      The details are all explained in Documentation/power/runtime_pm.txt
      and Documentation/ABI/testing/sysfs-devices-power.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      15bcb91d
    • A
      PM / Runtime: Add no_callbacks flag · 7490e442
      Alan Stern 提交于
      Some devices, such as USB interfaces, cannot be power-managed
      independently of their parents, i.e., they cannot be put in low power
      while the parent remains at full power.  This patch (as1425) creates a
      new "no_callbacks" flag, which tells the PM core not to invoke the
      runtime-PM callback routines for the such devices but instead to
      assume that the callbacks always succeed.  In addition, the
      non-debugging runtime-PM sysfs attributes for the devices are removed,
      since they are pretty much meaningless.
      
      The advantage of this scheme comes not so much from avoiding the
      callbacks themselves, but rather from the fact that without the need
      for a process context in which to run the callbacks, more work can be
      done in interrupt context.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      7490e442
    • A
      PM / Runtime: Combine runtime PM entry points · 140a6c94
      Alan Stern 提交于
      This patch (as1424) combines the various public entry points for the
      runtime PM routines into three simple functions: one for idle, one for
      suspend, and one for resume.  A new bitflag specifies whether or not
      to increment or decrement the usage_count field.
      
      The new entry points are named __pm_runtime_idle,
      __pm_runtime_suspend, and __pm_runtime_resume, to reflect that they
      are trampolines.  Simultaneously, the corresponding internal routines
      are renamed to rpm_idle, rpm_suspend, and rpm_resume.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      140a6c94
    • A
      PM / Runtime: Merge synchronous and async runtime routines · 1bfee5bc
      Alan Stern 提交于
      This patch (as1423) merges the asynchronous routines
      __pm_request_idle(), __pm_request_suspend(), and __pm_request_resume()
      with their synchronous counterparts.  The RPM_ASYNC bitflag argument
      serves to indicate what sort of operation to perform.
      
      In the course of performing this merger, it became apparent that the
      various functions don't all behave consistenly with regard to error
      reporting and cancellation of outstanding requests.  A new routine,
      rpm_check_suspend_allowed(), was written to centralize much of the
      testing, and the other functions were revised to follow a simple
      algorithm:
      
      	If the operation is disallowed because of the device's
      	settings or current state, return an error.
      
      	Cancel pending or scheduled requests of lower priority.
      
      	Schedule, queue, or perform the desired operation.
      
      A few special cases and exceptions are noted in comments.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      1bfee5bc
    • A
      PM / Runtime: Replace boolean arguments with bitflags · 3f9af051
      Alan Stern 提交于
      The "from_wq" argument in __pm_runtime_suspend() and
      __pm_runtime_resume() supposedly indicates whether or not the function
      was called by the PM workqueue thread, but in fact it isn't always
      used this way.  It really indicates whether or not the function should
      return early if the requested operation is already in progress.
      
      Along with this badly-named boolean argument, later patches in this
      series will add several other boolean arguments to these functions and
      others.  Therefore this patch (as1422) begins the conversion process
      by replacing from_wq with a bitflag argument.  The same bitflags are
      also used in __pm_runtime_get() and __pm_runtime_put(), where they
      indicate whether or not the operation should be asynchronous.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      3f9af051
    • A
      PM / Runtime: Move code in drivers/base/power/runtime.c · 4769373c
      Alan Stern 提交于
      This patch (as1421) moves the PM runtime accounting subroutines up to
      the beginning of runtime.c, taking them out of the middle of the
      functions that do the actual work.  No operational changes.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      4769373c
    • A
      sysfs: Add sysfs_merge_group() and sysfs_unmerge_group() · 69d44ffb
      Alan Stern 提交于
      This patch (as1420) adds sysfs_merge_group() and sysfs_unmerge_group()
      functions, allowing drivers easily to add and remove sets of
      attributes to a pre-existing attribute group directory.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      69d44ffb
    • R
      PM: Fix potential issue with failing asynchronous suspend · 098dff73
      Rafael J. Wysocki 提交于
      There is a potential issue with the asynchronous suspend code that
      a device driver suspending asynchronously may not notice that it
      should back off.  There are two failing scenarions, (1) when the
      driver is waiting for a driver suspending synchronously to complete
      and that second driver returns error code, in which case async_error
      won't be set and the waiting driver will continue suspending and (2)
      after the driver has called device_pm_wait_for_dev() and the waited
      for driver returns error code, in which case the caller of
      device_pm_wait_for_dev() will not know that there was an error and
      will continue suspending.
      
      To fix this issue make __device_suspend() set async_error, so
      async_suspend() doesn't need to set it any more, and make
      device_pm_wait_for_dev() return async_error, so that its callers
      can check whether or not they should continue suspending.
      
      No more changes are necessary, since device_pm_wait_for_dev() is
      not used by any drivers' suspend routines.
      Reported-by: NColin Cross <ccross@android.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      098dff73
    • R
      PM / Wakeup: Introduce wakeup source objects and event statistics (v3) · 074037ec
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      074037ec
    • K
      PM: Fix signed/unsigned warning in dpm_show_time() · 0702d9ee
      Kevin Cernekee 提交于
      Seen on MIPS32, gcc 4.4.3, 2.6.36-rc4:
      
      drivers/base/power/main.c: In function 'dpm_show_time':
      drivers/base/power/main.c:415: warning: comparison of distinct pointer types lacks a cast
      
      do_div() takes unsigned parameters:
      
      uint32_t do_div(uint64_t *n, uint32_t base);
      
      Using an unsigned variable for usecs64 should not cause any problems,
      because calltime >= starttime .
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      0702d9ee
    • R
      PM / Hibernate: Make default image size depend on total RAM size · ac5c24ec
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rjw@sisk.pl>
      Tested-by: NM. Vefa Bicakci <bicave@superonline.com>
      ac5c24ec
    • R
      PM / Hibernate: Improve comments in hibernate_preallocate_memory() · 266f1a25
      Rafael J. Wysocki 提交于
      One comment in hibernate_preallocate_memory() is wrong, so fix it and
      add one more comment to clarify the meaning of the fixed one.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      266f1a25
    • R
      PM / Runtime: Use alloc_workqueue() for creating the PM workqueue · bcb5ba8b
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NTejun Heo <tj@kernel.org>
      bcb5ba8b
    • R
      PM: Fix unmet dependency warning from kconfig · ede890c2
      Rafael J. Wysocki 提交于
      Fix the following build warning:
      
      warning: (PM_SLEEP_SMP && SMP && (ARCH_SUSPEND_POSSIBLE || \
      ARCH_HIBERNATION_POSSIBLE) && PM_SLEEP) selects HOTPLUG_CPU which \
      has unmet direct dependencies (SMP && HOTPLUG)
      
      by selecting HOTPLUG along with CPU_HOTPLUG.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NRandy Dunlap <randy.dunlap@oracle.com>
      ede890c2
    • B
      PM / Hibernate: Compress hibernation image with LZO · f996fc96
      Bojan Smojver 提交于
      Compress hibernation image with LZO in order to save on I/O and
      therefore time to hibernate/thaw.
      
      [rjw: Added hibernate=nocompress command line option instead of just
       nocompress which would be confusing, fixed a couple of compiler
       warnings, fixed kerneldoc comments, minor cleanups.]
      Signed-off-by: NBojan Smojver <bojan@rexursive.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      f996fc96
    • O
      PM / Runtime: Lenient generic runtime pm callbacks · 05aa55dd
      Ohad Ben-Cohen 提交于
      Allow drivers, that belong to subsystems which use the generic
      runtime pm callbacks, not to define runtime pm suspend/resume handlers,
      by implicitly assuming success in such cases.
      
      This is needed to eliminate nop handlers that would otherwise be
      necessary by drivers which enable runtime pm, but don't need
      to do anything when their devices are runtime-suspended/resumed.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Acked-by: NKevin Hilman <khilman@deeprootsystems.com>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      05aa55dd
  2. 16 10月, 2010 12 次提交
  3. 15 10月, 2010 6 次提交
    • T
      ubd: fix incorrect sector handling during request restart · 47526903
      Tejun Heo 提交于
      Commit f81f2f7c (ubd: drop unnecessary rq->sector manipulation)
      dropped request->sector manipulation in preparation for global request
      handling cleanup; unfortunately, it incorrectly assumed that the
      updated sector wasn't being used.
      
      ubd tries to issue as many requests as possible to io_thread.  When
      issuing fails due to memory pressure or other reasons, the device is
      put on the restart list and issuing stops.  On IO completion, devices
      on the restart list are scanned and IO issuing is restarted.
      
      ubd issues IOs sg-by-sg and issuing can be stopped in the middle of a
      request, so each device on the restart queue needs to remember where
      to restart in its current request.  ubd needs to keep track of the
      issue position itself because,
      
      * blk_rq_pos(req) is now updated by the block layer to keep track of
        _completion_ position.
      
      * Multiple io_req's for the current request may be in flight, so it's
        difficult to tell where blk_rq_pos(req) currently is.
      
      Add ubd->rq_pos to keep track of the issue position and use it to
      correctly restart io_req issue.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NRichard Weinberger <richard@nod.at>
      Tested-by: NRichard Weinberger <richard@nod.at>
      Tested-by: NChris Frey <cdfrey@foursquare.net>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      47526903
    • L
      Export dump_{write,seek} to binary loader modules · 8fd01d6c
      Linus Torvalds 提交于
      If you build aout support as a module, you'll want these exported.
      Reported-by: NTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8fd01d6c
    • L
      Linux 2.6.36-rc8 · cd07202c
      Linus Torvalds 提交于
      cd07202c
    • L
      Un-inline the core-dump helper functions · 3aa0ce82
      Linus Torvalds 提交于
      Tony Luck reports that the addition of the access_ok() check in commit
      0eead9ab ("Don't dump task struct in a.out core-dumps") broke the
      ia64 compile due to missing the necessary header file includes.
      
      Rather than add yet another include (<asm/unistd.h>) to make everything
      happy, just uninline the silly core dump helper functions and move the
      bodies to fs/exec.c where they make a lot more sense.
      
      dump_seek() in particular was too big to be an inline function anyway,
      and none of them are in any way performance-critical.  And we really
      don't need to mess up our include file headers more than they already
      are.
      Reported-and-tested-by: NTony Luck <tony.luck@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3aa0ce82
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · ae42d8d4
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
        ehea: Fix a checksum issue on the receive path
        net: allow FEC driver to use fixed PHY support
        tg3: restore rx_dropped accounting
        b44: fix carrier detection on bind
        net: clear heap allocations for privileged ethtool actions
        NET: wimax, fix use after free
        ATM: iphase, remove sleep-inside-atomic
        ATM: mpc, fix use after free
        ATM: solos-pci, remove use after free
        net/fec: carrier off initially to avoid root mount failure
        r8169: use device model DMA API
        r8169: allocate with GFP_KERNEL flag when able to sleep
      ae42d8d4
    • L
      Don't dump task struct in a.out core-dumps · 0eead9ab
      Linus Torvalds 提交于
      akiphie points out that a.out core-dumps have that odd task struct
      dumping that was never used and was never really a good idea (it goes
      back into the mists of history, probably the original core-dumping
      code).  Just remove it.
      
      Also do the access_ok() check on dump_write().  It probably doesn't
      matter (since normal filesystems all seem to do it anyway), but he
      points out that it's normally done by the VFS layer, so ...
      
      [ I suspect that we should possibly do "vfs_write()" instead of
        calling ->write directly.  That also does the whole fsnotify and write
        statistics thing, which may or may not be a good idea. ]
      
      And just to be anal, do this all for the x86-64 32-bit a.out emulation
      code too, even though it's not enabled (and won't currently even
      compile)
      Reported-by: Nakiphie <akiphie@lavabit.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0eead9ab
  4. 14 10月, 2010 4 次提交