aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firewire (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2012-05-29perf annotate browser: The idx_asm field should be used in asm only viewArnaldo Carvalho de Melo1-1/+5
When hide_src_view is true we can't use browser_disasm_line->idx, that takes into account also non asm lines, we must use browser_disasm_line->idx_asm instead, otherwise we may end up with an index after the number of entries, oops, fix it. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-o1szpyjh3z87yi0n6x0cr8uu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-29perf tools: Convert critical messages to ui__error()Namhyung Kim4-27/+25
There were places where use ui__warning (or even fprintf) to show critical messages. This patch converts them to ui__error so that the front-end code can implement appropriate behavior. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1338265382-6872-3-git-send-email-namhyung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-28perf ui: Make --stdio default when TUI is not supportedNamhyung Kim1-0/+1
The commit dc41b9b8f02db ("perf ui: Change fallback policy of setup_browser") changed default behavior of the function but missed setting the use_browser variable to 0 accidently. So perf report ends up doing nothing in such cases. Fix it. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1338216802-5675-1-git-send-email-namhyung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-26tools lib traceevent: Silence compiler warning on 32bit buildNamhyung Kim1-1/+1
The gcc complains about casting a pointer to unsigned long long directly: SUBDIR ../lib/traceevent/ CC FPIC event-parse.o CC FPIC trace-seq.o CC FPIC parse-filter.o /home/namhyung/project/linux/tools/lib/traceevent/parse-filter.c: In function ‘get_value’: /home/namhyung/project/linux/tools/lib/traceevent/parse-filter.c:1588: warning: cast from pointer to integer of different size CC FPIC parse-utils.o BUILD STATIC LIB libtraceevent.a Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1338003691-3141-1-git-send-email-namhyung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-25perf record: Fix branch_stack type in perf_record_optsStephane Eranian1-1/+1
The attr.branch_sample_type field is defined as u64 by the API. As such, we need to ensure the variable holding the value of the branch stack filters is also u64 otherwise we may lose bits in the future. Note also that the bogus definition of the field in perf_record_opts caused problems on big-endian PPC systems. Thanks to Anshuman Khandual for tracking the problem on PPC. Reported-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120525211344.GA7729@quad Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-25perf tools: Reconstruct event with modifiers from perf_event_attrArnaldo Carvalho de Melo3-16/+104
The modifiers: k kernel space u user space h hypervisor G guest H host p, pp, ppp precision level (PEBS) that can be suffixed to an event were lost when tools used event_name() to reconstruct them from the perf_event_attr entries in a perf.data file. Fix it by following the defaults used for these modifiers in the current codebase, so: $ perf record -e instructions:u usleep 1 2> /dev/null $ perf evlist instructions:u $ perf record -e cycles:k usleep 1 2> /dev/null $ perf evlist cycles:k $ perf record -e cycles:kh usleep 1 2> /dev/null $ perf evlist cycles:kh $ perf record -e cache-misses:G usleep 1 2> /dev/null $ perf evlist cache-misses:G $ perf record -e cycles:ppk usleep 1 2> /dev/null $ perf evlist cycles:kpp $ Also works with 'top', 'report', etc. More work needed to cover tracepoints and software events while not dragging lots of baggage to the python binding, this is a minimal fix for v3.5. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-4hl5glle0hxlklw4usva1mkt@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-25perf top: Fix counter name fixup when fallbacking to cpu-clockArnaldo Carvalho de Melo1-1/+1
In 40491eaa "perf top: Update event name when falling back to cpu-clock" we freed counter->name but didn't reset it to NULL, then when setting it to the result of event_name(), event_name() would use the cached value, which by now was overwritten and thus we got garbage or a zero lenght string. Fix it by just freeing and setting counter->name to NULL, this way event_name() when called afterwards, will find the right counter name and cache it again. Found while trying 'cycles:pp' on a machine were :pp couldn't be honoured. Probably the best fallback here is to tell the user that that level of precision is not available on the PMU and then go removing 'p', levels of precision till we get to play 'cycles' and if even that fails, _then_ get to 'cpu-clock'. But that is the matter for another patch, this one just needs to fix the caching issue, which in the end will show 'cpu-clock' when tools ask for the event name being used, which clarifies things for the user, that will see that 'cycles:pp' or whatever not support event is not being used, some sort of fallback happened. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-w1neie2dqli89we1bzwkf4id@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-25perf tools: fix thread_map__new_by_pid_str() memory leak in error pathFranck Bui-Huu1-11/+10
The namelist array (including its content) was not freed if we fail to realloc a new 'threads' structure. Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1337952109-31995-1-git-send-email-fbuihuu@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24perf tools: Do not use _FORTIFY_SOURCE when DEBUG=1 is specifiedArnaldo Carvalho de Melo1-2/+2
As: make DEBUG=1 -C tools/perf disables optimizations and _FORTIFY_SOURCE in recent distros requires optimizations to be enabled, seen on a Fedora 17 system: [acme@Fedora17 linux]$ make DEBUG=1 O=/home/acme/git/build/perf/ -C tools/perf install In file included from /usr/include/sys/types.h:26:0, from /usr/include/libelf.h:53, from /usr/include/gelf.h:53, from /usr/include/elfutils/libdw.h:53, from <stdin>:2: /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-4ccyiebqju4uatm31ky7725b@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24tools lib traceevent: Fix signature of create_arg_item()Namhyung Kim1-3/+2
The @type should be a type of enum event_type not enum filter_arg_type. This fixes following warning: $ make COMPILE FPIC parse-events.o COMPILE FPIC parse-filter.o /home/namhyung/project/trace-cmd/parse-filter.c: In function ‘create_arg_item’: /home/namhyung/project/trace-cmd/parse-filter.c:343:9: warning: comparison between ‘enum filter_arg_type’ and ‘enum event_type’ [-Wenum-compare] /home/namhyung/project/trace-cmd/parse-filter.c:339:2: warning: case value ‘8’ not in enumerated type ‘enum filter_arg_type’ [-Wswitch] BUILD STATIC LIB libparsevent.a BUILD STATIC LIB libtracecmd.a BUILD trace-cmd /usr/bin/make -C /home/namhyung/project/trace-cmd/Documentation all make[1]: Nothing to be done for `all'. Note: to build the gui, type "make gui" Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-20-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24tools lib traceevent: Use proper function parameter typeNamhyung Kim1-0/+1
The param needs to be updated when setting args up so that the loop in process_defined_func() can see the correct param->type for the farg. Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-15-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24tools lib traceevent: Fix freeing arg on process_dynamic_array()Namhyung Kim1-3/+4
The @arg paremeter should not be freed inside of process_XXX(), because it'd be freed from the caller of process_arg(). We can free it only after it was reused for local usage. Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-14-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24tools lib traceevent: Fix a possibly wrong memory dereferenceNamhyung Kim1-0/+2
If set_op_prio() failed, the token will be freed at out_free, then arg->op.op would turn out to be a dangle pointer. After returning EVENT_ERROR from process_op(), free_arg() will be called and then it will finally see the dangling pointer. Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-13-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24tools lib traceevent: Fix a possible memory leakNamhyung Kim1-1/+4
If event_read_fields failed in the middle, each member of struct format_field should be freed also. Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-11-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24tools lib traceevent: Allow expressions in __print_symbolic() fieldsStefan Hajnoczi1-0/+7
The __print_symbolic() function takes a sequence of key-value pairs for pretty-printing a constant. The new kvm:kvm_exit print fmt uses the expression: __print_symbolic(..., { 0x040 + 1, "DB excp" }, ...) Currently only atoms are supported and this print fmt fails to parse. This patch adds support for expressions instead of just atoms so that 0x040 + 1 is parsed successfully. Cc: Avi Kivity <avi@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-6-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-23mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkagesMel Gorman1-24/+17
Dave Jones' system call fuzz testing tool "trinity" triggered the following bug error with slab debugging enabled ============================================================================= BUG numa_policy (Not tainted): Poison overwritten ----------------------------------------------------------------------------- INFO: 0xffff880146498250-0xffff880146498250. First byte 0x6a instead of 0x6b INFO: Allocated in mpol_new+0xa3/0x140 age=46310 cpu=6 pid=32154 __slab_alloc+0x3d3/0x445 kmem_cache_alloc+0x29d/0x2b0 mpol_new+0xa3/0x140 sys_mbind+0x142/0x620 system_call_fastpath+0x16/0x1b INFO: Freed in __mpol_put+0x27/0x30 age=46268 cpu=6 pid=32154 __slab_free+0x2e/0x1de kmem_cache_free+0x25a/0x260 __mpol_put+0x27/0x30 remove_vma+0x68/0x90 exit_mmap+0x118/0x140 mmput+0x73/0x110 exit_mm+0x108/0x130 do_exit+0x162/0xb90 do_group_exit+0x4f/0xc0 sys_exit_group+0x17/0x20 system_call_fastpath+0x16/0x1b INFO: Slab 0xffffea0005192600 objects=27 used=27 fp=0x (null) flags=0x20000000004080 INFO: Object 0xffff880146498250 @offset=592 fp=0xffff88014649b9d0 This implied a reference counting bug and the problem happened during mbind(). mbind() applies a new memory policy to a range and uses mbind_range() to merge existing VMAs or split them as necessary. In the event of splits, mpol_dup() will allocate a new struct mempolicy and maintain existing reference counts whose rules are documented in Documentation/vm/numa_memory_policy.txt . The problem occurs with shared memory policies. The vm_op->set_policy increments the reference count if necessary and split_vma() and vma_merge() have already handled the existing reference counts. However, policy_vma() screws it up by replacing an existing vma->vm_policy with one that potentially has the wrong reference count leading to a premature free. This patch removes the damage caused by policy_vma(). With this patch applied Dave's trinity tool runs an mbind test for 5 minutes without error. /proc/slabinfo reported that there are no numa_policy or shared_policy_node objects allocated after the test completed and the shared memory region was deleted. Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Dave Jones <davej@redhat.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Stephen Wilson <wilsons@start.ca> Cc: Christoph Lameter <cl@linux.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: <stable@vger.kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-23perf evlist: Explicititely initialize input_nameArnaldo Carvalho de Melo1-1/+1
It was a global variable, so it was initialized, implicitely, to zero by being placed in the bss. Now it is just a local variable that is then passed to the __cmd_evlist routine, so it must be explicitely set to NULL. The problem manifested on a Fedora 17 system, using: gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC) But not on several other systems, by luck. Reported-by: Ingo Molnar <mingo@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-5e8wolcjs3rgd5i6yi995gfh@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-23ring-buffer: Check for valid buffer before changing sizeSteven Rostedt1-0/+5
On some machines the number of possible CPUS is not the same as the number of CPUs that is on the machine. Ftrace uses possible_cpus to update the tracing structures but the ring buffer only allocates per cpu buffers for online CPUs when they come up. When the wakeup tracer was enabled in such a case, the ftrace code enabled all possible cpu buffers, but the code in ring_buffer_resize() did not check to see if the buffer in question was allocated. Since boot up CPUs did not match possible CPUs it caused the following crash: BUG: unable to handle kernel NULL pointer dereference at 00000020 IP: [<c1097851>] ring_buffer_resize+0x16a/0x28d *pde = 00000000 Oops: 0000 [#1] PREEMPT SMP Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: [last unloaded: scsi_wait_scan] Pid: 1387, comm: bash Not tainted 3.4.0-test+ #13 /DG965MQ EIP: 0060:[<c1097851>] EFLAGS: 00010217 CPU: 0 EIP is at ring_buffer_resize+0x16a/0x28d EAX: f5a14340 EBX: f6026b80 ECX: 00000ff4 EDX: 00000ff3 ESI: 00000000 EDI: 00000002 EBP: f4275ecc ESP: f4275eb0 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 CR0: 80050033 CR2: 00000020 CR3: 34396000 CR4: 000007d0 DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 DR6: ffff0ff0 DR7: 00000400 Process bash (pid: 1387, ti=f4274000 task=f4380cb0 task.ti=f4274000) Stack: c109cf9a f6026b98 00000162 00160f68 00000006 00160f68 00000002 f4275ef0 c109d013 f4275ee8 c123b72a c1c0bf00 c1cc81dc 00000005 f4275f98 00000007 f4275f70 c109d0c7 7700000e 75656b61 00000070 f5e90900 f5c4e198 00000301 Call Trace: [<c109cf9a>] ? tracing_set_tracer+0x115/0x1e9 [<c109d013>] tracing_set_tracer+0x18e/0x1e9 [<c123b72a>] ? _copy_from_user+0x30/0x46 [<c109d0c7>] tracing_set_trace_write+0x59/0x7f [<c10ec01e>] ? fput+0x18/0x1c6 [<c11f8732>] ? security_file_permission+0x27/0x2b [<c10eaacd>] ? rw_verify_area+0xcf/0xf2 [<c10ec01e>] ? fput+0x18/0x1c6 [<c109d06e>] ? tracing_set_tracer+0x1e9/0x1e9 [<c10ead77>] vfs_write+0x8b/0xe3 [<c10ebead>] ? fget_light+0x30/0x81 [<c10eaf54>] sys_write+0x42/0x63 [<c1834fbf>] sysenter_do_call+0x12/0x28 This happens with the latency tracer as the ftrace code updates the saved max buffer via its cpumask and not with a global setting. Adding a check in ring_buffer_resize() to make sure the buffer being resized exists, fixes the problem. Cc: Vaibhav Nagarnaik <vnagarnaik@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-05-23Revert "sched, perf: Use a single callback into the scheduler"Jiri Olsa3-17/+30
This reverts commit cb04ff9ac424 ("sched, perf: Use a single callback into the scheduler"). Before this change was introduced, the process switch worked like this (wrt. to perf event schedule): schedule (prev, next) - schedule out all perf events for prev - switch to next - schedule in all perf events for current (next) After the commit, the process switch looks like: schedule (prev, next) - schedule out all perf events for prev - schedule in all perf events for (next) - switch to next The problem is, that after we schedule perf events in, the pmu is enabled and we can receive events even before we make the switch to next - so "current" still being prev process (event SAMPLE data are filled based on the value of the "current" process). Thats exactly what we see for test__PERF_RECORD test. We receive SAMPLES with PID of the process that our tracee is scheduled from. Discussed with Peter Zijlstra: > Bah!, yeah I guess reverting is the right thing for now. Sad > though. > > So by having the two hooks we have a black-spot between them > where we receive no events at all, this black-spot covers the > hand-over of current and we thus don't receive the 'wrong' > events. > > I rather liked we could do away with both that black-spot and > clean up the code a little, but apparently people rely on it. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: acme@redhat.com Cc: paulus@samba.org Cc: cjashfor@linux.vnet.ibm.com Cc: fweisbec@gmail.com Cc: eranian@google.com Link: http://lkml.kernel.org/r/20120523111302.GC1638@m.brq.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-05-23Documentation/watchdog: Fix the file descriptor leak when no cmdline arg givenDevendra Naga1-0/+11
we start a infinite loop when user gives ./watchdog-test, and when user ctrl + c's the program, we just exit immeadiately with out closing the filedescriptor of the watchdog device. a signal handler is used to do the job of closing the filedescriptor and exiting the program. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23Documentation/watchdog: close the fd when cmdline arg givenDevendra Naga1-3/+6
in the watchdog test code, the ioctl is performed on the watchdog device and just doing exit(0) so we leak a filedescripor. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23Documentation/watchdog: Fix a small typoDevendra Naga1-1/+1
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: s3c2410_wdt: Set timeout to actually achieved timeoutHans de Goede1-1/+1
While rebasing my "watchdog_dev: Let the driver update the timeout field on set_timeout success" patch (before I noticed it was already picked up by Wim), I noticed that the s3c2410_wdt driver may not always have a 1 second resolution, this patch changes s3c2410wdt_set_heartbeat to update the timeout to the actually achieved timeout. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: wm831x: Convert to gpio_request_one()Mark Brown1-10/+3
Use the more modern API. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: via_wdt: depends on PCIRandy Dunlap1-1/+1
via_wdt is a PCI driver so it should depend on PCI so that it will not cause build errors. drivers/watchdog/via_wdt.c:256:1: warning: data definition has no type or storage class drivers/watchdog/via_wdt.c:256:1: warning: type defaults to 'int' in declaration of 'module_pci_driver' drivers/watchdog/via_wdt.c:256:1: warning: parameter names (without types) in function declaration Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: ie6xx_wdt needs io.hRandy Dunlap1-0/+1
Fix build error by including <linux/io.h>: drivers/watchdog/ie6xx_wdt.c:97:2: error: implicit declaration of function 'outb' drivers/watchdog/ie6xx_wdt.c:133:2: error: implicit declaration of function 'outl' drivers/watchdog/ie6xx_wdt.c:161:2: error: implicit declaration of function 'inb' drivers/watchdog/ie6xx_wdt.c:199:3: error: implicit declaration of function 'inl' drivers/watchdog/ie6xx_wdt.c:203:3: error: implicit declaration of function 'inw' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: ie6xx_wdt.c: fix printk format warningRandy Dunlap1-2/+2
Fix printk format warning; use cast to u64 since resource_size_t can be either u32 or u64. drivers/watchdog/ie6xx_wdt.c:261:4: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'resource_size_t' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: Add watchdog driver for Intel Atom E6XXAlexander Stein3-0/+361
Add driver for the watchdog timer built into the Intel Atom E6XX (TunnelCreek) processor. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: it87_wdt: Add support for IT8728F watchdog.Diego Elio Pettenò2-3/+11
This works the same way IT8721F works, but it supports WDT_PWROK (checked on the datasheet). Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: i6300esb: don't depend on X86Michael Olbrich1-1/+1
i6300esb is on of the watchdogs QEMU can emulate. It is also available when emulating ARM. The driver works without problems and is quite useful to test userspace dealing with /dev/watchdog. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: Use module_pci_driverWim Van Sebroeck5-88/+9
This patch converts the PCI watchdog drivers so that they use the module_pci_driver() macro. This makes the code smaller and simpler. Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Cc: Thomas Mingarelli <thomas.mingarelli@hp.com> Cc: Marc Vertes <marc.vertes@sigfox.com>
2012-05-23ktest: Change singular "paranthesis" to plural "parentheses"Jesper Juhl1-1/+1
Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-05-23watchdog: sch311x_wdt.c: Remove RESGENDave Mueller1-34/+5
The SCH311x chip contains 2 watchdogs. One is the watchdog programmable by the runtime register at address 0x65-0x68, the other is the watchdog inside the power on reset generator. This second watchdog has a fixed timeout value of ~1.6 seconds and is configurable only by the RESGEN register. The BIOS normally takes care of the RESGEN watchdog and disables it (at least) before the OS is booted. Unfortunately the sch311x_wdt driver clears bit 0 of the RESGEN register which has the effect that at the latest 1.6 seconds later, a POR is triggered. The attached patch fixes this problem by completely removing any reference to the RESGEN watchdog from the sch311x_wdt driver. Signed-off-by: Dave Mueller <d.mueller@elsoft.ch> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: s3c2410-wdt: Use of_match_ptr().Wim Van Sebroeck1-3/+2
Use of_match_ptr definition for the of_match_table. Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2012-05-23watchdog: Device tree support for pnx4008-wdtRoland Stigge2-0/+23
This patch adds device tree support to pnx4008-wdt.c Signed-off-by: Roland Stigge <stigge@antcom.de> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: ar7_wdt.c: use devm_request_and_ioremapJulia Lawall1-23/+10
Combine request_region and ioremap into devm_request_and_ioremap. This has the effect of fixing a missing iounmap on the failure of clk_get. This also introduces a call to clk_put and clears the vbus_clk variable in the case of failure or device removal. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: remove ixp2000 driverRob Herring3-227/+0
The platform is removed, so there are no users of this driver. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: sp5100_tco.c: quiet sparse noise about using plain integer was NULL pointerH Hartley Sweeten1-1/+1
Pointers should not be compared to plain integers. Quiets the sparse warning: warning: Using plain integer as NULL pointer Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23Guard check in module loader against integer overflowDavid Howells1-1/+2
The check: if (len < hdr->e_shoff + hdr->e_shnum * sizeof(Elf_Shdr)) may not work if there's an overflow in the right-hand side of the condition. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-05-23modpost: use proper kernel style for autogenerated filesGreg Kroah-Hartman1-4/+4
If the kernel build process is creating files automatically, the least it can do is create them in a properly formatted manner. Sure, it's a minor issue, but being consistent is nice. Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Alessio Igor Bogani <abogani@kernel.org> Cc: Tony Lindgren <tony@atomide.com> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-05-23modpost: Stop grab_file() from leaking filedescriptors if fstat() failsJesper Juhl1-3/+6
In case the open() call succeeds but the subsequent fstat() call fails, then we'll return without close()'ing the filedescriptor. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-05-23regmap: Use select .. if to get IRQ_DOMAIN enabledMark Brown2-3/+1
Ensure that we can't get randconfig breakage by doing the IRQ_DOMAIN select automatically. Don't just do the select from REGMAP_IRQ to ensure that the select actually gets noticed. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-22various Kconfig cleanup and old platform build code removalRichard Kuo2-22/+4
Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22hexagon/mm/vm_fault.c: Port OOM changes to do_page_faultKautuk Consul1-5/+17
Commit d065bd810b6deb67d4897a14bfe21f8eb526ba99 (mm: retry page fault when blocking on disk transfer) and commit 37b23e0525d393d48a7d59f870b3bc061a30ccdb (x86,mm: make pagefault killable) The above commits 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 hexagon. Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com> Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22arch/hexagon/kernel/dma.c: make function staticJulia Lawall1-1/+1
This function is only used in the same file, and the other similar functions in this file are also static. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [rkuo@codeaurora.org: adjusted patch to apply to latest] Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22Remove unneeded include of version.h from arch/hexagon/include/asm/spinlock_types.hJesper Juhl1-2/+0
"make versioncheck" points out that arch/hexagon/include/asm/spinlock_types.h does not need to include version.h . A quick look at the file seems to confirm its findings, so here's a patch that removes the include. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22Hexagon: Use resource_size functionThomas Meyer1-4/+2
Use resource_size function on resource object instead of explicit computation. The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22PATA host controller driver for ep93xxRafal Prylowski3-0/+1054
Add PATA host controller driver for ep93xx. Signed-off-by: Rafal Prylowski <prylowski@metasoft.pl> Cc: Joao Ramos <joao.ramos@inov.pt> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ryan Mallon <rmallon@gmail.com> Cc: Sergei Shtylyov <sshtylyov@mvista.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-22[libata] Add " 2GB ATA Flash Disk"/"ADMA428M" to DMA blacklistPrarit Bhargava1-0/+1
A user has several systems with a couple of models of flash disks with IDE connectors. These disks work fine in 2.6.18-ish kernels but corrupt data on new kernels. The difference appears to be with the default I/O method used by the IDE controller driver between the kernels. In the older kernels, the configuration is very conservative and the driver stays in PIO mode. With new kernels, the ata driver (pata_serverworks) attempts to use UDMA/66 which the drive claims to support. This mode, however, does not appear to work in DMA mode. The drive does work correctly and no corruption is seen if the kernel parameter "libata.force=5:pio0,6:pio0" is used to force the driver to use PIO instead of DMA mode. Blacklist these drives. Unfortunately the model name of the drive is very generic, " 2GB ATA Flash Disk", but the revision is specific, "ADMA428M". Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-22ata_generic: Skip is_intel_ider() check when ata_generic=1 is setAndi Kleen1-1/+1
When ata_generic_ide=1 is set don't do the is_intel_ider() magic check. We found at least one box who needed that. Cc: alan@linux.intel.com Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>