aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-03-22init: return proper error code in do_mounts_rd()Davidlohr Bueso1-1/+1
In do_mounts_rd() if memory cannot be allocated, return -ENOMEM. Signed-off-by: Davidlohr Bueso <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22binfmt_elf: quiet GCC-4.6 'set but not used' warning in load_elf_binary()David Daney1-1/+1
With GCC-4.6 we get warnings about things being 'set but not used'. In load_elf_binary() this can happen with reloc_func_desc if ELF_PLAT_INIT is defined, but doesn't use the reloc_func_desc argument. Quiet the warning/error by marking reloc_func_desc as __maybe_unused. Signed-off-by: David Daney <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22epoll: fix compiler warning and optimize the non-blocking pathShawn Bohrer1-5/+28
Add a comment to ep_poll(), rename labels a bit clearly, fix a warning of unused variable from gcc and optimize the non-blocking path a little. Hinted-by: Andrew Morton <[email protected]> Signed-off-by: Davide Libenzi <[email protected]> [email protected]: : The non-blocking ep_poll path optimization introduced skipping over the : return value setup. : : Initialize it properly, my userspace gets upset by epoll_wait() returning : random things. : : In addition, remove the reinitialization at the fetch_events label, the : return value is garuanteed to be zero when execution reaches there. [[email protected]: fix initialization] Signed-off-by: Johannes Weiner <[email protected]> Cc: Shawn Bohrer <[email protected]> Acked-by: Davide Libenzi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22epoll: move ready event check into proper inlineDavide Libenzi1-3/+16
Move the event readiness check into a proper inline, and use it uniformly inside ep_poll() code. Events in the ->ovflist are no less ready than the ones in ->rdllist. Signed-off-by: Davide Libenzi <[email protected]> Cc: Shawn Bohrer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22crc32: add missed brackets in macroKonstantin Khlebnikov1-1/+1
Add brackets around typecasted argument in crc32() macro. Signed-off-by: Konstantin Khlebnikov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22checkpatch: warn about memset with swapped argumentsDave Jones1-0/+5
Because the second and third arguments of memset have the same type, it turns out to be really easy to mix them up. This bug comes up time after time, so checkpatch should really be checking for it at patch submission time. Signed-off-by: Dave Jones <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22scripts/checkpatch.pl: reset rpt_cleaners warningsMike Frysinger1-0/+1
If you run checkpatch against multiple patches, and one of them has a whitespace issue which can be helped via a script (rpt_cleaners), you will see the same NOTE over and over for all subsequent patches. It makes it seem like those patches also have whitespace problems when in reality, there's only one or two bad apples. So reset rpt_cleaners back to 0 after we've issued the note so that it only shows up near the patch with the actual problems. Signed-off-by: Mike Frysinger <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22drivers/mmc/host/omap_hsmmc.c: use resource_size()Chris Ball1-4/+3
Use resource_size(). Signed-off-by: Chris Ball <[email protected]> Cc: Madhusudhan Chikkature <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22drivers/mmc/host/omap.c: use resource_size()Chris Ball1-3/+3
Signed-off-by: Chris Ball <[email protected]> Cc: Jarkko Lavinen <[email protected]> Cc: Tony Lindgren <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22sigma-firmware: loader for Analog Devices' SigmaStudioMike Frysinger4-0/+188
Analog Devices' SigmaStudio can produce firmware blobs for devices with these DSPs embedded (like some audio codecs). Allow these device drivers to easily parse and load them. Signed-off-by: Mike Frysinger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22kstrto*: converting strings to integers done (hopefully) rightAlexey Dobriyan8-150/+1039
1. simple_strto*() do not contain overflow checks and crufty, libc way to indicate failure. 2. strict_strto*() also do not have overflow checks but the name and comments pretend they do. 3. Both families have only "long long" and "long" variants, but users want strtou8() 4. Both "simple" and "strict" prefixes are wrong: Simple doesn't exactly say what's so simple, strict should not exist because conversion should be strict by default. The solution is to use "k" prefix and add convertors for more types. Enter kstrtoull() kstrtoll() kstrtoul() kstrtol() kstrtouint() kstrtoint() kstrtou64() kstrtos64() kstrtou32() kstrtos32() kstrtou16() kstrtos16() kstrtou8() kstrtos8() Include runtime testsuite (somewhat incomplete) as well. strict_strto*() become deprecated, stubbed to kstrto*() and eventually will be removed altogether. Use kstrto*() in code today! Note: on some archs _kstrtoul() and _kstrtol() are left in tree, even if they'll be unused at runtime. This is temporarily solution, because I don't want to hardcode list of archs where these functions aren't needed. Current solution with sizeof() and __alignof__ at least always works. Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: add drivers/platform/msm to MSM subsystemKenneth Heitke1-0/+1
Signed-off-by: Kenneth Heitke <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: update WINBOND CIR patternJoe Perches1-1/+1
commit 5b2e303f6df ("[media] rc-core: convert winbond-cir") moved the files, update the pattern. Signed-off-by: Joe Perches <[email protected]> Acked-by: David Härdeman <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: uSB SE401 moved to staging, update patternJoe Perches1-3/+2
And set the status to Orphan. Signed-off-by: Joe Perches <[email protected]> Cc: Jeroen Vreeken <[email protected]> Cc: Hans Verkuil <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: update SFI patternJoe Perches1-1/+1
commit 937f961a653 ("x86: Move sfi to platform") moved the files, update the pattern. Signed-off-by: Joe Perches <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: remove SHARP LH7A40X sectionJoe Perches1-11/+0
commit 82e6923e186 ("ARM: lh7a40x: remove unmaintained platform support") removed support, remove it from MAINTAINERS. Signed-off-by: Joe Perches <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: update SCX200 file patternJoe Perches1-1/+1
commit 3b3da9d25ae ("x86: Move scx200 to platform") moved it, convert the pattern too. Signed-off-by: Joe Perches <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: remove unused TIMEKEEPING timekeeping.hJoe Perches1-1/+0
Commit 88606e80da0 ("MAINTAINERS: Update timer related entries") added a file pattern that didn't actually exist. Signed-off-by: Joe Perches <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: remove IEEE1394 entryJoe Perches1-9/+0
commit 66fa12c571d ("ieee1394: remove the old IEEE 1394 driver stack") removed the code, remove the MAINTAINERS entry. Signed-off-by: Joe Perches <[email protected]> Cc: Stefan Richter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: update media pathJoe Perches1-2/+1
Commit 52b661449ae ("[media] rc: Rename remote controller type to rc_type instead of ir_type") moved it around. Signed-off-by: Joe Perches <[email protected]> Cc: Maxim Levitsky <[email protected]> Acked-by: Harry Wei <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: update clkdev locationJoe Perches1-1/+1
Commit 6d803ba736a ("ARM: 6483/1: arm & sh: factorised duplicated clkdev.c") moved it to a separate directory. Signed-off-by: Joe Perches <[email protected]> Cc: Russell King <[email protected]> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: remove unnecessary [email protected] entriesJoe Perches1-5/+0
CC'ing lkml is the default and doesn't need separate entries. Signed-off-by: Joe Perches <[email protected]> Acked-by: Harry Wei <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: add missing : after HR Timers F tagJoe Perches1-1/+1
Signed-off-by: Joe Perches <[email protected]> Acked-by: Harry Wei <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: remove ASOC CODEC DRIVERS files not in treeJoe Perches1-2/+0
Remove these patterns until such files are actually in the tree. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: change web links from wiki-analog to wiki.analogJoe Perches1-10/+10
wiki-analog doesn't seem to work, but wiki.analog does. Signed-off-by: Joe Perches <[email protected]> Cc: Mike Frysinger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: update ADP5520 patternJoe Perches1-1/+1
Typo in path. Signed-off-by: Joe Perches <[email protected]> Acked-by: Michael Hennerich <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: quote non-alphanumeric email addressesJoe Perches1-5/+5
Add quotes around email address with periods and commas. So they don't explode when pasted into certain email clients. Signed-off-by: Joe Perches <[email protected]> Acked-by: Harry Wei <[email protected]> Cc: "Mark F. Brown" <[email protected]> Cc: "Gustavo F. Padovan" <[email protected]> Cc: "Stephen M. Cameron" <[email protected]> Cc: "Lee, Chun-Yi" <[email protected]> Acked-by: Harry Wei <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22MAINTAINERS: add topgit for T:Harry Wei1-1/+1
At least one tree: ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) is available via topgit. Add mention of topgit in the MAINTAINERS description section. Signed-off-by: Harry Wei <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22get_maintainer.pl: allow "K:" pattern tests to match non-patch textJoe Perches1-1/+10
Extend the usage of the K section in the MAINTAINERS file to support matching regular expressions to any arbitrary text that may precede the patch itself. For example, the commit message or mail headers generated by git-format-patch. Signed-off-by: Joe Perches <[email protected]> Original-patch-by: L. Alberto Giménez <[email protected]> Acked-by: L. Alberto Giménez <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22printk: allow setting DEFAULT_MESSAGE_LEVEL via KconfigMandeep Singh Baines2-1/+12
We've been burned by regressions/bugs which we later realized could have been triaged quicker if only we'd paid closer attention to dmesg. To make it easier to audit dmesg, we'd like to make DEFAULT_MESSAGE_LEVEL Kconfig-settable. That way we can set it to KERN_NOTICE and audit any messages <= KERN_WARNING. Signed-off-by: Mandeep Singh Baines <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Joe Perches <[email protected]> Cc: Olof Johansson <[email protected]> Cc: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22printk: use %pK for /proc/kallsyms and /proc/modulesKees Cook3-9/+7
In an effort to reduce kernel address leaks that might be used to help target kernel privilege escalation exploits, this patch uses %pK when displaying addresses in /proc/kallsyms, /proc/modules, and /sys/module/*/sections/*. Note that this changes %x to %p, so some legitimately 0 values in /proc/kallsyms would have changed from 00000000 to "(null)". To avoid this, "(null)" is not used when using the "K" format. Anything that was already successfully parsing "(null)" in addition to full hex digits should have no problem with this change. (Thanks to Joe Perches for the suggestion.) Due to the %x to %p, "void *" casts are needed since these addresses are already "unsigned long" everywhere internally, due to their starting life as ELF section offsets. Signed-off-by: Kees Cook <[email protected]> Cc: Eugene Teo <[email protected]> Cc: Dan Rosenberg <[email protected]> Cc: Rusty Russell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22console: prevent registered consoles from dumping old kernel message over againFeng Tang1-0/+18
For a platform with many consoles like: "console=tty1 console=ttyMFD2 console=ttyS0 earlyprintk=mrst" Each time when the non "selected_console" (tty1 and ttyMFD2 here) get registered, the existing kernel message will be printed out on registered consoles again, the "mrst" early console will get some same message for 3 times, and "tty1" will get some for twice. As suggested by Andrew Morton, every time a new console is registered, it will be set as the "exclusive" console which will dump the already existing kernel messages. Signed-off-by: Feng Tang <[email protected]> Cc: Greg KH <[email protected]> Cc: Alan Cox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22console: allow to retain boot console via boot option keep_bootconFabio M. Di Nitto2-1/+21
On some architectures, the boot process involves de-registering the boot console (early boot), initialize drivers and then re-register the console. This mechanism introduces a window in which no printk can happen on the console and messages are buffered and then printed once the new console is available. If a kernel crashes during this window, all it's left on the boot console is "console [foo] enabled, bootconsole disabled" making debug of the crash rather 'interesting'. By adding "keep_bootcon" option, do not unregister the boot console, that will allow to printk everything that is happening up to the crash. The option is clearly meant only for debugging purposes as it introduces lots of duplicated info printed on console, but will make bug report from users easier as it doesn't require a kernel build just to figure out where we crash. Signed-off-by: Fabio M. Di Nitto <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Alan Cox <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22vsprintf: neaten %pK kptr_restrict, save a bit of code spaceJoe Perches1-9/+5
If kptr restrictions are on, just set the passed pointer to NULL. $ size lib/vsprintf.o.* text data bss dec hex filename 8247 4 2 8253 203d lib/vsprintf.o.new 8282 4 2 8288 2060 lib/vsprintf.o.old Signed-off-by: Joe Perches <[email protected]> Cc: Dan Rosenberg <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22drivers/dca/dca-core.c: use list_move() instead of list_del()/list_add() ↵Kirill A. Shutemov1-4/+2
combination Signed-off-by: Kirill A. Shutemov <[email protected]> Cc: Maciej Sosnowski <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22kernel/watchdog.c: always return NOTIFY_OK during cpu up/down eventsDon Zickus1-6/+16
This patch addresses a couple of problems. One was the case when the hardlockup failed to start, it also failed to start the softlockup. There were valid cases when the hardlockup shouldn't start and that shouldn't block the softlockup (no lapic, bios controls perf counters). The second problem was when the hardlockup failed to start on boxes (from a no lapic or bios controlled perf counter case), it reported failure to the cpu notifier chain. This blocked the notifier from continuing to start other more critical pieces of cpu bring-up (in our case based on a 2.6.32 fork, it was the mce). As a result, during soft cpu online/offline testing, the system would panic when a cpu was offlined because the cpu notifier would succeed in processing a watchdog disable cpu event and would panic in the mce case as a result of un-initialized variables from a never executed cpu up event. I realized the hardlockup/softlockup cases are really just debugging aids and should never impede the progress of a cpu up/down event. Therefore I modified the code to always return NOTIFY_OK and instead rely on printks to inform the user of problems. Signed-off-by: Don Zickus <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Reviewed-by: WANG Cong <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22kernel/watchdog.c: allow hardlockup to panic by defaultDon Zickus3-3/+24
When a cpu is considered stuck, instead of limping along and just printing a warning, it is sometimes preferred to just panic, let kdump capture the vmcore and reboot. This gets the machine back into a stable state quickly while saving the info that got it into a stuck state to begin with. Add a Kconfig option to allow users to set the hardlockup to panic by default. Also add in a 'nmi_watchdog=nopanic' to override this. [[email protected]: fix strncmp length] Signed-off-by: Don Zickus <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Reviewed-by: WANG Cong <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22calibrate: retry with wider bounds when converge seems to failPhil Carmody1-4/+18
Systems with unmaskable interrupts such as SMIs may massively underestimate loops_per_jiffy, and fail to converge anywhere near the real value. A case seen on x86_64 was an initial estimate of 256<<12, which converged to 511<<12 where the real value should have been over 630<<12. This admitedly requires bypassing the TSC calibration (lpj_fine), and a failure to settle in the direct calibration too, but is physically possible. This failure does not depend on my previous calibration optimisation, but by luck is easy to fix with the optimisation in place with a trivial retry loop. In the context of the optimised converging method, as we can no longer trust the starting estimate, enlarge the search bounds exponentially so that the number of retries is logarithmically bounded. [[email protected]: mention x86_64 SMIs in comment] Signed-off-by: Phil Carmody <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Tested-by: Stephen Boyd <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22calibrate: home in on correct lpj value more quicklyPhil Carmody1-23/+34
Binary chop with a jiffy-resync on each step to find an upper bound is slow, so just race in a tight-ish loop to find an underestimate. If done with lots of individual steps, sometimes several hundreds of iterations would be required, which would impose a significant overhead, and make the initial estimate very low. By taking slowly increasing steps there will be less overhead. E.g. an x86_64 2.67GHz could have fitted in 613 individual small delays, but in reality should have been able to fit in a single delay 644 times longer, so underestimated by 31 steps. To reach the equivalent of 644 small delays with the accelerating scheme now requires about 130 iterations, so has <1/4th of the overhead, and can therefore be expected to underestimate by only 7 steps. As now we have a better initial estimate we can binary chop over a smaller range. With the loop overhead in the initial estimate kept low, and the step sizes moderate, we won't have under-estimated by much, so chose as tight a range as we can. Signed-off-by: Phil Carmody <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Tested-by: Stephen Boyd <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22calibrate: extract fall-back calculation into own helperPhil Carmody1-33/+40
The motivation for this patch series is that currently our OMAP calibrates itself using the trial-and-error binary chop fallback that some other architectures no longer need to perform. This is a lengthy process, taking 0.2s in an environment where boot time is of great interest. Patch 2/4 has two optimisations. Firstly, it replaces the initial repeated- doubling to find the relevant power of 2 with a tight loop that just does as much as it can in a jiffy. Secondly, it doesn't binary chop over an entire power of 2 range, it choses a much smaller range based on how much it squeezed in, and failed to squeeze in, during the first stage. Both are significant optimisations, and bring our calibration down from 23 jiffies to 5, and, in the process, often arrive at a more accurate lpj value. The 'bands' and 'sub-logarithmic' growth may look over-engineered, but they only cost a small level of inaccuracy in the initial guess (for all architectures) in order to avoid the very large inaccuracies that appeared during testing (on x86_64 architectures, and presumably others with less metronomic operation). Note that due to the existence of the TSC and other timers, the x86_64 will not typically use this fallback routine, but I wanted to code defensively, able to cope with all kinds of processor behaviours and kernel command line options. Patch 3/4 is an additional trap for the nightmare scenario where the initial estimate is very inaccurate, possibly due to things like SMIs. It simply retries with a larger bound. Stephen said: I tried this patch set out on an MSM7630. : : Before: : : Calibrating delay loop... 681.57 BogoMIPS (lpj=3407872) : : After: : : Calibrating delay loop... 680.75 BogoMIPS (lpj=3403776) : : But the really good news is calibration time dropped from ~247ms to ~56ms. : Sadly we won't be able to benefit from this should my udelay patches make : it into ARM because we would be using calibrate_delay_direct() instead (at : least on machines who choose to). Can we somehow reapply the logic behind : this to calibrate_delay_direct()? That would be even better, but this is : definitely a boot time improvement. : : Or maybe we could just replace calibrate_delay_direct() with this fallback : calculation? If __delay() is a thin wrapper around read_current_timer() : it should work just as well (plus patch 3 makes it handle SMIs). I'll try : that out. This patch: ... so that it can be modified more clinically. This is almost entirely cosmetic. The only change to the operation is that the global variable is only set once after the estimation is completed, rather than taking on all the intermediate values. However, there are no readers of that variable, so this change is unimportant. Signed-off-by: Phil Carmody <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Tested-by: Stephen Boyd <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22sys_unshare: remove the dead CLONE_THREAD/SIGHAND/VM codeOleg Nesterov1-98/+25
Cleanup: kill the dead code which does nothing but complicates the code and confuses the reader. sys_unshare(CLONE_THREAD/SIGHAND/VM) is not really implemented, and I doubt very much it will ever work. At least, nobody even tried since the original 99d1419d96d7df9cfa56 ("unshare system call -v5: system call handler function") was applied more than 4 years ago. And the code is not consistent. unshare_thread() always fails unconditionally, while unshare_sighand() and unshare_vm() pretend to work if there is nothing to unshare. Remove unshare_thread(), unshare_sighand(), unshare_vm() helpers and related variables and add a simple CLONE_THREAD | CLONE_SIGHAND| CLONE_VM check into check_unshare_flags(). Also, move the "CLONE_NEWNS needs CLONE_FS" check from check_unshare_flags() to sys_unshare(). This looks more consistent and matches the similar do_sysvsem check in sys_unshare(). Note: with or without this patch "atomic_read(mm->mm_users) > 1" can give a false positive due to get_task_mm(). Signed-off-by: Oleg Nesterov <[email protected]> Acked-by: Roland McGrath <[email protected]> Cc: Janak Desai <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Alexey Dobriyan <[email protected]> Acked-by: Serge Hallyn <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22kernel/cpu.c: fix many errors related to style.Michael Rodriguez1-6/+5
Change the printk() calls to have the KERN_INFO/KERN_ERROR stuff, and fixes other coding style errors. Not _all_ of them are gone, though. [[email protected]: revert the bits I disagree with] Signed-off-by: Michael Rodriguez <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22smp: move smp setup functions to kernel/smp.cAmerigo Wang3-89/+84
Move setup_nr_cpu_ids(), smp_init() and some other SMP boot parameter setup functions from init/main.c to kenrel/smp.c, saves some #ifdef CONFIG_SMP. Signed-off-by: WANG Cong <[email protected]> Cc: Rakib Mullick <[email protected]> Cc: David Howells <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Akinobu Mita <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22include/linux/err.h: add a function to cast error-pointers to a return valueUwe Kleine-König1-0/+8
PTR_RET() can be used if you have an error-pointer and are only interested in the eventual error value, but not the pointer. Yields the usual 0 for no error, -ESOMETHING otherwise. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22move x86 specific oops=panic to generic codeOlaf Hering4-15/+15
The oops=panic cmdline option is not x86 specific, move it to generic code. Update documentation. Signed-off-by: Olaf Hering <[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]>
2011-03-22drivers/misc/pch_phub.c: add MODULE_DEVICE_TABLEAxel Lin1-0/+1
The device table is required to load modules based on modaliases. Signed-off-by: Axel Lin <[email protected]> Cc: Masayuki Ohtak <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22drivers/misc/ep93xx_pwm.c: world-writable sysfs filesVasiliy Kulikov1-3/+3
Don't allow everybody to change device settings. Signed-off-by: Vasiliy Kulikov <[email protected]> Acked-by: Hartley Sweeten <[email protected]> Cc: Matthieu Crapet <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22drivers/misc/atmel_tclib.c: fix a memory leakAxel Lin1-2/+2
request_mem_region() will call kzalloc to allocate memory for struct resource. release_resource() unregisters the resource but does not free the allocated memory, thus use release_mem_region() instead to fix the memory leak. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22drivers/misc/hmc6352.c: fix wrong return value checking for i2c_master_recv()Axel Lin1-2/+2
i2c_master_recv() returns negative errno, or else the number of bytes read. Thus i2c_master_recv(client, i2c_data, 2) returns 2 instead of 1 in success case. [[email protected]: make `ret' signed] Signed-off-by: Axel Lin <[email protected]> Cc: Kalhan Trisal <[email protected]> Cc: Alan Cox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22drivers/misc/apds9802als.c: put the device into runtime suspend after ↵Hong Liu1-7/+10
resume()/probe() is handled Put the device into runtime suspend after resume()/probe() is handled by the PM core and the device core code. No need to manually add them in each single driver. And correct the runtime state in remove(). Signed-off-by: Hong Liu <[email protected]> Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>