aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-07-30printk: remove the now unnecessary "C" annotation for KERN_CONTJoe Perches2-3/+1
Now that all KERN_<LEVEL> uses are prefixed with ASCII SOH, there is no need for a KERN_CONT. Keep it backward compatible by adding #define KERN_CONT "" Reduces kernel image size a thousand bytes. Signed-off-by: Joe Perches <[email protected]> Cc: Kay Sievers <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30printk: only look for prefix levels in kernel messagesJoe Perches1-15/+17
vprintk_emit() prefix parsing should only be done for internal kernel messages. This allows existing behavior to be kept in all cases. Signed-off-by: Joe Perches <[email protected]> Cc: Kay Sievers <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30printk: convert the format for KERN_<LEVEL> to a 2 byte patternJoe Perches2-13/+16
Instead of "<.>", use an ASCII SOH for the KERN_<LEVEL> prefix initiator. This saves 1 byte per printk, thousands of bytes in a normal kernel. No output changes are produced as vprintk_emit converts these uses to "<.>". Signed-off-by: Joe Perches <[email protected]> Cc: Kay Sievers <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30sound: use printk_get_level and printk_skip_levelJoe Perches1-4/+9
Make the output logging routine independent of the KERN_<LEVEL> style. Signed-off-by: Joe Perches <[email protected]> Cc: Kay Sievers <[email protected]> Cc: Takashi Iwai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30btrfs: use printk_get_level and printk_skip_level, add __printf, fix falloutJoe Perches4-8/+50
Use the generic printk_get_level() to search a message for a kern_level. Add __printf to verify format and arguments. Fix a few messages that had mismatches in format and arguments. Add #ifdef CONFIG_PRINTK blocks to shrink the object size a bit when not using printk. [[email protected]: whitespace tweak] Signed-off-by: Joe Perches <[email protected]> Cc: Kay Sievers <[email protected]> Cc: Chris Mason <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30arch: remove direct definitions of KERN_<LEVEL> usesJoe Perches3-5/+7
Add #include <linux/kern_levels.h> so that the #define KERN_<LEVEL> macros don't have to be duplicated. Signed-off-by: Joe Perches <[email protected]> Cc: Kay Sievers <[email protected]> Cc: Russell King <[email protected]> Cc: Kay Sievers <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30printk: add kern_levels.h to make KERN_<LEVEL> available for asm useJoe Perches2-18/+23
Separate the printk.h file into 2 pieces so the definitions can be used in asm files. Signed-off-by: Joe Perches <[email protected]> Cc: Kay Sievers <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30printk: add generic functions to find KERN_<LEVEL> headersJoe Perches2-5/+35
The current form of a KERN_<LEVEL> is "<.>". Add printk_get_level and printk_skip_level functions to handle these formats. These functions centralize tests of KERN_<LEVEL> so a future modification can change the KERN_<LEVEL> style and shorten the number of bytes consumed by these headers. [[email protected]: fix build error and warning] Signed-off-by: Joe Perches <[email protected]> Cc: Kay Sievers <[email protected]> Cc: Wu Fengguang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30kmsg: /dev/kmsg - properly return possible copy_from_user() failureKay Sievers1-1/+3
Reported-by: Andrew Morton <[email protected]> Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30drivers/misc/ti-st/st_core.c: missing NULL checkAlan Cox1-0/+5
Addresses https://bugzilla.kernel.org/show_bug.cgi?44431 Reported-by: <[email protected]> Signed-off-by: Alan Cox <[email protected]> Cc: Pavan Savoy <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30kernel/sys.c: avoid argv_free(NULL)Andrew Morton1-19/+25
If argv_split() failed, the code will end up calling argv_free(NULL). Fix it up and clean things up a bit. Addresses Coverity report 703573. Cc: Cyrill Gorcunov <[email protected]> Cc: Kees Cook <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: WANG Cong <[email protected]> Cc: Alan Cox <[email protected]> Cc: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30NMI watchdog: fix for lockup detector breakage on resumeSameer Nanda3-2/+30
On the suspend/resume path the boot CPU does not go though an offline->online transition. This breaks the NMI detector post-resume since it depends on PMU state that is lost when the system gets suspended. Fix this by forcing a CPU offline->online transition for the lockup detector on the boot CPU during resume. To provide more context, we enable NMI watchdog on Chrome OS. We have seen several reports of systems freezing up completely which indicated that the NMI watchdog was not firing for some reason. Debugging further, we found a simple way of repro'ing system freezes -- issuing the command 'tasket 1 sh -c "echo nmilockup > /proc/breakme"' after the system has been suspended/resumed one or more times. With this patch in place, the system freeze result in panics, as expected. These panics provide a nice stack trace for us to debug the actual issue causing the freeze. [[email protected]: fiddle with code comment] [[email protected]: make lockup_detector_bootcpu_resume() conditional on CONFIG_SUSPEND] [[email protected]: fix section errors] Signed-off-by: Sameer Nanda <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Don Zickus <[email protected]> Cc: Mandeep Singh Baines <[email protected]> Cc: Srivatsa S. Bhat <[email protected]> Cc: Anshuman Khandual <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30panic: fix a possible deadlock in panic()Vikram Mulukutla1-0/+8
panic_lock is meant to ensure that panic processing takes place only on one cpu; if any of the other cpus encounter a panic, they will spin waiting to be shut down. However, this causes a regression in this scenario: 1. Cpu 0 encounters a panic and acquires the panic_lock and proceeds with the panic processing. 2. There is an interrupt on cpu 0 that also encounters an error condition and invokes panic. 3. This second invocation fails to acquire the panic_lock and enters the infinite while loop in panic_smp_self_stop. Thus all panic processing is stopped, and the cpu is stuck for eternity in the while(1) inside panic_smp_self_stop. To address this, disable local interrupts with local_irq_disable before acquiring the panic_lock. This will prevent interrupt handlers from executing during the panic processing, thus avoiding this particular problem. Signed-off-by: Vikram Mulukutla <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Cc: Michael Holzheu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30avr32: fix build error in ATSTK1002 codeFengguang Wu1-1/+1
Fix the error arch/avr32/boards/atstk1000/atstk1002.c:100: error: 'num_partitions' undeclared here (not in a function) which was introduced by commit 1754aab9bb86 ("mtd: ATMEL, AVR32: inline nand partition table access "). Signed-off-by: Fengguang Wu <[email protected]> Cc: Dmitry Eremin-Solenikov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30clk: validate pointer in __clk_disable()Fengguang Wu1-0/+3
clk_get() returns -ENOENT on error and some careless caller might dereference it without error checking: In mxc_rnga_remove(): struct clk *clk = clk_get(&pdev->dev, "rng"); // ... clk_disable(clk); Since it's insane to audit the lots of existing and future clk users, let's add a check in the callee to avoid kernel panic and warn about any buggy user. Cc: Russell King <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Viresh Kumar <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30arch/arm/mach-netx/fb.c: reuse dummy clk routines for CONFIG_HAVE_CLK=nViresh Kumar1-23/+0
mach-netx had its own implementation of clk routines like, clk_get{put}, clk_enable{disable}, etc. And with introduction of following patchset: https://lkml.org/lkml/2012/4/24/154 we get compilation error for multiple definition of these routines. Sascha had following suggestion to deal with it: http://www.spinics.net/lists/arm-kernel/msg179369.html So, remove this code completely. Signed-off-by: Viresh Kumar <[email protected]> Reported-by: Paul Gortmaker <[email protected]> Acked-by: Sascha Hauer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30usb/host/r8a66597: remove conditional compilation of clk codeViresh Kumar2-17/+0
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. Signed-off-by: Viresh Kumar <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30gadget/r8a66597: remove conditional compilation of clk codeViresh Kumar2-13/+3
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. Signed-off-by: Viresh Kumar <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30gadget/m66592: remove conditional compilation of clk codeViresh Kumar2-13/+1
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. Signed-off-by: Viresh Kumar <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30net/stmmac: remove conditional compilation of clk codeViresh Kumar2-58/+17
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. This also fixes error paths of probe(), as a goto is required in this patch. Signed-off-by: Viresh Kumar <[email protected]> Cc: Giuseppe Cavallaro <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30net/c_can: remove conditional compilation of clk codeViresh Kumar1-8/+0
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. Signed-off-by: Viresh Kumar <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Bhupesh Sharma <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30ata/pata_arasan: remove conditional compilation of clk codeViresh Kumar1-13/+1
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. Signed-off-by: Viresh Kumar <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30usb/musb: remove conditional compilation of clk codeViresh Kumar1-8/+0
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. musb also has these dummy macros defined locally. Remove them as they aren't required anymore. Signed-off-by: Viresh Kumar <[email protected]> Acked-by: Jeff Garzik <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30usb/marvell: remove conditional compilation of clk codeViresh Kumar1-9/+0
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. Marvell usb also has these dummy macros defined locally. Remove them as they aren't required anymore. Signed-off-by: Viresh Kumar <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30i2c/i2c-pxa: remove conditional compilation of clk codeViresh Kumar1-7/+0
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. pxa i2c also has these dummy macros defined locally. Remove them as they aren't required anymore. Signed-off-by: Viresh Kumar <[email protected]> Acked-by: Wolfram Sang <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30clk: remove redundant depends on from drivers/KconfigViresh Kumar1-1/+0
menu "Common Clock Framework" has "depends on COMMON_CLK" and so configs defined within menu don't require these "depends on COMMON_CLK again". Signed-off-by: Viresh Kumar <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Bhupesh Sharma <[email protected]> Cc: Giuseppe Cavallaro <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30clk: add non CONFIG_HAVE_CLK routinesViresh Kumar1-59/+109
Many drivers are shared between architectures that may or may not have HAVE_CLK selected for them. To remove compilation errors for them we enclose clk_*() calls in these drivers within #ifdef CONFIG_HAVE_CLK, #endif. This patch removes the need of these CONFIG_HAVE_CLK statements, by introducing dummy routines when HAVE_CLK is not selected by platforms. So, definition of these routines will always be available. These calls will return error for platforms that don't select HAVE_CLK. Signed-off-by: Viresh Kumar <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Bhupesh Sharma <[email protected]> Cc: Giuseppe Cavallaro <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: viresh kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30avr32/mm/fault.c: port OOM changes to do_page_faultKautuk Consul1-8/+25
Commits d065bd810b6d ("mm: retry page fault when blocking on disk transfer") and 37b23e0525d3 ("x86,mm: make pagefault killable") introduced changes into the x86 pagefault handler for making the page fault handler retryable as well as killable. These changes reduce the mmap_sem hold time, which is crucial during OOM killer invocation. Port these changes to AVR32. [[email protected]: fix comment layout] Signed-off-by: Mohd. Faris <[email protected]> Signed-off-by: Kautuk Consul <[email protected]> Acked-by: Havard Skinnemoen <[email protected]> Cc: Hans-Christian Egtvedt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30alpha: remove mysterious if zero-ed out includesPaul Bolle1-12/+0
There's a small group of odd looking includes in smc37c669.c. These includes appear to be if zero-ed out ever since they were added to the tree (in v2.1.89). Their purpose is unclear to me. Perhaps they were used in someones build system. Whatever their purpose was, nothing else uses something comparable. This entire if zero-ed out block might as well be removed. Signed-off-by: Paul Bolle <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30xtensa/mm/fault.c: port OOM changes to do_page_faultKautuk Consul1-5/+24
Commits d065bd810b6d ("mm: retry page fault when blocking on disk transfer") and 37b23e0525d3 ("x86,mm: make pagefault killable") introduced changes into the x86 pagefault handler for making the page fault handler retryable as well as killable. These changes reduce the mmap_sem hold time, which is crucial during OOM killer invocation. Port these changes to xtensa. Signed-off-by: Kautuk Consul <[email protected]> Acked-by: Chris Zankel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30coredump: warn about unsafe suid_dumpable / core_pattern comboKees Cook3-7/+45
When suid_dumpable=2, detect unsafe core_pattern settings and warn when they are seen. Signed-off-by: Kees Cook <[email protected]> Suggested-by: Andrew Morton <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Alan Cox <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Doug Ledford <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: James Morris <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30fs: make dumpable=2 require fully qualified pathKees Cook2-9/+26
When the suid_dumpable sysctl is set to "2", and there is no core dump pipe defined in the core_pattern sysctl, a local user can cause core files to be written to root-writable directories, potentially with user-controlled content. This means an admin can unknowningly reintroduce a variation of CVE-2006-2451, allowing local users to gain root privileges. $ cat /proc/sys/fs/suid_dumpable 2 $ cat /proc/sys/kernel/core_pattern core $ ulimit -c unlimited $ cd / $ ls -l core ls: cannot access core: No such file or directory $ touch core touch: cannot touch `core': Permission denied $ OHAI="evil-string-here" ping localhost >/dev/null 2>&1 & $ pid=$! $ sleep 1 $ kill -SEGV $pid $ ls -l core -rw------- 1 root kees 458752 Jun 21 11:35 core $ sudo strings core | grep evil OHAI=evil-string-here While cron has been fixed to abort reading a file when there is any parse error, there are still other sensitive directories that will read any file present and skip unparsable lines. Instead of introducing a suid_dumpable=3 mode and breaking all users of mode 2, this only disables the unsafe portion of mode 2 (writing to disk via relative path). Most users of mode 2 (e.g. Chrome OS) already use a core dump pipe handler, so this change will not break them. For the situations where a pipe handler is not defined but mode 2 is still active, crash dumps will only be written to fully qualified paths. If a relative path is defined (e.g. the default "core" pattern), dump attempts will trigger a printk yelling about the lack of a fully qualified path. Signed-off-by: Kees Cook <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Alan Cox <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Doug Ledford <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: James Morris <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30fs/xattr.c:getxattr(): improve handling of allocation failuresSasha Levin1-4/+12
This allocation can be as large as 64k. - Add __GFP_NOWARN so the falied kmalloc() is silent - Fall back to vmalloc() if the kmalloc() failed Signed-off-by: Sasha Levin <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30ntfs: remove references to long gone super operations and unimplemented methodsFernando Luis Vazquez Cao1-17/+0
->delete_inode(), ->write_super_lockfs(), ->unlockfs() are gone so remove refereces to them in the NTFS code. Remove unnecessary comments about unimplemented methods while at it (suggested by Christoph Hellwig). Noticed while cleaning up the fsfreeze mess. Signed-off-by: Fernando Luis Vazquez Cao <[email protected]> Cc: Anton Altaparmakov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30prctl: remove redunant assignment of "error" to zeroSasikantha babu1-11/+2
Just setting the "error" to error number is enough on failure and It doesn't require to set "error" variable to zero in each switch case, since it was already initialized with zero. And also removed return 0 in switch case with break statement Signed-off-by: Sasikantha babu <[email protected]> Acked-by: Kees Cook <[email protected]> Acked-by: Serge E. Hallyn <[email protected]> Cc: Cyrill Gorcunov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30pcdp: use early_ioremap/early_iounmap to access pcdp tableGreg Pearson1-2/+2
efi_setup_pcdp_console() is called during boot to parse the HCDP/PCDP EFI system table and setup an early console for printk output. The routine uses ioremap/iounmap to setup access to the HCDP/PCDP table information. The call to ioremap is happening early in the boot process which leads to a panic on x86_64 systems: panic+0x01ca do_exit+0x043c oops_end+0x00a7 no_context+0x0119 __bad_area_nosemaphore+0x0138 bad_area_nosemaphore+0x000e do_page_fault+0x0321 page_fault+0x0020 reserve_memtype+0x02a1 __ioremap_caller+0x0123 ioremap_nocache+0x0012 efi_setup_pcdp_console+0x002b setup_arch+0x03a9 start_kernel+0x00d4 x86_64_start_reservations+0x012c x86_64_start_kernel+0x00fe This replaces the calls to ioremap/iounmap in efi_setup_pcdp_console() with calls to early_ioremap/early_iounmap which can be called during early boot. This patch was tested on an x86_64 prototype system which uses the HCDP/PCDP table for early console setup. Signed-off-by: Greg Pearson <[email protected]> Acked-by: Khalid Aziz <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30mm: fix wrong argument of migrate_huge_pages() in soft_offline_huge_page()Joonsoo Kim1-3/+3
Commit a6bc32b89922 ("mm: compaction: introduce sync-light migration for use by compaction") changed the declaration of migrate_pages() and migrate_huge_pages(). But it missed changing the argument of migrate_huge_pages() in soft_offline_huge_page(). In this case, we should call migrate_huge_pages() with MIGRATE_SYNC. Additionally, there is a mismatch between type the of argument and the function declaration for migrate_pages(). Signed-off-by: Joonsoo Kim <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Mel Gorman <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: "Aneesh Kumar K.V" <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-30[media] lirc: fix non-ANSI function declaration warningEmil Goode1-1/+1
Sparse is warning about non-ANSI function declaration. Add void to the parameterless function. drivers/staging/media/lirc/lirc_bt829.c:174:22: warning: non-ANSI function declaration of function 'poll_main' Signed-off-by: Emil Goode <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2012-07-30[media] rc: ati_remote.c: code style fixingDu, Changbin1-53/+80
changes: 1. wrap some lines that are longer than 80 characters. 2. remove local function prototype declarations which do not need. 3. replace TAB character with a space character in function comments. Signed-off-by: Du, Changbin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2012-07-30[media] Avoid sysfs oops when an rc_dev's raw device is absentDouglas Bagnall1-2/+3
For some reason, when the lirc daemon learns that a usb remote control has been unplugged, it wants to read the sysfs attributes of the disappearing device. This is useful for uncovering transient inconsistencies, but less so for keeping the system running when such inconsistencies exist. Under some circumstances (like every time I unplug my dvb stick from my laptop), lirc catches an rc_dev whose raw event handler has been removed (presumably by ir_raw_event_unregister), and proceeds to interrogate the raw protocols supported by the NULL pointer. This patch avoids the NULL dereference, and ignores the issue of how this state of affairs came about in the first place. Version 2 incorporates changes recommended by Mauro Carvalho Chehab (-ENODEV instead of -EINVAL, and a signed-off-by). Signed-off-by: Douglas Bagnall <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2012-07-30[media] v4l2-dev.c: Move video_put() after debug printkEzequiel GarcĂ­a1-6/+6
It is possible that video_put() releases video_device struct, provoking a panic when debug printk wants to get video_device node name. Signed-off-by: Ezequiel Garcia <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2012-07-30[media] vivi: fix a few format-related compliance issuesHans Verkuil1-17/+6
This patch will always set the field to INTERLACED (this fixes a bug were a driver should never return FIELD_ANY), and will default to YUYV pixelformat if an unknown pixelformat was specified. This way S/TRY_FMT will always return a valid format struct. Regards, Hans Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2012-07-30[media] drivers/staging/media/easycap/easycap_main.c: add missing usb_free_urbJulia Lawall1-0/+1
Add missing usb_free_urb on failure path after usb_alloc_urb. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @km exists@ local idexpression e; expression e1,e2,e3; type T,T1; identifier f; @@ * e = usb_alloc_urb(...) ... when any when != e = e1 when != e1 = (T)e when != e1(...,(T)e,...) when != &e->f if(...) { ... when != e2(...,(T1)e,...) when != e3 = e when forall ( return <+...e...+>; | * return ...; ) } // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2012-07-31md/raid5: For odirect-write performance, do not set STRIPE_PREREAD_ACTIVE.majianpeng1-1/+1
'sync' writes set both REQ_SYNC and REQ_NOIDLE. O_DIRECT writes set REQ_SYNC but not REQ_NOIDLE. We currently assume that a REQ_SYNC request will not be followed by more requests and so set STRIPE_PREREAD_ACTIVE to expedite the request. This is appropriate for sync requests, but not for O_DIRECT requests. So make the setting of STRIPE_PREREAD_ACTIVE conditional on REQ_NOIDLE rather than REQ_SYNC. This is consistent with the documented meaning of REQ_NOIDLE: __REQ_NOIDLE, /* don't anticipate more IO after this one */ Signed-off-by: Jianpeng Ma <[email protected]> Signed-off-by: NeilBrown <[email protected]>
2012-07-31md/raid1: don't abort a resync on the first badblock.NeilBrown1-1/+4
If a resync of a RAID1 array with 2 devices finds a known bad block one device it will neither read from, or write to, that device for this block offset. So there will be one read_target (The other device) and zero write targets. This condition causes md/raid1 to abort the resync assuming that it has finished - without known bad blocks this would be true. When there are no write targets because of the presence of bad blocks we should only skip over the area covered by the bad block. RAID10 already gets this right, raid1 doesn't. Or didn't. As this can cause a 'sync' to abort early and appear to have succeeded it could lead to some data corruption, so it suitable for -stable. Cc: [email protected] Reported-by: Alexander Lyakas <[email protected]> Signed-off-by: NeilBrown <[email protected]>
2012-07-30[media] az6007: fix incorrect memcpyAlan Cox1-1/+1
Some parts of the C language are subtle and evil. This is one example. Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44041 Reported-by: [email protected] Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2012-07-31md: remove duplicated test on ->openers when calling do_md_stop()NeilBrown1-6/+2
do_md_stop tests mddev->openers while holding ->open_mutex, and fails if this count is too high. So callers do not need to check mddev->openers and doing so isn't very meaningful as they don't hold ->open_mutex so the number could change. So remove the unnecessary tests on mddev->openers. These are not called often enough for there to be any gain in an early test on ->open_mutex to avoid the need for a slightly more costly mutex_lock call. Signed-off-by: NeilBrown <[email protected]>
2012-07-31raid5: Add R5_ReadNoMerge flag which prevent bio from merging at block layermajianpeng2-2/+13
Because bios will merge at block-layer,so bios-error may caused by other bio which be merged into to the same request. Using this flag,it will find exactly error-sector and not do redundant operation like re-write and re-read. V0->V1:Using REQ_FLUSH instead REQ_NOMERGE avoid bio merging at block layer. Signed-off-by: Jianpeng Ma <[email protected]> Signed-off-by: NeilBrown <[email protected]>
2012-07-31md/raid1: prevent merging too large requestShaohua Li2-7/+50
For SSD, if request size exceeds specific value (optimal io size), request size isn't important for bandwidth. In such condition, if making request size bigger will cause some disks idle, the total throughput will actually drop. A good example is doing a readahead in a two-disk raid1 setup. So when should we split big requests? We absolutly don't want to split big request to very small requests. Even in SSD, big request transfer is more efficient. This patch only considers request with size above optimal io size. If all disks are busy, is it worth doing a split? Say optimal io size is 16k, two requests 32k and two disks. We can let each disk run one 32k request, or split the requests to 4 16k requests and each disk runs two. It's hard to say which case is better, depending on hardware. So only consider case where there are idle disks. For readahead, split is always better in this case. And in my test, below patch can improve > 30% thoughput. Hmm, not 100%, because disk isn't 100% busy. Such case can happen not just in readahead, for example, in directio. But I suppose directio usually will have bigger IO depth and make all disks busy, so I ignored it. Note: if the raid uses any hard disk, we don't prevent merging. That will make performace worse. Signed-off-by: Shaohua Li <[email protected]> Signed-off-by: NeilBrown <[email protected]>
2012-07-31md/raid1: read balance chooses idlest disk for SSDShaohua Li1-3/+31
SSD hasn't spindle, distance between requests means nothing. And the original distance based algorithm sometimes can cause severe performance issue for SSD raid. Considering two thread groups, one accesses file A, the other access file B. The first group will access one disk and the second will access the other disk, because requests are near from one group and far between groups. In this case, read balance might keep one disk very busy but the other relative idle. For SSD, we should try best to distribute requests to as many disks as possible. There isn't spindle move penality anyway. With below patch, I can see more than 50% throughput improvement sometimes depending on workloads. The only exception is small requests can be merged to a big request which typically can drive higher throughput for SSD too. Such small requests are sequential reads. Unlike hard disk, sequential read which can't be merged (for example direct IO, or read without readahead) can be ignored for SSD. Again there is no spindle move penality. readahead dispatches small requests and such requests can be merged. Last patch can help detect sequential read well, at least if concurrent read number isn't greater than raid disk number. In that case, distance based algorithm doesn't work well too. V2: For hard disk and SSD mixed raid, doesn't use distance based algorithm for random IO too. This makes the algorithm generic for raid with SSD. Signed-off-by: Shaohua Li <[email protected]> Signed-off-by: NeilBrown <[email protected]>