1. 19 5月, 2011 22 次提交
  2. 18 5月, 2011 11 次提交
    • J
      irq: Export functions to allow modular irq drivers · edf76f83
      Jonathan Cameron 提交于
      Export handle_simple_irq, irq_modify_status, irq_alloc_descs,
      irq_free_descs and generic_handle_irq to allow their usage in
      modules. First user is IIO, which wants to be built modular, but needs
      to be able to create irq chips, allocate and configure interrupt
      descriptors and handle demultiplexing interrupts.
      
      [ tglx: Moved the uninlinig of generic_handle_irq to a separate patch ]
      Signed-off-by: NJonathan Cameron <jic23@cam.ac.uk>
      Link: http://lkml.kernel.org/r/%3C1305711544-505-1-git-send-email-jic23%40cam.ac.uk%3ESigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      edf76f83
    • T
      genirq: Uninline and sanity check generic_handle_irq() · fe12bc2c
      Thomas Gleixner 提交于
      generic_handle_irq() is missing a NULL pointer check for the result of
      irq_to_desc. This was a not a big problem, but we want to expose it to
      drivers, so we better have sanity checks in place. Add a return value
      as well, which indicates that the irq number was valid and the handler
      was invoked.
      
      Based on the pure code move from Jonathan Cameron.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Jonathan Cameron <jic23@cam.ac.uk>
      fe12bc2c
    • T
      genirq: Remove pointless ifdefs · fe051434
      Thomas Gleixner 提交于
      kernel/irq/ is only built when CONFIG_GENERIC_HARDIRQS=y. So making
      code inside of kernel/irq/ conditional on CONFIG_GENERIC_HARDIRQS is
      pointless.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      fe051434
    • R
      PM: Allow drivers to allocate memory from .prepare() callbacks safely · 91e7c75b
      Rafael J. Wysocki 提交于
      If device drivers allocate substantial amounts of memory (above 1 MB)
      in their hibernate .freeze() callbacks (or in their legacy suspend
      callbcks during hibernation), the subsequent creation of hibernate
      image may fail due to the lack of memory.  This is the case, because
      the drivers' .freeze() callbacks are executed after the hibernate
      memory preallocation has been carried out and the preallocated amount
      of memory may be too small to cover the new driver allocations.
      Unfortunately, the drivers' .prepare() callbacks also are executed
      after the hibernate memory preallocation has completed, so they are
      not suitable for allocating additional memory either.  Thus the only
      way a driver can safely allocate memory during hibernation is to use
      a hibernate/suspend notifier.  However, the notifiers are called
      before the freezing of user space and the drivers wanting to use them
      for allocating additional memory may not know how much memory needs
      to be allocated at that point.
      
      To let device drivers overcome this difficulty rework the hibernation
      sequence so that the memory preallocation is carried out after the
      drivers' .prepare() callbacks have been executed, so that the
      .prepare() callbacks can be used for allocating additional memory
      to be used by the drivers' .freeze() callbacks.  Update documentation
      to match the new behavior of the code.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      91e7c75b
    • R
      PM: Remove CONFIG_PM_VERBOSE · c650da23
      Rafael J. Wysocki 提交于
      Now that we have CONFIG_DYNAMIC_DEBUG there is no need for yet
      another flag causing dev_dbg() and pr_debug() statements in the
      core PM code to produce output.  Moreover, CONFIG_PM_VERBOSE
      causes so much output to be generated that it's not really useful
      and almost no one sets it.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=23182Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      c650da23
    • R
      Revert "PM / Hibernate: Reduce autotuned default image size" · 1c1be3a9
      Rafael J. Wysocki 提交于
      This reverts commit bea3864f
      (PM / Hibernate: Reduce autotuned default image size), because users
      are now able to resolve the issue this commit was supposed to address
      in a different way (i.e. by using the new /sys/power/reserved_size
      interface).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      1c1be3a9
    • R
      PM / Hibernate: Add sysfs knob to control size of memory for drivers · ddeb6487
      Rafael J. Wysocki 提交于
      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: NMartin Steigerwald <Martin@Lichtvoll.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      ddeb6487
    • K
      kmod: always provide usermodehelper_disable() · 13d53f87
      Kay Sievers 提交于
      We need to prevent kernel-forked processes during system poweroff.
      Such processes try to access the filesystem whose disks we are
      trying to shutdown at the same time. This causes delays and exceptions
      in the storage drivers.
      
      A follow-up patch will add these calls and need usermodehelper_disable()
      also on systems without suspend support.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      13d53f87
    • R
      PM: Print a warning if firmware is requested when tasks are frozen · a144c6a6
      Rafael J. Wysocki 提交于
      Some drivers erroneously use request_firmware() from their ->resume()
      (or ->thaw(), or ->restore()) callbacks, which is not going to work
      unless the firmware has been built in.  This causes system resume to
      stall until the firmware-loading timeout expires, which makes users
      think that the resume has failed and reboot their machines
      unnecessarily.  For this reason, make _request_firmware() print a
      warning and return immediately with error code if it has been called
      when tasks are frozen and it's impossible to start any new usermode
      helpers.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Reviewed-by: NValdis Kletnieks <valdis.kletnieks@vt.edu>
      a144c6a6
    • M
      Freezer: Use SMP barriers · ee940d8d
      Mike Frysinger 提交于
      The freezer processes are dealing with multiple threads running
      simultaneously, and on a UP system, the memory reads/writes do
      not need barriers to keep things in sync.  These are only needed
      on SMP systems, so use SMP barriers instead.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      ee940d8d
    • M
      PM / Suspend: Do not ignore error codes returned by suspend_enter() · 3c431936
      MyungJoo Ham 提交于
      The current implementation of suspend-to-RAM returns 0 if there is an
      error from suspend_enter(), because suspend_devices_and_enter() ignores
      the return value from suspend_enter().  This patch addresses this issue
      and properly keep the error return from suspend_enter() and let
      suspend_devices_and_enter relay the error return.
      Signed-off-by: NMyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      3c431936
  3. 17 5月, 2011 1 次提交
    • T
      tick: Clear broadcast active bit when switching to oneshot · 07f4beb0
      Thomas Gleixner 提交于
      The first cpu which switches from periodic to oneshot mode switches
      also the broadcast device into oneshot mode. The broadcast device
      serves as a backup for per cpu timers which stop in deeper
      C-states. To avoid starvation of the cpus which might be in idle and
      depend on broadcast mode it marks the other cpus as broadcast active
      and sets the brodcast expiry value of those cpus to the next tick.
      
      The oneshot mode broadcast bit for the other cpus is sticky and gets
      only cleared when those cpus exit idle. If a cpu was not idle while
      the bit got set in consequence the bit prevents that the broadcast
      device is armed on behalf of that cpu when it enters idle for the
      first time after it switched to oneshot mode.
      
      In most cases that goes unnoticed as one of the other cpus has usually
      a timer pending which keeps the broadcast device armed with a short
      timeout. Now if the only cpu which has a short timer active has the
      bit set then the broadcast device will not be armed on behalf of that
      cpu and will fire way after the expected timer expiry. In the case of
      Christians bug report it took ~145 seconds which is about half of the
      wrap around time of HPET (the limit for that device) due to the fact
      that all other cpus had no timers armed which expired before the 145
      seconds timeframe.
      
      The solution is simply to clear the broadcast active bit
      unconditionally when a cpu switches to oneshot mode after the first
      cpu switched the broadcast device over. It's not idle at that point
      otherwise it would not be executing that code.
      
      [ I fundamentally hate that broadcast crap. Why the heck thought some
        folks that when going into deep idle it's a brilliant concept to
        switch off the last device which brings the cpu back from that
        state? ]
      
      Thanks to Christian for providing all the valuable debug information!
      Reported-and-tested-by: NChristian Hoffmann <email@christianhoffmann.info>
      Cc: John Stultz <johnstul@us.ibm.com>
      Link: http://lkml.kernel.org/r/%3Calpine.LFD.2.02.1105161105170.3078%40ionos%3E
      Cc: stable@kernel.org
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      07f4beb0
  4. 16 5月, 2011 4 次提交
  5. 14 5月, 2011 1 次提交
    • S
      Cache user_ns in struct cred · 47a150ed
      Serge E. Hallyn 提交于
      If !CONFIG_USERNS, have current_user_ns() defined to (&init_user_ns).
      
      Get rid of _current_user_ns.  This requires nsown_capable() to be
      defined in capability.c rather than as static inline in capability.h,
      so do that.
      
      Request_key needs init_user_ns defined at current_user_ns if
      !CONFIG_USERNS, so forward-declare that in cred.h if !CONFIG_USERNS
      at current_user_ns() define.
      
      Compile-tested with and without CONFIG_USERNS.
      Signed-off-by: NSerge E. Hallyn <serge.hallyn@canonical.com>
      [ This makes a huge performance difference for acl_permission_check(),
        up to 30%.  And that is one of the hottest kernel functions for loads
        that are pathname-lookup heavy.  ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      47a150ed
  6. 12 5月, 2011 1 次提交