]> Git Repo - linux.git/log
linux.git
12 years agolib/plist.c: make plist test announcements KERN_DEBUG
Borislav Petkov [Fri, 5 Oct 2012 00:13:27 +0000 (17:13 -0700)]
lib/plist.c: make plist test announcements KERN_DEBUG

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: Borislav Petkov <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Acked-by: Steven Rostedt <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib/vsprintf.c: improve standard conformance of sscanf()
Jan Beulich [Fri, 5 Oct 2012 00:13:24 +0000 (17:13 -0700)]
lib/vsprintf.c: improve standard conformance of sscanf()

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: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib/spinlock_debug: avoid livelock in do_raw_spin_lock()
Vikram Mulukutla [Fri, 5 Oct 2012 00:13:22 +0000 (17:13 -0700)]
lib/spinlock_debug: avoid livelock in do_raw_spin_lock()

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.

[[email protected]: tweak comment]
Signed-off-by: Vikram Mulukutla <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agogenalloc: make it possible to use a custom allocation algorithm
Benjamin Gaignard [Fri, 5 Oct 2012 00:13:20 +0000 (17:13 -0700)]
genalloc: make it possible to use a custom allocation algorithm

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: Benjamin Gaignard <[email protected]>
Cc: Huang Ying <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib/gcd.c: prevent possible div by 0
Davidlohr Bueso [Fri, 5 Oct 2012 00:13:18 +0000 (17:13 -0700)]
lib/gcd.c: prevent possible div by 0

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: Davidlohr Bueso <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib/Kconfig.debug: adjust hard-lockup related Kconfig options
Jan Beulich [Fri, 5 Oct 2012 00:13:17 +0000 (17:13 -0700)]
lib/Kconfig.debug: adjust hard-lockup related Kconfig options

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: Jan Beulich <[email protected]>
Acked-by: Don Zickus <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib/parser.c: avoid overflow in match_number()
Alex Elder [Fri, 5 Oct 2012 00:13:16 +0000 (17:13 -0700)]
lib/parser.c: avoid overflow in match_number()

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.

[[email protected]: coding-style tweaks]
Signed-off-by: Alex Elder <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoidr: rename MAX_LEVEL to MAX_IDR_LEVEL
Fengguang Wu [Fri, 5 Oct 2012 00:13:15 +0000 (17:13 -0700)]
idr: rename MAX_LEVEL to MAX_IDR_LEVEL

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.

[[email protected]: repair fallout]
[[email protected]: IB/mlx4: fix for MAX_ID_MASK to MAX_IDR_MASK name change]
Signed-off-by: Fengguang Wu <[email protected]>
Cc: Bernd Petrovitsch <[email protected]>
Cc: walter harms <[email protected]>
Cc: Glauber Costa <[email protected]>
Signed-off-by: Stephen Rothwell <[email protected]>
Cc: Roland Dreier <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agokvm: replace test_and_set_bit_le() in mark_page_dirty_in_slot() with set_bit_le()
Takuya Yoshikawa [Fri, 5 Oct 2012 00:13:12 +0000 (17:13 -0700)]
kvm: replace test_and_set_bit_le() in mark_page_dirty_in_slot() with set_bit_le()

Now that we have defined generic set_bit_le() we do not need to use
test_and_set_bit_le() for atomically setting a bit.

Signed-off-by: Takuya Yoshikawa <[email protected]>
Cc: Avi Kivity <[email protected]>
Cc: Marcelo Tosatti <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agopowerpc: bitops: introduce {clear,set}_bit_le()
Takuya Yoshikawa [Fri, 5 Oct 2012 00:13:10 +0000 (17:13 -0700)]
powerpc: bitops: introduce {clear,set}_bit_le()

Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is
being used for this missing function.

Signed-off-by: Takuya Yoshikawa <[email protected]>
Acked-by: Benjamin Herrenschmidt <[email protected]>
Cc: Avi Kivity <[email protected]>
Cc: Marcelo Tosatti <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agobitops: introduce generic {clear,set}_bit_le()
Takuya Yoshikawa [Fri, 5 Oct 2012 00:13:07 +0000 (17:13 -0700)]
bitops: introduce generic {clear,set}_bit_le()

Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is
being used for this missing function.

Signed-off-by: Takuya Yoshikawa <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Cc: Marcelo Tosatti <[email protected]>
Cc: Avi Kivity <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/net/ethernet/dec/tulip: Use standard __set_bit_le() function
Takuya Yoshikawa [Fri, 5 Oct 2012 00:13:05 +0000 (17:13 -0700)]
drivers/net/ethernet/dec/tulip: Use standard __set_bit_le() function

To introduce generic set_bit_le() later, we remove our own definition
and use a proper non-atomic bitops function: __set_bit_le().

Signed-off-by: Takuya Yoshikawa <[email protected]>
Acked-by: Grant Grundler <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/net/ethernet/sfc: use standard __{clear,set}_bit_le() functions
Ben Hutchings [Fri, 5 Oct 2012 00:13:03 +0000 (17:13 -0700)]
drivers/net/ethernet/sfc: use standard __{clear,set}_bit_le() functions

There are now standard functions for dealing with little-endian bit
arrays, so use them instead of our own implementations.

Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Takuya Yoshikawa <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/video/backlight/platform_lcd.c: add support for device tree based probe
Jingoo Han [Fri, 5 Oct 2012 00:13:01 +0000 (17:13 -0700)]
drivers/video/backlight/platform_lcd.c: add support for device tree based probe

This patch adds the of_match_table to platform-lcd driver to be
probed when platform-lcd device node is found in the device tree.

[[email protected]: include of.h]
Signed-off-by: Jingoo Han <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/video/backlight/da9052_bl.c: drop devm_kfree of devm_kzalloc'd data
Julia Lawall [Fri, 5 Oct 2012 00:12:59 +0000 (17:12 -0700)]
drivers/video/backlight/da9052_bl.c: drop devm_kfree of devm_kzalloc'd data

devm_kfree should not have to be explicitly used.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,d;
@@

x = devm_kzalloc(...)
...
?-devm_kfree(d,x);
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Acked-by: Jingoo Han <[email protected]>
Signed-off-by: Florian Tobias Schandinat <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agobacklight: remove ProGear driver
Marcin Juszkiewicz [Fri, 5 Oct 2012 00:12:57 +0000 (17:12 -0700)]
backlight: remove ProGear driver

This driver was for the ProGear webpad device which was produced in
2000/2001 and is not available on a market.  I no longer have this
hardware so can not even check how Linux works on it.

Signed-off-by: Marcin Juszkiewicz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agobacklight: add new lm3639 backlight driver
G.Shark Jeong [Fri, 5 Oct 2012 00:12:55 +0000 (17:12 -0700)]
backlight: add new lm3639 backlight driver

This driver is a general version for LM3639 backlgiht + flash driver chip
of TI.

LM3639:
The LM3639 is a single chip LCD Display Backlight driver + white LED
Camera driver.  Programming is done over an I2C compatible interface.
www.ti.com

[[email protected]: code layout tweaks]
Signed-off-by: G.Shark Jeong <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Daniel Jeong <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agobacklight: add Backlight driver for lm3630 chip
G.Shark Jeong [Fri, 5 Oct 2012 00:12:52 +0000 (17:12 -0700)]
backlight: add Backlight driver for lm3630 chip

This driver is a general version for LM3630 backlgiht driver chip of TI.

LM3630 :
The LM3630 is a current mode boost converter which supplies the power
and controls the current in two strings of up to 10 LEDs per string.
Programming is done over an I2C compatible interface.
www.ti.com

[[email protected]: make bled_name[] static, a few coding style tuneups, create new set_intensity(), partly to avoid awkward layout gymnastics]
Signed-off-by: G.Shark Jeong <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Daniel Jeong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agobacklight: lp855x: add FAST bit description for LP8556
Kim, Milo [Fri, 5 Oct 2012 00:12:50 +0000 (17:12 -0700)]
backlight: lp855x: add FAST bit description for LP8556

LP8556 backlight driver supports fast refresh mode when exiting the low
power mode.  This bit can be configurable in the platform side.

Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Bryan Wu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/video/backlight/kb3886_bl.c: use usleep_range() instead of msleep() for small...
Jingoo Han [Fri, 5 Oct 2012 00:12:47 +0000 (17:12 -0700)]
drivers/video/backlight/kb3886_bl.c: use usleep_range() instead of msleep() for small sleeps

Since msleep() might not sleep for the desired amount when less than 20ms,
use usleep_range().

Signed-off-by: Jingoo Han <[email protected]>
Cc: Claudio Nieder <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Sachin Kamat <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/video/backlight/ltv350qv.c: use usleep_range() instead of msleep() for small...
Jingoo Han [Fri, 5 Oct 2012 00:12:44 +0000 (17:12 -0700)]
drivers/video/backlight/ltv350qv.c: use usleep_range() instead of msleep() for small sleeps

Since msleep() might not sleep for the desired amount when less than 20ms,
use usleep_range().

Signed-off-by: Jingoo Han <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Sachin Kamat <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/video/backlight/da9052_bl.c: use usleep_range() instead of msleep() for small...
Jingoo Han [Fri, 5 Oct 2012 00:12:42 +0000 (17:12 -0700)]
drivers/video/backlight/da9052_bl.c: use usleep_range() instead of msleep() for small sleeps

Since msleep() might not sleep for the desired amount when less than 20ms,
use usleep_range().

Signed-off-by: Jingoo Han <[email protected]>
Cc: Ashish Jangam <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Sachin Kamat <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMAINTAINERS: update email address for Khalid Aziz
Khalid Aziz [Fri, 5 Oct 2012 00:12:40 +0000 (17:12 -0700)]
MAINTAINERS: update email address for Khalid Aziz

Signed-off-by: Khalid Aziz <[email protected]>
Cc: Khalid Aziz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMAINTAINERS: fix indentation for Viresh Kumar
Andy Shevchenko [Fri, 5 Oct 2012 00:12:39 +0000 (17:12 -0700)]
MAINTAINERS: fix indentation for Viresh Kumar

Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMAINTAINERS: Update gianfar_ptp after renaming
Joe Perches [Fri, 5 Oct 2012 00:12:37 +0000 (17:12 -0700)]
MAINTAINERS: Update gianfar_ptp after renaming

Commit ec21e2ec3676 ("freescale: Move the Freescale drivers") moved the
files, update the pattern.

Signed-off-by: Joe Perches <[email protected]>
Acked-by: Richard Cochran <[email protected]>
Acked-by: Jeff Kirsher <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMAINTAINERS: add defconfig file to IMX section
Uwe Kleine-König [Fri, 5 Oct 2012 00:12:36 +0000 (17:12 -0700)]
MAINTAINERS: add defconfig file to IMX section

Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMAINTAINERS: update gpio subsystem file list
Yang Bai [Fri, 5 Oct 2012 00:12:35 +0000 (17:12 -0700)]
MAINTAINERS: update gpio subsystem file list

Signed-off-by: Yang Bai <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib/vsprintf: update documentation to cover all of %p[Mm][FR]
Andy Shevchenko [Fri, 5 Oct 2012 00:12:33 +0000 (17:12 -0700)]
lib/vsprintf: update documentation to cover all of %p[Mm][FR]

Acked-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib: vsprintf: fix broken comments
George Spelvin [Fri, 5 Oct 2012 00:12:32 +0000 (17:12 -0700)]
lib: vsprintf: fix broken comments

Numbering the 8 potential digits 2 though 9 never did make a lot of sense.

Signed-off-by: George Spelvin <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib: vsprintf: optimize put_dec_trunc8()
George Spelvin [Fri, 5 Oct 2012 00:12:30 +0000 (17:12 -0700)]
lib: vsprintf: optimize put_dec_trunc8()

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: George Spelvin <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Cc: Rabin Vincent <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib: vsprintf: optimize division by 10000
George Spelvin [Fri, 5 Oct 2012 00:12:29 +0000 (17:12 -0700)]
lib: vsprintf: optimize division by 10000

The same multiply-by-inverse technique can be used to convert division by
10000 to a 32x32->64-bit multiply.

Signed-off-by: George Spelvin <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib: vsprintf: optimize division by 10 for small integers
George Spelvin [Fri, 5 Oct 2012 00:12:27 +0000 (17:12 -0700)]
lib: vsprintf: optimize division by 10 for small integers

Shrink the reciprocal approximations used in put_dec_full4() based on the
comments in put_dec_full9().

Signed-off-by: George Spelvin <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agopoweroff: fix bug in orderly_poweroff()
hongfeng [Fri, 5 Oct 2012 00:12:25 +0000 (17:12 -0700)]
poweroff: fix bug in orderly_poweroff()

orderly_poweroff is trying to poweroff platform in two steps:

step 1: Call user space application to poweroff
step 2: If user space poweroff fail, then do a force power off if force param
        is set.

The bug here is, step 1 is always successful with param UMH_NO_WAIT, which obey
the design goal of orderly_poweroff.

We have two choices here:
UMH_WAIT_EXEC which means wait for the exec, but not the process;
UMH_WAIT_PROC which means wait for the process to complete.
we need to trade off the two choices:

If using UMH_WAIT_EXEC, there is potential issue comments by Serge E.
Hallyn: The exec will have started, but may for whatever (very unlikely)
reason fail.

If using UMH_WAIT_PROC, there is potential issue comments by Eric W.
Biederman: If the caller is not running in a kernel thread then we can
easily get into a case where the user space caller will block waiting for
us when we are waiting for the user space caller.

Thanks for their excellent ideas, based on the above discussion, we
finally choose UMH_WAIT_EXEC, which is much more safe, if the user
application really fails, we just complain the application itself, it
seems a better choice here.

Signed-off-by: Feng Hong <[email protected]>
Acked-by: Kees Cook <[email protected]>
Acked-by: Serge Hallyn <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Acked-by: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agokernel/sys.c: call disable_nonboot_cpus() in kernel_restart()
Shawn Guo [Fri, 5 Oct 2012 00:12:23 +0000 (17:12 -0700)]
kernel/sys.c: call disable_nonboot_cpus() in kernel_restart()

As kernel_power_off() calls disable_nonboot_cpus(), we may also want to
have kernel_restart() call disable_nonboot_cpus().  Doing so can help
machines that require boot cpu be the last alive cpu during reboot to
survive with kernel restart.

This fixes one reboot issue seen on imx6q (Cortex-A9 Quad).  The machine
requires that the restart routine be run on the primary cpu rather than
secondary ones.  Otherwise, the secondary core running the restart
routine will fail to come to online after reboot.

Signed-off-by: Shawn Guo <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agotile: fix personality bits handling upon exec()
Jiri Kosina [Fri, 5 Oct 2012 00:12:22 +0000 (17:12 -0700)]
tile: fix personality bits handling upon exec()

Historically, the top three bytes of personality have been used for
things such as ADDR_NO_RANDOMIZE, which made sense only for specific
architectures.

We now however have a flag there that is general no matter the
architecture (UNAME26); generally we have to be careful to preserve the
personality flags across exec().

This patch fixes tile architecture not to forcefully overwrite
personality flags during exec().

In addition to that, we fix two other things along the way:

- exec_domain switching is fixed -- set_personality() should always
  be used instead of directly assigning to current->personality.
- as pointed out by Arnd Bergmann, PER_LINUX_32BIT is not used anywhere
  by tile, so let's just drop that in favor of PER_LINUX

Signed-off-by: Jiri Kosina <[email protected]>
Acked-by: Chris Metcalf <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agocross-arch: don't corrupt personality flags upon exec()
Jiri Kosina [Fri, 5 Oct 2012 00:12:20 +0000 (17:12 -0700)]
cross-arch: don't corrupt personality flags upon exec()

Historically, the top three bytes of personality have been used for
things such as ADDR_NO_RANDOMIZE, which made sense only for specific
architectures.

We now however have a flag there that is general no matter the
architecture (UNAME26); generally we have to be careful to preserve the
personality flags across exec().

This patch tries to fix all architectures that forcefully overwrite
personality flags during exec() (ppc32 and s390 have been fixed recently
by commits f9783ec862ea ("[S390] Do not clobber personality flags on
exec") and 59e4c3a2fe9c ("powerpc/32: Don't clobber personality flags on
exec") in a similar way already).

Signed-off-by: Jiri Kosina <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: Hans-Christian Egtvedt <[email protected]>
Cc: Mike Frysinger <[email protected]>
Cc: Mark Salter <[email protected]>
Cc: Mikael Starvik <[email protected]>
Cc: Jesper Nilsson <[email protected]>
Cc: David Howells <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: Richard Kuo <[email protected]>
Cc: Hirokazu Takata <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Koichi Yasutake <[email protected]>
Cc: Jonas Bonn <[email protected]>
Cc: Chen Liqin <[email protected]>
Cc: Lennox Wu <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Chris Zankel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoscore: select generic atomic64_t support
Fengguang Wu [Fri, 5 Oct 2012 00:12:18 +0000 (17:12 -0700)]
score: select generic atomic64_t support

It's required for the core fs/namespace.c and many other basic features.

Signed-off-by: Fengguang Wu <[email protected]>
Acked-by: Lennox Wu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agofrv: kill used but uninitialized variable
Geert Uytterhoeven [Fri, 5 Oct 2012 00:12:16 +0000 (17:12 -0700)]
frv: kill used but uninitialized variable

Commit 6afe1a1fe8ff ("PM: Remove legacy PM") removed the initialization
of retval, causing:

  arch/frv/kernel/pm.c: In function 'sysctl_pm_do_suspend':
  arch/frv/kernel/pm.c:165:5: warning: 'retval' may be used uninitialized in this function [-Wuninitialized]

Remove the variable completely to fix this, and convert to a proper
switch (...) { ... } construct to improve readability.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix const sections for crc32 table
Joe Mario [Fri, 5 Oct 2012 00:12:15 +0000 (17:12 -0700)]
sections: fix const sections for crc32 table

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.

[[email protected]: some fixes and new description]
[[email protected]: checkpatch fixes]
Signed-off-by: Joe Mario <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in sound
Andi Kleen [Fri, 5 Oct 2012 00:12:13 +0000 (17:12 -0700)]
sections: fix section conflicts in sound

Signed-off-by: Andi Kleen <[email protected]>
Cc: Takashi Iwai <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in net
Andi Kleen [Fri, 5 Oct 2012 00:12:11 +0000 (17:12 -0700)]
sections: fix section conflicts in net

Signed-off-by: Andi Kleen <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in net/can
Andi Kleen [Fri, 5 Oct 2012 00:12:08 +0000 (17:12 -0700)]
sections: fix section conflicts in net/can

Signed-off-by: Andi Kleen <[email protected]>
Cc: Oliver Hartkopp <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in mm/percpu.c
Andi Kleen [Fri, 5 Oct 2012 00:12:07 +0000 (17:12 -0700)]
sections: fix section conflicts in mm/percpu.c

Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/video
Andi Kleen [Fri, 5 Oct 2012 00:12:05 +0000 (17:12 -0700)]
sections: fix section conflicts in drivers/video

Signed-off-by: Andi Kleen <[email protected]>
Cc: Florian Tobias Schandinat <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/scsi
Andi Kleen [Fri, 5 Oct 2012 00:12:03 +0000 (17:12 -0700)]
sections: fix section conflicts in drivers/scsi

Signed-off-by: Andi Kleen <[email protected]>
Cc: James Bottomley <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/platform/x86
Andi Kleen [Fri, 5 Oct 2012 00:12:01 +0000 (17:12 -0700)]
sections: fix section conflicts in drivers/platform/x86

Signed-off-by: Andi Kleen <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/net/wan
Andi Kleen [Fri, 5 Oct 2012 00:11:59 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/net/wan

Signed-off-by: Andi Kleen <[email protected]>
Cc: Krzysztof Halasa <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/net/hamradio
Andi Kleen [Fri, 5 Oct 2012 00:11:58 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/net/hamradio

Signed-off-by: Andi Kleen <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/net
Andi Kleen [Fri, 5 Oct 2012 00:11:55 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/net

Signed-off-by: Andi Kleen <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/mmc
Andi Kleen [Fri, 5 Oct 2012 00:11:54 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/mmc

Signed-off-by: Andi Kleen <[email protected]>
Cc: Chris Ball <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/mfd
Andi Kleen [Fri, 5 Oct 2012 00:11:52 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/mfd

Signed-off-by: Andi Kleen <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/macintosh
Andi Kleen [Fri, 5 Oct 2012 00:11:50 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/macintosh

[[email protected]: checkpatch fixes]
Signed-off-by: Andi Kleen <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/ide
Andi Kleen [Fri, 5 Oct 2012 00:11:48 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/ide

Signed-off-by: Andi Kleen <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/char
Andi Kleen [Fri, 5 Oct 2012 00:11:47 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/char

Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in drivers/atm
Andi Kleen [Fri, 5 Oct 2012 00:11:45 +0000 (17:11 -0700)]
sections: fix section conflicts in drivers/atm

Signed-off-by: Andi Kleen <[email protected]>
Cc: Chas Williams <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/x86
Andi Kleen [Fri, 5 Oct 2012 00:11:42 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/x86

Signed-off-by: Andi Kleen <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/sh
Andi Kleen [Fri, 5 Oct 2012 00:11:41 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/sh

Signed-off-by: Andi Kleen <[email protected]>
Cc: Paul Mundt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/score
Andi Kleen [Fri, 5 Oct 2012 00:11:39 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/score

Signed-off-by: Andi Kleen <[email protected]>
Cc: Chen Liqin <[email protected]>
Cc: Lennox Wu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/powerpc
Andi Kleen [Fri, 5 Oct 2012 00:11:37 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/powerpc

Signed-off-by: Andi Kleen <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/mips
Andi Kleen [Fri, 5 Oct 2012 00:11:35 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/mips

Signed-off-by: Andi Kleen <[email protected]>
Cc: Ralf Baechle <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/ia64
Andi Kleen [Fri, 5 Oct 2012 00:11:34 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/ia64

Signed-off-by: Andi Kleen <[email protected]>
Cc: "Luck, Tony" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/h8300
Andi Kleen [Fri, 5 Oct 2012 00:11:32 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/h8300

[[email protected]: checkpatch fixes]
Signed-off-by: Andi Kleen <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/frv
Andi Kleen [Fri, 5 Oct 2012 00:11:30 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/frv

Signed-off-by: Andi Kleen <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: fix section conflicts in arch/arm/
Andi Kleen [Fri, 5 Oct 2012 00:11:28 +0000 (17:11 -0700)]
sections: fix section conflicts in arch/arm/

Signed-off-by: Andi Kleen <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosections: disable const sections for PA-RISC v2
Andi Kleen [Fri, 5 Oct 2012 00:11:27 +0000 (17:11 -0700)]
sections: disable const sections for PA-RISC v2

The PA-RISC tool chain seems to have some problem with correct
read/write attributes on sections.  This causes problems when the const
sections are fixed up for other architecture to only contain truly
read-only data.

Disable const sections for PA-RISC

This can cause a bit of noise with modpost.

Signed-off-by: Andi Kleen <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/scsi/atp870u.c: fix bad use of udelay
Martin Michlmayr [Fri, 5 Oct 2012 00:11:25 +0000 (17:11 -0700)]
drivers/scsi/atp870u.c: fix bad use of udelay

The ACARD driver calls udelay() with a value > 2000, which leads to to
the following compilation error on ARM:

  ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined!
  make[1]: *** [__modpost] Error 1

This is because udelay is defined on ARM, roughly speaking, as

#define udelay(n) ((n) > 2000 ? __bad_udelay() : \
__const_udelay((n) * ((2199023U*HZ)>>11)))

The argument to __const_udelay is the number of jiffies to wait divided
by 4, but this does not work unless the multiplication does not
overflow, and that is what the build error is designed to prevent.  The
intended behavior can be achieved by using mdelay to call udelay
multiple times in a loop.

[[email protected]: adding context]
Signed-off-by: Martin Michlmayr <[email protected]>
Signed-off-by: Jonathan Nieder <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agounicore32: select generic atomic64_t support
Fengguang Wu [Fri, 5 Oct 2012 00:11:23 +0000 (17:11 -0700)]
unicore32: select generic atomic64_t support

It's required for the core fs/namespace.c and many other basic features.

Signed-off-by: Guan Xuetao <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agokbuild: make: fix if_changed when command contains backslashes
Sascha Hauer [Fri, 5 Oct 2012 00:11:17 +0000 (17:11 -0700)]
kbuild: make: fix if_changed when command contains backslashes

The call if_changed mechanism does not work when the command contains
backslashes.  This basically is an issue with lzo and bzip2 compressed
kernels.  The compressed binaries do not contain the uncompressed image
size, so these use size_append to append the size.  This results in
backslashes in the executed command.  With this if_changed always
detects a change in the command and rebuilds the compressed image even
if nothing has changed.

Fix this by escaping backslashes in make-cmd

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Jan Luebbe <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Bernhard Walle <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers/dma/dmaengine.c: lower the priority of 'failed to get' dma channel message
Fabio Estevam [Fri, 5 Oct 2012 00:11:16 +0000 (17:11 -0700)]
drivers/dma/dmaengine.c: lower the priority of 'failed to get' dma channel message

Do the same as commit a03a202e95fd ("dmaengine: failure to get a
specific DMA channel is not critical") to get rid of the following
messages during kernel boot:

  dmaengine_get: failed to get dma1chan0: (-22)
  dmaengine_get: failed to get dma1chan1: (-22)
  dmaengine_get: failed to get dma1chan2: (-22)
  dmaengine_get: failed to get dma1chan3: (-22)
  ..

Signed-off-by: Fabio Estevam <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agomn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it
Geert Uytterhoeven [Fri, 5 Oct 2012 00:11:13 +0000 (17:11 -0700)]
mn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it

It seems the current (gcc 4.6.3) no longer provides this so make it
conditional.

As reported by Tony before, the mn10300 architecture cross-compiles with
gcc-4.6.3 if -mmem-funcs is not added to KBUILD_CFLAGS.

Reported-by: Tony Breeds <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: David Howells <[email protected]>
Cc: Koichi Yasutake <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoaudit.h: replace defines with C stubs
Kees Cook [Fri, 5 Oct 2012 00:11:11 +0000 (17:11 -0700)]
audit.h: replace defines with C stubs

Replace the #defines used when CONFIG_AUDIT or CONFIG_AUDIT_SYSCALLS are
disabled so we get type checking during those builds.

Suggested-by: Andrew Morton <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoPartially revert a1ce39288e6fbef (UAPI: (Scripted) Convert #include "..." to #include...
David Daney [Fri, 5 Oct 2012 17:45:30 +0000 (10:45 -0700)]
Partially revert a1ce39288e6fbef (UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers)

Syntax errors were introduced into include/linux/libfdt.h by the
offending commit, revert the changes made to this file.  The kernel
again compiles, thus restoring harmony and balance to the universe.

Signed-off-by: David Daney <[email protected]>
Cc: David Howells <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Dave Jones <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoext4: fix ext4_flush_completed_IO wait semantics
Dmitry Monakhov [Fri, 5 Oct 2012 15:31:55 +0000 (11:31 -0400)]
ext4: fix ext4_flush_completed_IO wait semantics

BUG #1) All places where we call ext4_flush_completed_IO are broken
    because buffered io and DIO/AIO goes through three stages
    1) submitted io,
    2) completed io (in i_completed_io_list) conversion pended
    3) finished  io (conversion done)
    And by calling ext4_flush_completed_IO we will flush only
    requests which were in (2) stage, which is wrong because:
     1) punch_hole and truncate _must_ wait for all outstanding unwritten io
      regardless to it's state.
     2) fsync and nolock_dio_read should also wait because there is
        a time window between end_page_writeback() and ext4_add_complete_io()
        As result integrity fsync is broken in case of buffered write
        to fallocated region:
        fsync                                      blkdev_completion
 ->filemap_write_and_wait_range
                                                   ->ext4_end_bio
                                                     ->end_page_writeback
          <-- filemap_write_and_wait_range return
 ->ext4_flush_completed_IO
     sees empty i_completed_io_list but pended
     conversion still exist
                                                     ->ext4_add_complete_io

BUG #2) Race window becomes wider due to the 'ext4: completed_io
locking cleanup V4' patch series

This patch make following changes:
1) ext4_flush_completed_io() now first try to flush completed io and when
   wait for any outstanding unwritten io via ext4_unwritten_wait()
2) Rename function to more appropriate name.
3) Assert that all callers of ext4_flush_unwritten_io should hold i_mutex to
   prevent endless wait

Signed-off-by: Dmitry Monakhov <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
12 years agoMerge branch 'staging/for_v3.7' into v4l_for_linus
Mauro Carvalho Chehab [Fri, 5 Oct 2012 12:36:26 +0000 (09:36 -0300)]
Merge branch 'staging/for_v3.7' into v4l_for_linus

* staging/for_v3.7: (2891 commits)
  em28xx: regression fix: use DRX-K sync firmware requests on em28xx
  drxk: allow loading firmware synchrousnously
  em28xx: Make all em28xx extensions to be initialized asynchronously
  [media] tda18271: properly report read errors in tda18271_get_id
  [media] tda18271: delay IR & RF calibration until init() if delay_cal is set
  [media] MAINTAINERS: add Michael Krufky as tda827x maintainer
  [media] MAINTAINERS: add Michael Krufky as tda8290 maintainer
  [media] MAINTAINERS: add Michael Krufky as cxusb maintainer
  [media] MAINTAINERS: add Michael Krufky as lg2160 maintainer
  [media] MAINTAINERS: add Michael Krufky as lgdt3305 maintainer
  [media] MAINTAINERS: add Michael Krufky as mxl111sf maintainer
  [media] MAINTAINERS: add Michael Krufky as mxl5007t maintainer
  [media] MAINTAINERS: add Michael Krufky as tda18271 maintainer
  [media] s5p-tv: Report only multi-plane capabilities in vidioc_querycap
  [media] s5p-mfc: Fix misplaced return statement in s5p_mfc_suspend()
  [media] exynos-gsc: Add missing static storage class specifiers
  [media] exynos-gsc: Remove <linux/version.h> header file inclusion
  [media] s5p-fimc: Fix incorrect condition in fimc_lite_reqbufs()
  [media] s5p-tv: Fix potential NULL pointer dereference error
  [media] s5k6aa: Fix possible NULL pointer dereference
  ...

Conflicts:
drivers/media/platform/s5p-fimc/fimc-capture.c
drivers/media/platform/s5p-fimc/fimc-lite.c

12 years agoima: fix bug in argument order
Dmitry Kasatkin [Thu, 27 Sep 2012 15:26:53 +0000 (18:26 +0300)]
ima: fix bug in argument order

mask argument goes first, then func, like ima_must_measure
and ima_get_action. ima_inode_post_setattr() assumes that.

Signed-off-by: Dmitry Kasatkin <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
Signed-off-by: James Morris <[email protected]>
12 years agodrm: exynos: hdmi: remove drm common hdmi platform data struct
Rahul Sharma [Thu, 4 Oct 2012 15:18:56 +0000 (20:48 +0530)]
drm: exynos: hdmi: remove drm common hdmi platform data struct

exynos-drm-hdmi need context pointers from hdmi and mixer. These
pointers were expected from the plf data. Cleaned this dependency
by exporting i/f which are called by hdmi, mixer driver probes
for setting their context.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: add support for exynos5 hdmi
Rahul Sharma [Thu, 4 Oct 2012 15:18:55 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support for exynos5 hdmi

This patch adds support for exynos5 hdmi with device tree enabled.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: replace is_v13 with version check in hdmi
Rahul Sharma [Thu, 4 Oct 2012 15:18:54 +0000 (20:48 +0530)]
drm: exynos: hdmi: replace is_v13 with version check in hdmi

This patch removed the is_v13 variable from the hdmi driver context.
It is replaced with condition check for the hdmi version. This cleans
the way for handling further hdmi versions.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: add support for exynos5 mixer
Rahul Sharma [Thu, 4 Oct 2012 15:18:53 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support for exynos5 mixer

This patch adds support for exynos5 mixer with device tree enabled.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Fahad Kunnathadi <[email protected]>
Signed-off-by: Kyungmin.park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: add support to disable video processor in mixer
Rahul Sharma [Thu, 4 Oct 2012 15:18:52 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support to disable video processor in mixer

This patch adds support for disabling the video processor code based
on the platform type. This is done based on a field in the mixer driver
data which changes with the platform variant.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: add support for platform variants for mixer
Rahul Sharma [Thu, 4 Oct 2012 15:18:51 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support for platform variants for mixer

This patch adds the support for multiple mixer versions avaialble in
various platform variants. Version is passed as a driver data field
instead of paltform data.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: add support for exynos5 hdmiphy
Rahul Sharma [Thu, 4 Oct 2012 15:18:50 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support for exynos5 hdmiphy

This patch adds support for exynos5 hdmi phy with device tree enabled.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: add support for exynos5 ddc
Rahul Sharma [Thu, 4 Oct 2012 15:18:49 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support for exynos5 ddc

This patch adds support for exynos5 ddc with device tree enabled.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: remove drm hdmi platform data struct
Rahul Sharma [Thu, 4 Oct 2012 15:18:48 +0000 (20:48 +0530)]
drm: exynos: remove drm hdmi platform data struct

This patch removes the drm hdmi platform data structure which is no
longer in use by drm hdmi driver after this patch set get merged. s5p
hdmi platform data structure is used instead.

Signed-off-by: Rahul Sharma <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: turn off HPD interrupt in HDMI chip
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:47 +0000 (20:48 +0530)]
drm: exynos: hdmi: turn off HPD interrupt in HDMI chip

The plug/unplug interrupt are handled by a separate interrupt.
So there is no need to replicate this mechanism in HDMI core.

Signed-off-by: Tomasz Stanislawski <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: use s5p-hdmi platform data
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:46 +0000 (20:48 +0530)]
drm: exynos: hdmi: use s5p-hdmi platform data

The 'exynos-drm-hdmi' driver makes use of s5p-tv platform devices. Therefore
the driver should use the same platform data to prevent crashes caused by
dereferencing incorrect types.  This patch corrects the exynos-drm-hdmi driver
to the platform data from s5p-hdmi.

Signed-off-by: Tomasz Stanislawski <[email protected]>
Signed-off-by: Joonyoung Shim <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: fix interrupt handling
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:45 +0000 (20:48 +0530)]
drm: exynos: hdmi: fix interrupt handling

This patch fixes 'unsigned < 0' check in probe. Moreover it
releases an interrupt at remove.

Signed-off-by: Tomasz Stanislawski <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agodrm: exynos: hdmi: support for platform variants
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:44 +0000 (20:48 +0530)]
drm: exynos: hdmi: support for platform variants

This patch implements check if HDMI is version 1.3 by using a driver variant
instead of platform data.

Signed-off-by: Tomasz Stanislawski <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agomedia: s5p-hdmi: add HPD GPIO to platform data
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:43 +0000 (20:48 +0530)]
media: s5p-hdmi: add HPD GPIO to platform data

This patch extends s5p-hdmi platform data by a GPIO identifier for
Hot-Plug-Detection pin.

Signed-off-by: Tomasz Stanislawski <[email protected]>
Acked-by: Tomasz Stanislawski <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
12 years agoARM: 7548/1: include linux/sched.h in syscall.h
Wade Farnsworth [Tue, 2 Oct 2012 16:08:30 +0000 (17:08 +0100)]
ARM: 7548/1: include linux/sched.h in syscall.h

The syscall tracing patch introduces a compile bug in lttng-modules
when the latter calls syscall_get_nr(), similar to the following:

<path-to-linux>/arch/arm/include/asm/syscall.h:21:2: error: implicit declaration of function 'task_thread_info' [-Werror=implicit-function-declaration]

The issue is that we are using task_thread_info() in the
syscall_get_nr() function in asm/syscall.h, but not explicitly
including sched.h from this file, so we can expect this bug might
surface any time that syscall_get_nr() is called.

Explicitly including sched.h solves the problem.

Cc: <[email protected]> [3.5, 3.6]
Signed-off-by: Wade Farnsworth <[email protected]>
Acked-by: Will Deacon <[email protected]>
Signed-off-by: Russell King <[email protected]>
12 years agoMerge branch 'late/kirkwood' into late/soc
Olof Johansson [Fri, 5 Oct 2012 03:17:25 +0000 (20:17 -0700)]
Merge branch 'late/kirkwood' into late/soc

Merge in the late Kirkwood branch with the OMAP late branch for upstream
submission.

Final contents described in shared tag.

Fixup remove/change conflicts in arch/arm/mach-omap2/devices.c and
drivers/spi/spi-omap2-mcspi.c.

Signed-off-by: Olof Johansson <[email protected]>
12 years agoMerge tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Linus Torvalds [Fri, 5 Oct 2012 03:01:30 +0000 (12:01 +0900)]
Merge tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

Pull MFD changes from Samuel Ortiz:
 "MFD bits for the 3.7 merge window.

  As usual we have a few new drivers:

   - TI LP8788
   - TI OMAP USB TLL
   - Maxim MAX8907
   - SMSC ECE1099
   - Dialog Semiconductor DA9055
   - A simpler syscon driver that allow us to get rid of the anatop one.

  Drivers are also gradually getting Device Tree and IRQ domain support.

  The following drivers got DT support:
   - palmas, 88pm860x, tc3589x and twl4030-audio

  And those ones now use the IRQ domain APIs:
   - 88pm860x, tc3589x, db8500_prcmu

  Also some other interesting changes:
   - Intel's ICH LPC now supports Lynx Point
   - TI's twl4030-audio added a GPO child
   - tps6527 enabled its backlight subdevice
   - The twl6030 pwm driver moved to the new PWM subsystem

  And finally a bunch of cleanup and casual fixes for mc13xxx, 88pm860x,
  palmas, ab8500, wm8994, wm5110, max8907 and the tps65xxx family."

Fix up various annoying conflicts: the DT and IRQ domain support came in
twice and was already in 3.6. And then it was apparently rebased.

Guys, DON'T REBASE!

* tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (89 commits)
  ARM: dts: Enable 88pm860x pmic
  mfd: 88pm860x: Move gpadc init into touch
  mfd: 88pm860x: Device tree support
  mfd: 88pm860x: Use irqdomain
  mfd: smsc: Add support for smsc gpio io/keypad driver
  backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe
  mfd: DA9055 core driver
  mfd: tps65910: Add alarm interrupt of TPS65910 RTC to mfd device list
  mfd: wm5110: Add register patches for revision B
  mfd: wm5110: Disable control interface error report for WM5110 rev B
  mfd: max8907: Remove regulator-compatible from DT docs
  backlight: Add TPS65217 WLED driver
  mfd: Add backlight as subdevice to the tps65217
  mfd: Provide the PRCMU with its own IRQ domain
  mfd: Fix max8907 sparse warning
  mfd: Add lp8788 mfd driver
  mfd: dbx500: Provide a more accurate smp_twd clock
  mfd: rc5t583: Fix warning messages
  regulator: palmas: Add DT support
  mfd: palmas: Change regulator defns to better suite DT
  ...

12 years agoMerge branches 'cma', 'ipoib', 'iser', 'mlx4' and 'nes' into for-next
Roland Dreier [Fri, 5 Oct 2012 02:12:22 +0000 (19:12 -0700)]
Merge branches 'cma', 'ipoib', 'iser', 'mlx4' and 'nes' into for-next

12 years agoRDMA/cma: Check that retry count values are in range
Sean Hefty [Wed, 3 Oct 2012 23:42:31 +0000 (23:42 +0000)]
RDMA/cma: Check that retry count values are in range

The retry_count and rnr_retry_count connection parameters are both
3-bit values.  Check that the values are in range and reduce if
they're not.

This fixes a problem reported by Doug Ledford <[email protected]>
that resulted in the userspace rping test (part of the librdmacm
samples) failing to run over Intel IB HCAs.

Signed-off-by: Sean Hefty <[email protected]>
[ Use min_t() to avoid warnings about type mismatch.  - Roland ]

Signed-off-by: Roland Dreier <[email protected]>
12 years agoMerge commit 'v3.6' into fixes
Russell King [Thu, 4 Oct 2012 22:59:32 +0000 (23:59 +0100)]
Merge commit 'v3.6' into fixes

12 years agoMerge branch 'arch-timers' into for-linus
Russell King [Thu, 4 Oct 2012 22:02:26 +0000 (23:02 +0100)]
Merge branch 'arch-timers' into for-linus

Conflicts:
arch/arm/include/asm/timex.h
arch/arm/lib/delay.c

12 years agoMerge branches 'atags', 'cache-l2x0', 'clkdev', 'fixes', 'integrator', 'misc', 'opcod...
Russell King [Thu, 4 Oct 2012 22:01:55 +0000 (23:01 +0100)]
Merge branches 'atags', 'cache-l2x0', 'clkdev', 'fixes', 'integrator', 'misc', 'opcodes' and 'syscall' into for-linus

12 years agoMerge branch 'cleanup' into for-linus
Russell King [Thu, 4 Oct 2012 22:01:28 +0000 (23:01 +0100)]
Merge branch 'cleanup' into for-linus

Conflicts:
arch/arm/mach-imx/mach-imx27_visstrim_m10.c

12 years agosparc64: Fix strace hiccups when force_successful_syscall() triggers.
Al Viro [Thu, 4 Oct 2012 21:13:59 +0000 (14:13 -0700)]
sparc64: Fix strace hiccups when force_successful_syscall() triggers.

When force_successful_syscall() triggers, the syscall return status
reported the ptrace applications gets garbled.

Fix this by reordering the events and tests in the ret_sys_call path.

Signed-off-by: David S. Miller <[email protected]>
12 years agosparc64: Rearrange thread info to cheaply clear syscall noerror state.
Al Viro [Thu, 4 Oct 2012 20:52:53 +0000 (13:52 -0700)]
sparc64: Rearrange thread info to cheaply clear syscall noerror state.

After fixing a couple of brainos, it even seems to work.  What's done here
is move of ->syscall_noerror right before FPDEPTH byte in ->flags and
using sth to [%g6 + TI_SYS_NOERROR] instead of stb to [%g6 + TI_FPDEPTH] in
both branches of etrap_save.  AFAICS, that ought to be solid.  Again,
deciding what to do with now unused delay slot of branch on ->syscall_noerror
and dealing with the order of tests in ret_from_sys is a separate question,
but at least that way we don't have to clean ->syscall_noerror in there at
all.  AFAICS, it ought to be a clear win - sth is not going to cost more than
stb on etrap_64.S side of things, and we are losing write on syscalls.S one.

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This page took 0.11241 seconds and 4 git commands to generate.