1. 10 5月, 2012 1 次提交
    • J
      compat: Fix RT signal mask corruption via sigprocmask · b7dafa0e
      Jan Kiszka 提交于
      compat_sys_sigprocmask reads a smaller signal mask from userspace than
      sigprogmask accepts for setting.  So the high word of blocked.sig[0]
      will be cleared, releasing any potentially blocked RT signal.
      
      This was discovered via userspace code that relies on get/setcontext.
      glibc's i386 versions of those functions use sigprogmask instead of
      rt_sigprogmask to save/restore signal mask and caused RT signal
      unblocking this way.
      
      As suggested by Linus, this replaces the sys_sigprocmask based compat
      version with one that open-codes the required logic, including the merge
      of the existing blocked set with the new one provided on SIG_SETMASK.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b7dafa0e
  2. 26 4月, 2012 3 次提交
  3. 25 4月, 2012 1 次提交
    • B
      PM / Hibernate: fix the number of pages used for hibernate/thaw buffering · f8262d47
      Bojan Smojver 提交于
      Hibernation regression fix, since 3.2.
      
      Calculate the number of required free pages based on non-high memory
      pages only, because that is where the buffers will come from.
      
      Commit 081a9d04 introduced a new buffer
      page allocation logic during hibernation, in order to improve the
      performance. The amount of pages allocated was calculated based on total
      amount of pages available, although only non-high memory pages are
      usable for this purpose. This caused hibernation code to attempt to over
      allocate pages on platforms that have high memory, which led to hangs.
      Signed-off-by: NBojan Smojver <bojan@rexursive.com>
      Signed-off-by: NRafael J. Wysocki <rjw@suse.de>
      f8262d47
  4. 24 4月, 2012 1 次提交
    • P
      irq: hide debug macros so they don't collide with others. · 9f3045ec
      Paul Gortmaker 提交于
      The file kernel/irq/debug.h temporarily defines P, PS, PD
      and then undefines them.  However these names aren't really
      "internal" enough, and collide with other more legit users
      such as the ones in the xtensa arch, causing:
      
      In file included from kernel/irq/internals.h:58:0,
                       from kernel/irq/irqdesc.c:18:
      kernel/irq/debug.h:8:0: warning: "PS" redefined [enabled by default]
      arch/xtensa/include/asm/regs.h:59:0: note: this is the location of the previous definition
      
      Add a handful of underscores to do a better job of hiding these
      temporary macros.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      9f3045ec
  5. 20 4月, 2012 3 次提交
    • S
      tracing: Fix stacktrace of latency tracers (irqsoff and friends) · db4c75cb
      Steven Rostedt 提交于
      While debugging a latency with someone on IRC (mirage335) on #linux-rt (OFTC),
      we discovered that the stacktrace output of the latency tracers
      (preemptirqsoff) was empty.
      
      This bug was caused by the creation of the dynamic length stack trace
      again (like commit 12b5da34 "tracing: Fix ent_size in trace output" was).
      
      This bug is caused by the latency tracers requiring the next event
      to determine the time between the current event and the next. But by
      grabbing the next event, the iter->ent_size is set to the next event
      instead of the current one. As the stacktrace event is the last event,
      this makes the ent_size zero and causes nothing to be printed for
      the stack trace. The dynamic stacktrace uses the ent_size to determine
      how much of the stack can be printed. The ent_size of zero means
      no stack.
      
      The simple fix is to save the iter->ent_size before finding the next event.
      
      Note, mirage335 asked to remain anonymous from LKML and git, so I will
      not add the Reported-by and Tested-by tags, even though he did report
      the issue and tested the fix.
      
      Cc: stable@vger.kernel.org # 3.1+
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      db4c75cb
    • S
      tick: Fix the spurious broadcast timer ticks after resume · a6371f80
      Suresh Siddha 提交于
      During resume, tick_resume_broadcast() programs the broadcast timer in
      oneshot mode unconditionally. On the platforms where broadcast timer
      is not really required, this will generate spurious broadcast timer
      ticks upon resume. For example, on the always running apic timer
      platforms with HPET, I see spurious hpet tick once every ~5minutes
      (which is the 32-bit hpet counter wraparound time).
      
      Similar to boot time, during resume make the oneshot mode setting of
      the broadcast clock event device conditional on the state of active
      broadcast users.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: svenjoac@gmx.de
      Cc: torvalds@linux-foundation.org
      Cc: rjw@sisk.pl
      Link: http://lkml.kernel.org/r/1334802459.28674.209.camel@sbsiddha-desk.sc.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      a6371f80
    • T
      tick: Ensure that the broadcast device is initialized · b9a6a235
      Thomas Gleixner 提交于
      Santosh found another trap when we avoid to initialize the broadcast
      device in the switch_to_oneshot code. The broadcast device might be
      still in SHUTDOWN state when we actually need to use it. That
      obviously breaks, as set_next_event() is called on a shutdown
      device. This did not break on x86, but Suresh analyzed it:
      
      From the review, most likely on Sven's system we are force enabling
      the hpet using the pci quirk's method very late. And in this case,
      hpet_clockevent (which will be global_clock_event) handler can be
      null, specifically as this platform might not be using deeper c-states
      and using the reliable APIC timer.
      
      Prior to commit 'fa4da365', that handler will be set to
      'tick_handle_oneshot_broadcast' when we switch the broadcast timer to
      oneshot mode, even though we don't use it. Post commit
      'fa4da365', we stopped switching the broadcast mode to oneshot
      as this is not really needed and his platform's global_clock_event's
      handler will remain null. While on my SNB laptop, same is set to
      'clockevents_handle_noop' because hpet gets enabled very early. (noop
      handler on my platform set when the early enabled hpet timer gets
      replaced by the lapic timer).
      
      But the commit 'fa4da365' tracked the broadcast timer mode in
      the SW as oneshot, even though it didn't touch the HW timer. During
      resume however, tick_resume_broadcast() saw the SW broadcast mode as
      oneshot and actually programmed the broadcast device also into oneshot
      mode. So this triggered the null pointer de-reference after the hpet
      wraps around and depending on what the hpet counter is set to. On the
      normal platforms where hpet gets enabled early we should be seeing a
      spurious interrupt (in my SNB laptop I see one spurious interrupt
      after around 5 minutes ;) which is 32-bit hpet counter wraparound
      time), but that's a separate issue.
      
      Enforce the mode setting when trying to set an event.
      Reported-and-tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: torvalds@linux-foundation.org
      Cc: svenjoac@gmx.de
      Cc: rjw@sisk.pl
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1204181723350.2542@ionos
      b9a6a235
  6. 18 4月, 2012 1 次提交
    • T
      tick: Fix oneshot broadcast setup really · b435092f
      Thomas Gleixner 提交于
      Sven Joachim reported, that suspend/resume on rc3 trips over a NULL
      pointer dereference. Linus spotted the clockevent handler being NULL.
      
      commit fa4da365(clockevents: tTack broadcast device mode change in
      tick_broadcast_switch_to_oneshot()) tried to fix a problem with the
      broadcast device setup, which was introduced in commit 77b0d60c(
      clockevents: Leave the broadcast device in shutdown mode when not
      needed).
      
      The initial commit avoided to set up the broadcast device when no
      broadcast request bits were set, but that left the broadcast device
      disfunctional. In consequence deep idle states which need the
      broadcast device were not woken up.
      
      commit fa4da365 tried to fix that by initializing the state of the
      broadcast facility, but that missed the fact, that nothing initializes
      the event handler and some other state of the underlying clock event
      device.
      
      The fix is to revert both commits and make only the mode setting of
      the clock event device conditional on the state of active broadcast
      users. 
      
      That initializes everything except the low level device mode, but this
      happens when the broadcast functionality is invoked by deep idle.
      Reported-and-tested-by: NSven Joachim <svenjoac@gmx.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1204181205540.2542@ionos
      b435092f
  7. 17 4月, 2012 2 次提交
    • P
      rcu: Permit call_rcu() from CPU_DYING notifiers · 92c38702
      Paul E. McKenney 提交于
      As of:
      
        29494be7 ("rcu,cleanup: simplify the code when cpu is dying")
      
      RCU adopts callbacks from the dying CPU in its CPU_DYING notifier,
      which means that any callbacks posted by later CPU_DYING notifiers
      are ignored until the CPU comes back online.
      
      A WARN_ON_ONCE() was added to __call_rcu() by:
      
        e5601400 ("rcu: Simplify offline processing")
      
      to check for this condition.  Although this condition did not trigger
      (at least as far as I know) during -next testing, it did recently
      trigger in mainline:
      
        https://lkml.org/lkml/2012/4/2/34
      
      What is needed longer term is for RCU's CPU_DEAD notifier to adopt any
      callbacks that were posted by CPU_DYING notifiers, however, the Linux
      kernel has been running with this sort of thing happening for quite
      some time.  So the only thing that qualifies as a regression is the
      WARN_ON_ONCE(), which this commit removes.
      
      Making RCU's CPU_DEAD notifier adopt callbacks posted by CPU_DYING
      notifiers is a topic for the 3.5 release of the Linux kernel.
      Reported-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: NPaul E. McKenney <paul.mckenney@linaro.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      92c38702
    • S
      tracing: Fix regression with tracing_on · 348f0fc2
      Steven Rostedt 提交于
      The change to make tracing_on affect only the ftrace ring buffer, caused
      a bug where it wont affect any ring buffer. The problem was that the buffer
      of the trace_array was passed to the write function and not the trace array
      itself.
      
      The trace_array can change the buffer when running a latency tracer. If this
      happens, then the buffer being disabled may not be the buffer currently used
      by ftrace. This will cause the tracing_on file to become useless.
      
      The simple fix is to pass the trace_array to the write function instead of
      the buffer. Then the actual buffer may be changed.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      348f0fc2
  8. 14 4月, 2012 2 次提交
  9. 13 4月, 2012 2 次提交
    • G
      irq_domain: fix type mismatch in debugfs output format · 5269a9ab
      Grant Likely 提交于
      sizeof(void*) returns an unsigned long, but it was being used as a width parameter to a "%-*s" format string which requires an int.  On 64 bit platforms this causes a type mismatch:
      
          linux/kernel/irq/irqdomain.c:575: warning: field width should have type
          'int', but argument 6 has type 'long unsigned int'
      
      This change casts the size to an int so printf gets the right data type.
      Reported-by: NAndreas Schwab <schwab@linux-m68k.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: David Daney <david.daney@cavium.com>
      5269a9ab
    • J
      panic: fix stack dump print on direct call to panic() · 026ee1f6
      Jason Wessel 提交于
      Commit 6e6f0a1f ("panic: don't print redundant backtraces on oops")
      causes a regression where no stack trace will be printed at all for the
      case where kernel code calls panic() directly while not processing an
      oops, and of course there are 100's of instances of this type of call.
      
      The original commit executed the check (!oops_in_progress), but this will
      always be false because just before the dump_stack() there is a call to
      bust_spinlocks(1), which does the following:
      
        void __attribute__((weak)) bust_spinlocks(int yes)
        {
      	if (yes) {
      		++oops_in_progress;
      
      The proper way to resolve the problem that original commit tried to
      solve is to avoid printing a stack dump from panic() when the either of
      the following conditions is true:
      
        1) TAINT_DIE has been set (this is done by oops_end())
           This indicates and oops has already been printed.
        2) oops_in_progress > 1
           This guards against the rare case where panic() is invoked
           a second time, or in between oops_begin() and oops_end()
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: <stable@vger.kernel.org>	[3.3+]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      026ee1f6
  10. 12 4月, 2012 1 次提交
    • G
      irq_domain: Move irq_virq_count into NOMAP revmap · 6fa6c8e2
      Grant Likely 提交于
      This patch replaces the old global setting of irq_virq_count that is only
      used by the NOMAP mapping and instead uses a revmap_data property so that
      the maximum NOMAP allocation can be set per NOMAP irq_domain.
      
      There is exactly one user of irq_virq_count in-tree right now: PS3.
      Also, irq_virq_count is only useful for the NOMAP mapping.  So,
      instead of having a single global irq_virq_count values, this change
      drops it entirely and added a max_irq argument to irq_domain_add_nomap().
      That makes it a property of an individual nomap irq domain instead of
      a global system settting.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      6fa6c8e2
  11. 11 4月, 2012 4 次提交
  12. 10 4月, 2012 2 次提交
  13. 06 4月, 2012 2 次提交
    • N
      nohz: Fix stale jiffies update in tick_nohz_restart() · 6f103929
      Neal Cardwell 提交于
      Fix tick_nohz_restart() to not use a stale ktime_t "now" value when
      calling tick_do_update_jiffies64(now).
      
      If we reach this point in the loop it means that we crossed a tick
      boundary since we grabbed the "now" timestamp, so at this point "now"
      refers to a time in the old jiffy, so using the old value for "now" is
      incorrect, and is likely to give us a stale jiffies value.
      
      In particular, the first time through the loop the
      tick_do_update_jiffies64(now) call is always a no-op, since the
      caller, tick_nohz_restart_sched_tick(), will have already called
      tick_do_update_jiffies64(now) with that "now" value.
      
      Note that tick_nohz_stop_sched_tick() already uses the correct
      approach: when we notice we cross a jiffy boundary, grab a new
      timestamp with ktime_get(), and *then* update jiffies.
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Cc: Ben Segall <bsegall@google.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1332875377-23014-1-git-send-email-ncardwell@google.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      6f103929
    • S
      simple_open: automatically convert to simple_open() · 234e3405
      Stephen Boyd 提交于
      Many users of debugfs copy the implementation of default_open() when
      they want to support a custom read/write function op.  This leads to a
      proliferation of the default_open() implementation across the entire
      tree.
      
      Now that the common implementation has been consolidated into libfs we
      can replace all the users of this function with simple_open().
      
      This replacement was done with the following semantic patch:
      
      <smpl>
      @ open @
      identifier open_f != simple_open;
      identifier i, f;
      @@
      -int open_f(struct inode *i, struct file *f)
      -{
      (
      -if (i->i_private)
      -f->private_data = i->i_private;
      |
      -f->private_data = i->i_private;
      )
      -return 0;
      -}
      
      @ has_open depends on open @
      identifier fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...
      -.open = open_f,
      +.open = simple_open,
      ...
      };
      </smpl>
      
      [akpm@linux-foundation.org: checkpatch fixes]
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      234e3405
  14. 05 4月, 2012 1 次提交
  15. 02 4月, 2012 1 次提交
  16. 31 3月, 2012 3 次提交
  17. 30 3月, 2012 5 次提交
  18. 29 3月, 2012 5 次提交