1. 06 10月, 2012 14 次提交
    • B
      lib/plist.c: make plist test announcements KERN_DEBUG · 17d7aac9
      Borislav Petkov 提交于
      They show up in dmesg
      
      [    4.041094] start plist test
      [    4.045804] end plist test
      
      without a lot of meaning so hide them behind debug loglevel.
      Signed-off-by: NBorislav Petkov <borislav.petkov@amd.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      17d7aac9
    • J
      lib/vsprintf.c: improve standard conformance of sscanf() · da99075c
      Jan Beulich 提交于
      Xen's pciback points out a couple of deficiencies with vsscanf()'s
      standard conformance:
      
      - Trailing character matching cannot be checked by the caller: With a
        format string of "(%x:%x.%x) %n" absence of the closing parenthesis
        cannot be checked, as input of "(00:00.0)" doesn't cause the %n to be
        evaluated (because of the code not skipping white space before the
        trailing %n).
      
      - The parameter corresponding to a trailing %n could get filled even if
        there was a matching error: With a format string of "(%x:%x.%x)%n",
        input of "(00:00.0]" would still fill the respective variable pointed to
        (and hence again make the mismatch non-detectable by the caller).
      
      This patch aims at fixing those, but leaves other non-conforming aspects
      of it untouched, among them these possibly relevant ones:
      
      - improper handling of the assignment suppression character '*' (blindly
        discarding all succeeding non-white space from the format and input
        strings),
      
      - not honoring conversion specifiers for %n, - not recognizing the C99
        conversion specifier 't' (recognized by vsprintf()).
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da99075c
    • V
      lib/spinlock_debug: avoid livelock in do_raw_spin_lock() · 214f766e
      Vikram Mulukutla 提交于
      The logic in do_raw_spin_lock() attempts to acquire a spinlock by invoking
      arch_spin_trylock() in a loop with a delay between each attempt.  Now
      consider the following situation in a 2 CPU system:
      
      1. CPU-0 continually acquires and releases a spinlock in a
         tight loop; it stays in this loop until some condition X
         is satisfied. X can only be satisfied by another CPU.
      
      2. CPU-1 tries to acquire the same spinlock, in an attempt
         to satisfy the aforementioned condition X. However, it
         never sees the unlocked value of the lock because the
         debug spinlock code uses trylock instead of just lock;
         it checks at all the wrong moments - whenever CPU-0 has
         locked the lock.
      
      Now in the absence of debug spinlocks, the architecture specific spinlock
      code can correctly allow CPU-1 to wait in a "queue" (e.g., ticket
      spinlocks), ensuring that it acquires the lock at some point.  However,
      with the debug spinlock code, livelock can easily occur due to the use of
      try_lock, which obviously cannot put the CPU in that "queue".  This
      queueing mechanism is implemented in both x86 and ARM spinlock code.
      
      Note that the situation mentioned above is not hypothetical.  A real
      problem was encountered where CPU-0 was running hrtimer_cancel with
      interrupts disabled, and CPU-1 was attempting to run the hrtimer that
      CPU-0 was trying to cancel.
      
      Address this by actually attempting arch_spin_lock once it is suspected
      that there is a spinlock lockup.  If we're in a situation that is
      described above, the arch_spin_lock should succeed; otherwise other
      timeout mechanisms (e.g., watchdog) should alert the system of a lockup.
      Therefore, if there is a genuine system problem and the spinlock can't be
      acquired, the end result (irrespective of this change being present) is
      the same.  If there is a livelock caused by the debug code, this change
      will allow the lock to be acquired, depending on the implementation of the
      lower level arch specific spinlock code.
      
      [akpm@linux-foundation.org: tweak comment]
      Signed-off-by: NVikram Mulukutla <markivx@codeaurora.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      214f766e
    • B
      genalloc: make it possible to use a custom allocation algorithm · ca279cf1
      Benjamin Gaignard 提交于
      Premit use of another algorithm than the default first-fit one.  For
      example a custom algorithm could be used to manage alignment requirements.
      
      As I can't predict all the possible requirements/needs for all allocation
      uses cases, I add a "free" field 'void *data' to pass any needed
      information to the allocation function.  For example 'data' could be used
      to handle a structure where you store the alignment, the expected memory
      bank, the requester device, or any information that could influence the
      allocation algorithm.
      
      An usage example may look like this:
      struct my_pool_constraints {
      	int align;
      	int bank;
      	...
      };
      
      unsigned long my_custom_algo(unsigned long *map, unsigned long size,
      		unsigned long start, unsigned int nr, void *data)
      {
      	struct my_pool_constraints *constraints = data;
      	...
      	deal with allocation contraints
      	...
      	return the index in bitmap where perform the allocation
      }
      
      void create_my_pool()
      {
      	struct my_pool_constraints c;
      	struct gen_pool *pool = gen_pool_create(...);
      	gen_pool_add(pool, ...);
      	gen_pool_set_algo(pool, my_custom_algo, &c);
      }
      
      Add of best-fit algorithm function:
      most of the time best-fit is slower then first-fit but memory fragmentation
      is lower. The random buffer allocation/free tests don't show any arithmetic
      relation between the allocation time and fragmentation but the
      best-fit algorithm
      is sometime able to perform the allocation when the first-fit can't.
      
      This new algorithm help to remove static allocations on ESRAM, a small but
      fast on-chip RAM of few KB, used for high-performance uses cases like DMA
      linked lists, graphic accelerators, encoders/decoders. On the Ux500
      (in the ARM tree) we have define 5 ESRAM banks of 128 KB each and use of
      static allocations becomes unmaintainable:
      cd arch/arm/mach-ux500 && grep -r ESRAM .
      ./include/mach/db8500-regs.h:/* Base address and bank offsets for ESRAM */
      ./include/mach/db8500-regs.h:#define U8500_ESRAM_BASE   0x40000000
      ./include/mach/db8500-regs.h:#define U8500_ESRAM_BANK_SIZE      0x00020000
      ./include/mach/db8500-regs.h:#define U8500_ESRAM_BANK0  U8500_ESRAM_BASE
      ./include/mach/db8500-regs.h:#define U8500_ESRAM_BANK1       (U8500_ESRAM_BASE + U8500_ESRAM_BANK_SIZE)
      ./include/mach/db8500-regs.h:#define U8500_ESRAM_BANK2       (U8500_ESRAM_BANK1 + U8500_ESRAM_BANK_SIZE)
      ./include/mach/db8500-regs.h:#define U8500_ESRAM_BANK3       (U8500_ESRAM_BANK2 + U8500_ESRAM_BANK_SIZE)
      ./include/mach/db8500-regs.h:#define U8500_ESRAM_BANK4       (U8500_ESRAM_BANK3 + U8500_ESRAM_BANK_SIZE)
      ./include/mach/db8500-regs.h:#define U8500_ESRAM_DMA_LCPA_OFFSET     0x10000
      ./include/mach/db8500-regs.h:#define U8500_DMA_LCPA_BASE
      (U8500_ESRAM_BANK0 + U8500_ESRAM_DMA_LCPA_OFFSET)
      ./include/mach/db8500-regs.h:#define U8500_DMA_LCLA_BASE U8500_ESRAM_BANK4
      
      I want to use genalloc to do dynamic allocations but I need to be able to
      fine tune the allocation algorithm. I my case best-fit algorithm give
      better results than first-fit, but it will not be true for every use case.
      Signed-off-by: NBenjamin Gaignard <benjamin.gaignard@stericsson.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ca279cf1
    • D
      lib/gcd.c: prevent possible div by 0 · e9687567
      Davidlohr Bueso 提交于
      Account for all properties when a and/or b are 0:
      gcd(0, 0) = 0
      gcd(a, 0) = a
      gcd(0, b) = b
      
      Fixes no known problems in current kernels.
      Signed-off-by: NDavidlohr Bueso <dave@gnu.org>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e9687567
    • J
      lib/Kconfig.debug: adjust hard-lockup related Kconfig options · 8f1f66ed
      Jan Beulich 提交于
      The main option should not appear in the resulting .config when the
      dependencies aren't met (i.e.  use "depends on" rather than directly
      setting the default from the combined dependency values).
      
      The sub-options should depend on the main option rather than a more
      generic higher level one.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Acked-by: NDon Zickus <dzickus@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8f1f66ed
    • A
      lib/parser.c: avoid overflow in match_number() · 77dd3b0b
      Alex Elder 提交于
      The result of converting an integer value to another signed integer type
      that's unable to represent the original value is implementation defined.
      (See notes in section 6.3.1.3 of the C standard.)
      
      In match_number(), the result of simple_strtol() (which returns type long)
      is assigned to a value of type int.
      
      Instead, handle the result of simple_strtol() in a well-defined way, and
      return -ERANGE if the result won't fit in the int variable used to hold
      the parsed result.
      
      No current callers pay attention to the particular error value returned,
      so this additional return code shouldn't do any harm.
      
      [akpm@linux-foundation.org: coding-style tweaks]
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Cc: Randy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      77dd3b0b
    • F
      idr: rename MAX_LEVEL to MAX_IDR_LEVEL · 125c4c70
      Fengguang Wu 提交于
      To avoid name conflicts:
      
        drivers/video/riva/fbdev.c:281:9: sparse: preprocessor token MAX_LEVEL redefined
      
      While at it, also make the other names more consistent and add
      parentheses.
      
      [akpm@linux-foundation.org: repair fallout]
      [sfr@canb.auug.org.au: IB/mlx4: fix for MAX_ID_MASK to MAX_IDR_MASK name change]
      Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
      Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
      Cc: walter harms <wharms@bfs.de>
      Cc: Glauber Costa <glommer@parallels.com>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      125c4c70
    • A
    • G
      lib: vsprintf: fix broken comments · f4000516
      George Spelvin 提交于
      Numbering the 8 potential digits 2 though 9 never did make a lot of sense.
      Signed-off-by: NGeorge Spelvin <linux@horizon.com>
      Cc: Denys Vlasenko <vda.linux@googlemail.com>
      Cc: Michal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f4000516
    • G
      lib: vsprintf: optimize put_dec_trunc8() · cb239d0a
      George Spelvin 提交于
      If you're going to have a conditional branch after each 32x32->64-bit
      multiply, might as well shrink the code and make it a loop.
      
      This also avoids using the long multiply for small integers.
      
      (This leaves the comments in a confusing state, but that's a separate
      patch to make review easier.)
      Signed-off-by: NGeorge Spelvin <linux@horizon.com>
      Cc: Denys Vlasenko <vda.linux@googlemail.com>
      Cc: Michal Nazarewicz <mina86@mina86.com>
      Cc: Rabin Vincent <rabin@rab.in>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cb239d0a
    • G
      lib: vsprintf: optimize division by 10000 · 2359172a
      George Spelvin 提交于
      The same multiply-by-inverse technique can be used to convert division by
      10000 to a 32x32->64-bit multiply.
      Signed-off-by: NGeorge Spelvin <linux@horizon.com>
      Cc: Denys Vlasenko <vda.linux@googlemail.com>
      Cc: Michal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2359172a
    • G
      lib: vsprintf: optimize division by 10 for small integers · e49317d4
      George Spelvin 提交于
      Shrink the reciprocal approximations used in put_dec_full4() based on the
      comments in put_dec_full9().
      Signed-off-by: NGeorge Spelvin <linux@horizon.com>
      Cc: Denys Vlasenko <vda.linux@googlemail.com>
      Cc: Michal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e49317d4
    • J
      sections: fix const sections for crc32 table · 8f243af4
      Joe Mario 提交于
      Fix the const sections for the code generated by crc32 table.  There's
      no ro version of the cacheline aligned section, so we cannot put in
      const data without a conflict Just don't make the crc tables const for
      now.
      
      [ak@linux.intel.com: some fixes and new description]
      [akpm@linux-foundation.org: checkpatch fixes]
      Signed-off-by: NJoe Mario <jmario@redhat.com>
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8f243af4
  2. 25 9月, 2012 1 次提交
  3. 23 9月, 2012 1 次提交
  4. 17 9月, 2012 5 次提交
  5. 13 9月, 2012 1 次提交
  6. 11 9月, 2012 1 次提交
  7. 09 9月, 2012 2 次提交
  8. 31 8月, 2012 1 次提交
  9. 22 8月, 2012 1 次提交
  10. 31 7月, 2012 13 次提交
    • A
      switch the protection of percpu_counter list to spinlock · d87aae2f
      Al Viro 提交于
      ... making percpu_counter_destroy() non-blocking
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d87aae2f
    • M
      lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table() · e04f2283
      Mandeep Singh Baines 提交于
      We are seeing a lot of sg_alloc_table allocation failures using the new
      drm prime infrastructure.  We isolated the cause to code in
      __sg_alloc_table that was re-writing the gfp_flags.
      
      There is a comment in the code that suggest that there is an assumption
      about the allocation coming from a memory pool.  This was likely true
      when sg lists were primarily used for disk I/O.
      Signed-off-by: NMandeep Singh Baines <msb@chromium.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Cong Wang <amwang@redhat.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Rob Clark <rob.clark@linaro.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Sonny Rao <sonnyrao@chromium.org>
      Cc: Olof Johansson <olofj@chromium.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e04f2283
    • A
      powerpc: pSeries reconfig notifier error injection module · 08dfb4dd
      Akinobu Mita 提交于
      This provides the ability to inject artifical errors to pSeries reconfig
      notifier chain callbacks.  It is controlled through debugfs interface
      under /sys/kernel/debug/notifier-error-inject/pSeries-reconfig
      
      If the notifier call chain should be failed with some events
      notified, write the error code to "actions/<notifier event>/error".
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Greg KH <greg@kroah.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      08dfb4dd
    • A
      memory: memory notifier error injection module · 9579f5bd
      Akinobu Mita 提交于
      This provides the ability to inject artifical errors to memory hotplug
      notifier chain callbacks.  It is controlled through debugfs interface
      under /sys/kernel/debug/notifier-error-inject/memory
      
      If the notifier call chain should be failed with some events notified,
      write the error code to "actions/<notifier event>/error".
      
      Example: Inject memory hotplug offline error (-12 == -ENOMEM)
      
      	# cd /sys/kernel/debug/notifier-error-inject/memory
      	# echo -12 > actions/MEM_GOING_OFFLINE/error
      	# echo offline > /sys/devices/system/memory/memoryXXX/state
      	bash: echo: write error: Cannot allocate memory
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Greg KH <greg@kroah.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9579f5bd
    • A
      PM: PM notifier error injection module · 048b9c35
      Akinobu Mita 提交于
      This provides the ability to inject artifical errors to PM notifier chain
      callbacks.  It is controlled through debugfs interface under
      /sys/kernel/debug/notifier-error-inject/pm
      
      Each of the files in "error" directory represents an event which can be
      failed and contains the error code.  If the notifier call chain should be
      failed with some events notified, write the error code to the files.
      
      If the notifier call chain should be failed with some events notified,
      write the error code to "actions/<notifier event>/error".
      
      Example: Inject PM suspend error (-12 = -ENOMEM)
      
      	# cd /sys/kernel/debug/notifier-error-inject/pm
      	# echo -12 > actions/PM_SUSPEND_PREPARE/error
      	# echo mem > /sys/power/state
      	bash: echo: write error: Cannot allocate memory
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Acked-by: N"Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Greg KH <greg@kroah.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      048b9c35
    • A
      cpu: rewrite cpu-notifier-error-inject module · f5a9f52e
      Akinobu Mita 提交于
      Rewrite existing cpu-notifier-error-inject module to use debugfs based new
      framework.
      
      This change removes cpu_up_prepare_error and cpu_down_prepare_error module
      parameters which were used to specify error code to be injected.  We could
      keep these module parameters for backward compatibility by module_param_cb
      but it seems overkill for this module.
      
      This provides the ability to inject artifical errors to CPU notifier chain
      callbacks.  It is controlled through debugfs interface under
      /sys/kernel/debug/notifier-error-inject/cpu
      
      If the notifier call chain should be failed with some events notified,
      write the error code to "actions/<notifier event>/error".
      
      Example1: inject CPU offline error (-1 == -EPERM)
      
      	# cd /sys/kernel/debug/notifier-error-inject/cpu
      	# echo -1 > actions/CPU_DOWN_PREPARE/error
      	# echo 0 > /sys/devices/system/cpu/cpu1/online
      	bash: echo: write error: Operation not permitted
      
      Example2: inject CPU online error (-2 == -ENOENT)
      
      	# cd /sys/kernel/debug/notifier-error-inject/cpu
      	# echo -2 > actions/CPU_UP_PREPARE/error
      	# echo 1 > /sys/devices/system/cpu/cpu1/online
      	bash: echo: write error: No such file or directory
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Greg KH <greg@kroah.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f5a9f52e
    • A
      fault-injection: notifier error injection · 8d438288
      Akinobu Mita 提交于
      This patchset provides kernel modules that can be used to test the error
      handling of notifier call chain failures by injecting artifical errors to
      the following notifier chain callbacks.
      
       * CPU notifier
       * PM notifier
       * memory hotplug notifier
       * powerpc pSeries reconfig notifier
      
      Example: Inject CPU offline error (-1 == -EPERM)
      
        # cd /sys/kernel/debug/notifier-error-inject/cpu
        # echo -1 > actions/CPU_DOWN_PREPARE/error
        # echo 0 > /sys/devices/system/cpu/cpu1/online
        bash: echo: write error: Operation not permitted
      
      The patchset also adds cpu and memory hotplug tests to
      tools/testing/selftests These tests first do simple online and offline
      test and then do fault injection tests if notifier error injection
      module is available.
      
      This patch:
      
      The notifier error injection provides the ability to inject artifical
      errors to specified notifier chain callbacks.  It is useful to test the
      error handling of notifier call chain failures.
      
      This adds common basic functions to define which type of events can be
      fail and to initialize the debugfs interface to control what error code
      should be returned and which event should be failed.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Greg KH <greg@kroah.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d438288
    • T
      lib/crc32.c: fix unused variables warnings · 49ac572b
      Thiago Rafael Becker 提交于
      Variables t4, t5, t6 and t7 are only used when CRC_LE_BITS != 32.  Fix
      the following compilation warnings:
      
        lib/crc32.c: In function 'crc32_body':
        lib/crc32.c:77:55: warning: unused variable 't7'
        lib/crc32.c:77:41: warning: unused variable 't6'
        lib/crc32.c:77:27: warning: unused variable 't5'
        lib/crc32.c:77:13: warning: unused variable 't4'
      Signed-off-by: NThiago Rafael Becker <trbecker@trbecker.org>
      Cc: "Darrick J. Wong" <djwong@us.ibm.com>
      Cc: Bob Pearson <rpearson@systemfabricworks.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49ac572b
    • S
      spinlock_debug: print offset in addition to symbol name · 4b068148
      Stephen Boyd 提交于
      If there are two spinlocks embedded in a structure that kallsyms knows
      about and one of the spinlocks locks up we will print the name of the
      containing structure instead of the address of the lock.  This is quite
      bad, so let's use %pS instead of %ps so we get an offset in addition to
      the symbol so we can determine which particular lock is having problems.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4b068148
    • C
      atomic64_test: simplify the #ifdef for atomic64_dec_if_positive() test · 7463449b
      Catalin Marinas 提交于
      Introduce CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE and use this instead
      of the multitude of #if defined() checks in atomic64_test.c
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7463449b
    • A
      string: introduce memweight() · 639b9e34
      Akinobu Mita 提交于
      memweight() is the function that counts the total number of bits set in
      memory area.  Unlike bitmap_weight(), memweight() takes pointer and size
      in bytes to specify a memory area which does not need to be aligned to
      long-word boundary.
      
      [akpm@linux-foundation.org: rename `w' to `ret']
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Anders Larsen <al@alarsen.net>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Tony Luck <tony.luck@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      639b9e34
    • A
      vsprintf: add support of '%*ph[CDN]' · 31550a16
      Andy Shevchenko 提交于
      There are many places in the kernel where the drivers print small buffers
      as a hex string.  This patch adds a support of the variable width buffer
      to print it as a hex string with a delimiter.  The idea came from Pavel
      Roskin here: http://www.digipedia.pl/usenet/thread/18835/17449/
      
      Sample output of
      	pr_info("buf[%d:%d] %*phC\n", from, len, len, &buf[from]);
      could be look like this:
      	[ 0.726130] buf[51:8] e8:16:b6:ef:e3:74:45:6e
      	[ 0.750736] buf[59:15] 31:81:b8:3f:35:49:06:ae:df:32:06:05:4a:af:55
      	[ 0.757602] buf[17:5] ac:16:d5:2c:ef
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31550a16
    • D
      lib/vsprintf.c: kptr_restrict: fix pK-error in SysRq show-all-timers(Q) · 3715c530
      Dan Rosenberg 提交于
      When using ALT+SysRq+Q all the pointers are replaced with "pK-error" like
      this:
      
      	[23153.208033]   .base:               pK-error
      
      with echo h > /proc/sysrq-trigger it works:
      
      	[23107.776363]   .base:       ffff88023e60d540
      
      The intent behind this behavior was to return "pK-error" in cases where
      the %pK format specifier was used in interrupt context, because the
      CAP_SYSLOG check wouldn't be meaningful.  Clearly this should only apply
      when kptr_restrict is actually enabled though.
      Reported-by: NStevie Trujillo <stevie.trujillo@gmail.com>
      Signed-off-by: NDan Rosenberg <dan.j.rosenberg@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3715c530