aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-10-06checkpatch: check networking specific block comment styleJoe Perches1-0/+14
In an effort to get fewer checkpatch reviewer corrections, add a networking specific style test for the preferred networking comment style. /* The preferred style for block comments in * drivers/net/... and net/... is like this */ These tests are only used in net/ and drivers/net/ Tested with: $ cat drivers/net/t.c /* foo */ /* * foo */ /* foo */ /* foo * bar */ $ ./scripts/checkpatch.pl -f drivers/net/t.c WARNING: networking block comments don't use an empty /* line, use /* Comment... #4: FILE: net/t.c:4: + +/* WARNING: networking block comments put the trailing */ on a separate line #12: FILE: net/t.c:12: + * bar */ total: 0 errors, 2 warnings, 12 lines checked Signed-off-by: Joe Perches <[email protected]> Cc: "Allan, Bruce W" <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: David Miller <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-10-06checkpatch: update suggested printk conversionsJoe Perches1-2/+4
Direct conversion of printk(KERN_<LEVEL>... to pr_<level> isn't the preferred conversion when a struct net_device or struct device is available. Hint that using netdev_<level> or dev_<level> is preferred to using pr_<level>. Add netdev_dbg and dev_dbg variants too. Miscellaneous whitespace neatening of a misplaced close brace. Signed-off-by: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Greg KH <[email protected]> Cc: Dan Carpenter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-10-06checkpatch: check utf-8 content from a commit log when it's missing from charsetPasi Savanainen1-3/+12
Check that a commit log doesn't contain UTF-8 when a mail header explicitly defines a different charset, like 'Content-Type: text/plain; charset="us-ascii"' Signed-off-by: Pasi Savanainen <[email protected]> Cc: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-10-06scatterlist: atomic sg_mapping_iter() no longer needs disabled IRQsTejun Heo1-8/+8
SG mapping iterator w/ SG_MITER_ATOMIC set required IRQ disabled because it originally used KM_BIO_SRC_IRQ to allow use from IRQ handlers. kmap_atomic() has long been updated to handle stacking atomic mapping requests on per-cpu basis and only requires not sleeping while mapped. Update sg_mapping_iter such that atomic iterators only require disabling preemption instead of disabling IRQ. While at it, convert wte weird @ARG@ notations to @ARG in the comment of sg_miter_start(). Signed-off-by: Tejun Heo <[email protected]> Cc: Maxim Levitsky <[email protected]> Cc: Alex Dubov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-10-06lib/plist.c: make plist test announcements KERN_DEBUGBorislav Petkov1-2/+2
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]>
2012-10-06lib/vsprintf.c: improve standard conformance of sscanf()Jan Beulich1-19/+14
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]>
2012-10-06lib/spinlock_debug: avoid livelock in do_raw_spin_lock()Vikram Mulukutla1-14/+18
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]>
2012-10-06genalloc: make it possible to use a custom allocation algorithmBenjamin Gaignard2-4/+111
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]>
2012-10-06lib/gcd.c: prevent possible div by 0Davidlohr Bueso1-0/+3
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]>
2012-10-06lib/Kconfig.debug: adjust hard-lockup related Kconfig optionsJan Beulich1-4/+5
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]>
2012-10-06lib/parser.c: avoid overflow in match_number()Alex Elder1-2/+8
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]>
2012-10-06idr: rename MAX_LEVEL to MAX_IDR_LEVELFengguang Wu8-27/+27
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]>
2012-10-06kvm: replace test_and_set_bit_le() in mark_page_dirty_in_slot() with ↵Takuya Yoshikawa1-2/+1
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]>
2012-10-06powerpc: bitops: introduce {clear,set}_bit_le()Takuya Yoshikawa1-0/+10
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]>
2012-10-06bitops: introduce generic {clear,set}_bit_le()Takuya Yoshikawa1-0/+10
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]>
2012-10-06drivers/net/ethernet/dec/tulip: Use standard __set_bit_le() functionTakuya Yoshikawa2-10/+4
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]>
2012-10-06drivers/net/ethernet/sfc: use standard __{clear,set}_bit_le() functionsBen Hutchings3-16/+4
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]>
2012-10-06drivers/video/backlight/platform_lcd.c: add support for device tree based probeJingoo Han1-0/+10
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]>
2012-10-06drivers/video/backlight/da9052_bl.c: drop devm_kfree of devm_kzalloc'd dataJulia Lawall1-2/+0
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]>
2012-10-06backlight: remove ProGear driverMarcin Juszkiewicz3-170/+0
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]>
2012-10-06backlight: add new lm3639 backlight driverG.Shark Jeong4-0/+516
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]>
2012-10-06backlight: add Backlight driver for lm3630 chipG.Shark Jeong4-0/+540
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]>
2012-10-06backlight: lp855x: add FAST bit description for LP8556Kim, Milo1-0/+2
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]>
2012-10-06drivers/video/backlight/kb3886_bl.c: use usleep_range() instead of msleep() ↵Jingoo Han1-2/+2
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]>
2012-10-06drivers/video/backlight/ltv350qv.c: use usleep_range() instead of msleep() ↵Jingoo Han1-3/+3
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]>
2012-10-06drivers/video/backlight/da9052_bl.c: use usleep_range() instead of msleep() ↵Jingoo Han1-1/+1
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]>
2012-10-06MAINTAINERS: update email address for Khalid AzizKhalid Aziz1-1/+1
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]>
2012-10-06MAINTAINERS: fix indentation for Viresh KumarAndy Shevchenko1-8/+8
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]>
2012-10-06MAINTAINERS: Update gianfar_ptp after renamingJoe Perches1-1/+1
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]>
2012-10-06MAINTAINERS: add defconfig file to IMX sectionUwe Kleine-König1-0/+1
Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-10-06MAINTAINERS: update gpio subsystem file listYang Bai1-0/+1
Signed-off-by: Yang Bai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-10-06lib/vsprintf: update documentation to cover all of %p[Mm][FR]Andy Shevchenko2-1/+5
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]>
2012-10-06lib: vsprintf: fix broken commentsGeorge Spelvin1-7/+7
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]>
2012-10-06lib: vsprintf: optimize put_dec_trunc8()George Spelvin1-16/+6
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]>
2012-10-06lib: vsprintf: optimize division by 10000George Spelvin1-27/+33
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]>
2012-10-06lib: vsprintf: optimize division by 10 for small integersGeorge Spelvin1-2/+3
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]>
2012-10-06poweroff: fix bug in orderly_poweroff()hongfeng1-1/+1
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]>
2012-10-06kernel/sys.c: call disable_nonboot_cpus() in kernel_restart()Shawn Guo1-0/+1
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]>
2012-10-06tile: fix personality bits handling upon exec()Jiri Kosina1-2/+2
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]>
2012-10-06cross-arch: don't corrupt personality flags upon exec()Jiri Kosina16-16/+31
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]>
2012-10-06score: select generic atomic64_t supportFengguang Wu1-0/+1
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]>
2012-10-06frv: kill used but uninitialized variableGeert Uytterhoeven1-10/+9
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]>
2012-10-06sections: fix const sections for crc32 tableJoe Mario2-6/+9
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]>
2012-10-06sections: fix section conflicts in soundAndi Kleen1-1/+1
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]>
2012-10-06sections: fix section conflicts in netAndi Kleen7-6/+8
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]>
2012-10-06sections: fix section conflicts in net/canAndi Kleen4-4/+4
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]>
2012-10-06sections: fix section conflicts in mm/percpu.cAndi Kleen2-2/+2
Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-10-06sections: fix section conflicts in drivers/videoAndi Kleen5-6/+6
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]>
2012-10-06sections: fix section conflicts in drivers/scsiAndi Kleen2-2/+2
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]>
2012-10-06sections: fix section conflicts in drivers/platform/x86Andi Kleen3-7/+7
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]>