Steven Rostedt [Tue, 3 Mar 2009 01:56:48 +0000 (20:56 -0500)]
ring-buffer: reset write field for ring_buffer_read_page
Impact: fix ring_buffer_read_page
After a page is swapped into the ring buffer, the write field must
also be reset.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Tue, 3 Mar 2009 14:43:50 +0000 (09:43 -0500)]
tracing: fix return value to registering events
The registering of events had the return value check backwards.
A zero returned is success, the check had it as a failure.
This patch also fixes a missing "\n" in the warning that the check
failed.
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Uwe Kleine-Koenig [Fri, 27 Feb 2009 20:30:03 +0000 (21:30 +0100)]
tracing: make CALLER_ADDRx overwriteable
The current definition of CALLER_ADDRx isn't suitable for all platforms.
E.g. for ARM __builtin_return_address(N) doesn't work for N > 0 and
AFAIK for powerpc there are no frame pointers needed to have a working
__builtin_return_address. This patch allows defining the CALLER_ADDRx
macros in <asm/ftrace.h> and let these take precedence.
Because now <asm/ftrace.h> is included unconditionally in
<linux/ftrace.h> all archs that don't already had this include get an
empty one for free.
Signed-off-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Mon, 2 Mar 2009 20:22:21 +0000 (15:22 -0500)]
tracing: add print format to event trace format files
This patch adds the internal print format used to print the raw events
to the event trace point format file.
# cat /debug/tracing/events/sched/sched_switch/format
name: sched_switch
ID: 29
format:
field:unsigned char type; offset:0; size:1;
field:unsigned char flags; offset:1; size:1;
field:unsigned char preempt_count; offset:2; size:1;
field:int pid; offset:4; size:4;
field:int tgid; offset:8; size:4;
field:pid_t prev_pid; offset:12; size:4;
field:int prev_prio; offset:16; size:4;
field special:char next_comm[TASK_COMM_LEN]; offset:20; size:16;
field:pid_t next_pid; offset:36; size:4;
field:int next_prio; offset:40; size:4;
print fmt: "prev %d:%d ==> next %s:%d:%d"
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Mon, 2 Mar 2009 20:10:02 +0000 (15:10 -0500)]
tracing: add trace name and id to event formats
To be able to identify the trace in the binary format output, the
id of the trace event (which is dynamically assigned) must also be listed.
This patch adds the name of the trace point as well as the id assigned.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Mon, 2 Mar 2009 20:03:01 +0000 (15:03 -0500)]
tracing: add ftrace headers to event format files
This patch includes the ftrace header to the event formats files:
# cat /debug/tracing/events/sched/sched_switch/format
field:unsigned char type; offset:0; size:1;
field:unsigned char flags; offset:1; size:1;
field:unsigned char preempt_count; offset:2; size:1;
field:int pid; offset:4; size:4;
field:int tgid; offset:8; size:4;
field:pid_t prev_pid; offset:12; size:4;
field:int prev_prio; offset:16; size:4;
field special:char next_comm[TASK_COMM_LEN]; offset:20; size:16;
field:pid_t next_pid; offset:36; size:4;
field:int next_prio; offset:40; size:4;
A blank line is used as a deliminator between the ftrace header and the
trace point fields.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Mon, 2 Mar 2009 18:53:59 +0000 (13:53 -0500)]
tracing: add format file to describe event struct fields
This patch adds the "format" file to the trace point event directory.
This is based off of work by Tom Zanussi, in which a file is exported
to be tread from user land such that a user space app may read the
binary record stored in the ring buffer.
# cat /debug/tracing/events/sched/sched_switch/format
field:pid_t prev_pid; offset:12; size:4;
field:int prev_prio; offset:16; size:4;
field special:char next_comm[TASK_COMM_LEN]; offset:20; size:16;
field:pid_t next_pid; offset:36; size:4;
field:int next_prio; offset:40; size:4;
Idea-from: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Mon, 2 Mar 2009 19:04:40 +0000 (14:04 -0500)]
tracing: make trace_seq_reset global and rename to trace_seq_init
Impact: clean up
The trace_seq functions may be used separately outside of the ftrace
iterator. The trace_seq_reset is needed for these operations.
This patch also renames trace_seq_reset to the more appropriate
trace_seq_init.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Mon, 2 Mar 2009 16:49:04 +0000 (11:49 -0500)]
tracing: add protection around modify trace event fields
The trace event objects are currently not proctected against
reentrancy. This patch adds a mutex around the modifications of
the trace event fields.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Mon, 2 Mar 2009 15:53:15 +0000 (10:53 -0500)]
tracing: add TRACE_FIELD_SPECIAL to record complex entries
Tom Zanussi pointed out that the simple TRACE_FIELD was not enough to
record trace data that required memcpy. This patch addresses this issue
by adding a TRACE_FIELD_SPECIAL. The format is similar to TRACE_FIELD
but looks like so:
TRACE_FIELD_SPECIAL(type_item, item, cmd)
What TRACE_FIELD gave was:
TRACE_FIELD(type, item, assign)
The TRACE_FIELD would be used in declaring a structure:
struct {
type item;
};
And later assign it via:
entry->item = assign;
What TRACE_FIELD_SPECIAL gives us is:
In the declaration of the structure:
struct {
type_item;
};
And the assignment:
cmd;
This change log will explain the one example used in the patch:
TRACE_EVENT_FORMAT(sched_switch,
TPPROTO(struct rq *rq, struct task_struct *prev,
struct task_struct *next),
TPARGS(rq, prev, next),
TPFMT("task %s:%d ==> %s:%d",
prev->comm, prev->pid, next->comm, next->pid),
TRACE_STRUCT(
TRACE_FIELD(pid_t, prev_pid, prev->pid)
TRACE_FIELD(int, prev_prio, prev->prio)
TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
next_comm,
TPCMD(memcpy(TRACE_ENTRY->next_comm,
next->comm,
TASK_COMM_LEN)))
TRACE_FIELD(pid_t, next_pid, next->pid)
TRACE_FIELD(int, next_prio, next->prio)
),
TPRAWFMT("prev %d:%d ==> next %s:%d:%d")
);
The struct will be create as:
struct {
pid_t prev_pid;
int prev_prio;
char next_comm[TASK_COMM_LEN];
pid_t next_pid;
int next_prio;
};
Note the TRACE_ENTRY in the cmd part of TRACE_SPECIAL. TRACE_ENTRY will
be set by the tracer to point to the structure inside the trace buffer.
entry->prev_pid = prev->pid;
entry->prev_prio = prev->prio;
memcpy(entry->next_comm, next->comm, TASK_COMM_LEN);
entry->next_pid = next->pid;
entry->next_prio = next->prio
Reported-by: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 07:54:39 +0000 (02:54 -0500)]
tracing: create the C style tracing for the irq subsystem
This patch utilizes the TRACE_EVENT_FORMAT macro to enable the C style
faster tracing for the irq subsystem trace points.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 07:47:59 +0000 (02:47 -0500)]
tracing: create the C style tracing for the sched subsystem
This patch utilizes the TRACE_EVENT_FORMAT macro to enable the C style
faster tracing for the sched subsystem trace points.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 07:41:25 +0000 (02:41 -0500)]
tracing: add raw fast tracing interface for trace events
This patch adds the interface to enable the C style trace points.
In the directory /debugfs/tracing/events/subsystem/event
We now have three files:
enable : values 0 or 1 to enable or disable the trace event.
available_types: values 'raw' and 'printf' which indicate the tracing
types available for the trace point. If a developer does not
use the TRACE_EVENT_FORMAT macro and just uses the TRACE_FORMAT
macro, then only 'printf' will be available. This file is
read only.
type: values 'raw' or 'printf'. This indicates which type of tracing
is active for that trace point. 'printf' is the default and
if 'raw' is not available, this file is read only.
# echo raw > /debug/tracing/events/sched/sched_wakeup/type
# echo 1 > /debug/tracing/events/sched/sched_wakeup/enable
Will enable the C style tracing for the sched_wakeup trace point.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 00:12:30 +0000 (19:12 -0500)]
tracing: add raw trace point recording infrastructure
Impact: lower overhead tracing
The current event tracer can automatically pick up trace points
that are registered with the TRACE_FORMAT macro. But it required
a printf format string and parsing. Although, this adds the ability
to get guaranteed information like task names and such, it took
a hit in overhead processing. This processing can add about 500-1000
nanoseconds overhead, but in some cases that too is considered
too much and we want to shave off as much from this overhead as
possible.
Tom Zanussi recently posted tracing patches to lkml that are based
on a nice idea about capturing the data via C structs using
STRUCT_ENTER, STRUCT_EXIT type of macros.
I liked that method very much, but did not like the implementation
that required a developer to add data/code in several disjoint
locations.
This patch extends the event_tracer macros to do a similar "raw C"
approach that Tom Zanussi did. But instead of having the developers
needing to tweak a bunch of code all over the place, they can do it
all in one macro - preferably placed near the code that it is
tracing. That makes it much more likely that tracepoints will be
maintained on an ongoing basis by the code they modify.
The new macro TRACE_EVENT_FORMAT is created for this approach. (Note,
a developer may still utilize the more low level DECLARE_TRACE macros
if they don't care about getting their traces automatically in the event
tracer.)
They can also use the existing TRACE_FORMAT if they don't need to code
the tracepoint in C, but just want to use the convenience of printf.
So if the developer wants to "hardwire" a tracepoint in the fastest
possible way, and wants to acquire their data via a user space utility
in a raw binary format, or wants to see it in the trace output but not
sacrifice any performance, then they can implement the faster but
more complex TRACE_EVENT_FORMAT macro.
Here's what usage looks like:
TRACE_EVENT_FORMAT(name,
TPPROTO(proto),
TPARGS(args),
TPFMT(fmt, fmt_args),
TRACE_STUCT(
TRACE_FIELD(type1, item1, assign1)
TRACE_FIELD(type2, item2, assign2)
[...]
),
TPRAWFMT(raw_fmt)
);
Note name, proto, args, and fmt, are all identical to what TRACE_FORMAT
uses.
name: is the unique identifier of the trace point
proto: The proto type that the trace point uses
args: the args in the proto type
fmt: printf format to use with the event printf tracer
fmt_args: the printf argments to match fmt
TRACE_STRUCT starts the ability to create a structure.
Each item in the structure is defined with a TRACE_FIELD
TRACE_FIELD(type, item, assign)
type: the C type of item.
item: the name of the item in the stucture
assign: what to assign the item in the trace point callback
raw_fmt is a way to pretty print the struct. It must match
the order of the items are added in TRACE_STUCT
An example of this would be:
TRACE_EVENT_FORMAT(sched_wakeup,
TPPROTO(struct rq *rq, struct task_struct *p, int success),
TPARGS(rq, p, success),
TPFMT("task %s:%d %s",
p->comm, p->pid, success?"succeeded":"failed"),
TRACE_STRUCT(
TRACE_FIELD(pid_t, pid, p->pid)
TRACE_FIELD(int, success, success)
),
TPRAWFMT("task %d success=%d")
);
This creates us a unique struct of:
struct {
pid_t pid;
int success;
};
And the way the call back would assign these values would be:
entry->pid = p->pid;
entry->success = success;
The nice part about this is that the creation of the assignent is done
via macro magic in the event tracer. Once the TRACE_EVENT_FORMAT is
created, the developer will then have a faster method to record
into the ring buffer. They do not need to worry about the tracer itself.
The developer would only need to touch the files in include/trace/*.h
Again, I would like to give special thanks to Tom Zanussi for this
nice idea.
Idea-from: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 00:38:04 +0000 (19:38 -0500)]
tracing: add interface to write into current tracer buffer
Right now all tracers must manage their own trace buffers. This was
to enforce tracers to be independent in case we finally decide to
allow each tracer to have their own trace buffer.
But now we are adding event tracing that writes to the current tracer's
buffer. This adds an interface to allow events to write to the current
tracer buffer without having to manage its own. Since event tracing
has no "tracer", and is just a way to hook into any other tracer.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 04:45:52 +0000 (23:45 -0500)]
tracing: add subsystem sched for sched events
Add the TRACE_SYSTEM sched for the sched events.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 04:41:43 +0000 (23:41 -0500)]
tracing: add subsystem irq for irq events
Add the TRACE_SYSTEM irq for the irq events.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 04:32:58 +0000 (23:32 -0500)]
tracing: make the set_event and available_events subsystem aware
This patch makes the event files, set_event and available_events
aware of the subsystem.
Now you can enable an entire subsystem with:
echo 'irq:*' > set_event
Note: the '*' is not needed.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Sat, 28 Feb 2009 02:33:02 +0000 (21:33 -0500)]
tracing: add subsystem level to trace events
If a trace point header defines TRACE_SYSTEM, then it will add the
following trace points into that event system.
If include/trace/irq_event_types.h has:
#define TRACE_SYSTEM irq
at the top and
#undef TRACE_SYSTEM
at the bottom, then a directory "irq" will be created in the
/debug/tracing/events directory. Inside that directory will contain the
two trace points that are defined in include/trace/irq_event_types.h.
Only adding the above to irq and not to sched, we get:
# ls /debug/tracing/events/
irq sched_process_exit sched_signal_send sched_wakeup_new
sched_kthread_stop sched_process_fork sched_switch
sched_kthread_stop_ret sched_process_free sched_wait_task
sched_migrate_task sched_process_wait sched_wakeup
# ls /debug/tracing/events/irq
irq_handler_entry irq_handler_exit
If we add #define TRACE_SYSTEM sched to the trace/sched_event_types.h
then the rest of the trace events will be put in a sched directory
within the events directory.
I've been playing with this idea of the subsystem for a while, but
recently Tom Zanussi posted some patches to lkml that included this
method. Tom's approach was clean and got me to finally put some effort
to clean up the event trace points.
Thanks to Tom Zanussi for demonstrating how nice the subsystem
method is.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Fri, 27 Feb 2009 22:36:06 +0000 (17:36 -0500)]
tracing: move trace point formats to files in include/trace directory
Impact: clean up
To further facilitate the ease of adding trace points for developers, this
patch creates include/trace/trace_events.h and
include/trace/trace_event_types.h.
The former file will hold the trace/<type>.h files and the latter will hold
the trace/<type>_event_types.h files.
To create new tracepoints and to have them automatically
appear in the event tracer, a developer makes the trace/<type>.h file
which includes <linux/tracepoint.h> and the trace/<type>_event_types.h file.
The trace/<type>_event_types.h file will hold the TRACE_FORMAT
macros.
Then add the trace/<type>.h file to trace/trace_events.h,
and add the trace/<type>_event_types.h to the trace_event_types.h file.
No need to modify files elsewhere.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Fri, 27 Feb 2009 15:51:10 +0000 (10:51 -0500)]
tracing: replace kzalloc with kcalloc
Impact: clean up
kcalloc is a better approach to allocate a NULL array.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Fri, 27 Feb 2009 05:22:21 +0000 (00:22 -0500)]
tracing: use newline separator for trace options list
Impact: clean up
Instead of listing the trace options like:
# cat /debug/tracing/trace_options
print-parent nosym-offset nosym-addr noverbose noraw nohex nobin noblock nostacktrace nosched-tree ftrace_printk noftrace_preempt nobranch annotate nouserstacktrace nosym-userobj
We now list them like:
# cat /debug/tracing/trace_options
print-parent
nosym-offset
nosym-addr
noverbose
noraw
nohex
nobin
noblock
nostacktrace
nosched-tree
ftrace_printk
noftrace_preempt
nobranch
annotate
nouserstacktrace
nosym-userobj
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Fri, 27 Feb 2009 05:12:38 +0000 (00:12 -0500)]
tracing: use pointer error returns for __tracing_open
Impact: fix compile warning and clean up
When I first wrote __tracing_open, instead of passing the error
code via the ERR_PTR macros, I lazily used a separate parameter
to hold the return for errors.
When Frederic Weisbecker updated that function, he used the Linux
kernel ERR_PTR for the returns. This caused the parameter return
to possibly not be initialized on error. gcc correctly pointed this
out with a warning.
This patch converts the entire function to use the Linux kernel
ERR_PTR macro methods.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Fri, 27 Feb 2009 04:55:58 +0000 (23:55 -0500)]
tracing: add protection around open use of current_tracer
Impact: fix to possible race conditions
There's some uses of current_tracer that is not protected by the
trace_types_lock. There is a small chance that a sysadmin changes
the tracer while the current_tracer is being referenced.
If the race is hit, it is unlikely to cause any harm since the
tracers are constant and are not freed. But some strang side
effects may occur.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Fri, 27 Feb 2009 04:43:05 +0000 (23:43 -0500)]
tracing: add tracer dependent options to options directory
This patch adds the tracer dependent options dynamically to the
options directory when the tracer is activated. These options are
removed when the tracer is deactivated.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Fri, 27 Feb 2009 03:19:12 +0000 (22:19 -0500)]
tracing: add options directory and core option files
This patch creates an options directory in the debugfs, that contains
the available tracing options. These files contain 1 or 0, where 1
is the option is enabled and 0 it is disabled.
Simply echoing in 1 will enable the option and 0 will disable it.
This patch only contains the core options, not the tracer options.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Ingo Molnar [Thu, 26 Feb 2009 20:21:59 +0000 (21:21 +0100)]
Merge branch 'sched/clock' into tracing/ftrace
Conflicts:
kernel/sched_clock.c
Ingo Molnar [Thu, 26 Feb 2009 19:16:58 +0000 (20:16 +0100)]
x86: set X86_FEATURE_TSC_RELIABLE
If the TSC is constant and non-stop, also set it reliable.
(We will turn this off in DMI quirks for multi-chassis systems)
The performance number on a 16-way Nehalem system running
32 tasks that context-switch between each other is significant:
sched_clock_stable=0 sched_clock_stable=1
.................... ....................
22.456925 million/sec 24.306972 million/sec [+8.2%]
lmbench's "lat_ctx -s 0 2" goes from 0.63 microseconds to
0.59 microseconds - a 6.7% increase in context-switching
performance.
Perfstat of 1 million pipe context switches between two tasks:
Performance counter stats for './pipe-test-1m':
[before] [after]
............ ............
37621.421089 36436.848378 task clock ticks (msecs)
0 0 CPU migrations (events)
2000274 2000189 context switches (events)
194 193 pagefaults (events)
8433799643 8171016416 CPU cycles (events) -3.21%
8370133368 8180999694 instructions (events) -2.31%
4158565 3895941 cache references (events) -6.74%
44312 46264 cache misses (events)
2349.287976 2279.362465 wall-time (msecs) -3.06%
The speedup comes straight from the reduction in the instruction
count. sched_clock_cpu() got simpler and the whole workload thus
executes faster.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Thu, 26 Feb 2009 19:20:29 +0000 (20:20 +0100)]
sched: allow architectures to specify sched_clock_stable
Allow CONFIG_HAVE_UNSTABLE_SCHED_CLOCK architectures to still specify
that their sched_clock() implementation is reliable.
This will be used by x86 to switch on a faster sched_clock_cpu()
implementation on certain CPU types.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Thu, 26 Feb 2009 17:47:11 +0000 (18:47 +0100)]
tracing: implement trace_clock_*() APIs
Impact: implement new tracing timestamp APIs
Add three trace clock variants, with differing scalability/precision
tradeoffs:
- local: CPU-local trace clock
- medium: scalable global clock with some jitter
- global: globally monotonic, serialized clock
Make the ring-buffer use the local trace clock internally.
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Mon, 12 May 2008 19:21:14 +0000 (21:21 +0200)]
sched: sched_clock() improvement: use in_nmi()
make sure we dont execute more complex sched_clock() code in NMI context.
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Jason Baron [Thu, 26 Feb 2009 15:11:05 +0000 (10:11 -0500)]
tracing, genirq: add irq enter and exit trace events
Impact: add new tracepoints
Add them to the generic IRQ code, that way every architecture
gets these new tracepoints, not just x86.
Using Steve's new 'TRACE_FORMAT', I can get function graph
trace as follows using the original two IRQ tracepoints:
3) | handle_IRQ_event() {
3) | /* (irq_handler_entry) irq=28 handler=eth0 */
3) | e1000_intr_msi() {
3) 2.460 us | __napi_schedule();
3) 9.416 us | }
3) | /* (irq_handler_exit) irq=28 handler=eth0 return=handled */
3) + 22.935 us | }
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: "Frank Ch. Eigler" <fche@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Frederic Weisbecker [Wed, 25 Feb 2009 23:41:38 +0000 (00:41 +0100)]
tracing/core: make the per cpu trace files in per cpu directories
Impact: restructure the VFS layout of per CPU trace buffers
The per cpu trace files are all in a single directory:
/debug/tracing/per_cpu. In case of a large number of cpu, the
content of this directory becomes messy so we create now one
directory per cpu inside /debug/tracing/per_cpu which contain
each their own trace_pipe and trace files.
Ie:
/debug/tracing$ ls -R per_cpu
per_cpu:
cpu0 cpu1
per_cpu/cpu0:
trace trace_pipe
per_cpu/cpu1:
trace trace_pipe
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Thu, 26 Feb 2009 02:48:44 +0000 (03:48 +0100)]
Merge branch 'tip/tracing/ftrace' of ssh:///linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
Ingo Molnar [Thu, 26 Feb 2009 02:47:27 +0000 (03:47 +0100)]
Merge branches 'tracing/ftrace', 'tracing/hw-branch-tracing' and 'linus' into tracing/core
Steven Rostedt [Wed, 25 Feb 2009 20:54:30 +0000 (15:54 -0500)]
tracing: wrap arguments with PARAMS
Peter Zijlstra warned that TPPROTO and TPARGS might become something
other than a simple copy of itself. To prevent this from having
side effects in the TRACE_FORMAT macro in tracepoint.h, we add a
PARAMS() macro to be defined as just a wrapper.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Wed, 25 Feb 2009 20:49:52 +0000 (15:49 -0500)]
tracing: rename DEFINE_TRACE_FMT to just TRACE_FORMAT
There's been a bit confusion to whether DEFINE/DECLARE_TRACE_FMT should
be a DEFINE or a DECLARE. Ingo Molnar suggested simply calling it
TRACE_FORMAT.
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Frederic Weisbecker [Wed, 25 Feb 2009 05:13:16 +0000 (06:13 +0100)]
tracing/core: make the read callbacks reentrants
Now that several per-cpu files can be read or spliced at the
same, we want the read/splice callbacks for tracing files to be
reentrants.
Until now, a single global mutex (trace_types_lock) serialized
the access to tracing_read_pipe(), tracing_splice_read_pipe(),
and the seq helpers.
Ie: it means that if a user tries to read trace_pipe0 and
trace_pipe1 at the same time, the access to the function
tracing_read_pipe() is contended and one reader must wait for
the other to finish its read call.
The trace_type_lock mutex is mostly here to serialize the access
to the global current tracer (current_trace), which can be
changed concurrently. Although the iter struct keeps a private
pointer to this tracer, its callbacks can be changed by another
function.
The method used here is to not keep anymore private reference to
the tracer inside the iterator but to make a copy of it inside
the iterator. Then it checks on subsequents read calls if the
tracer has changed. This is not costly because the current
tracer is not expected to be changed often, so we use a branch
prediction for that.
Moreover, we add a private mutex to the iterator (there is one
iterator per file descriptor) to serialize the accesses in case
of multiple consumers per file descriptor (which would be a
silly idea from the user). Note that this is not to protect the
ring buffer, since the ring buffer already serializes the
readers accesses. This is to prevent from traces weirdness in
case of concurrent consumers. But these mutexes can be dropped
anyway, that would not result in any crash. Just tell me what
you think about it.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Frederic Weisbecker [Wed, 25 Feb 2009 02:22:28 +0000 (03:22 +0100)]
tracing/core: introduce per cpu tracing files
Impact: split up tracing output per cpu
Currently, on the tracing debugfs directory, three files are
available to the user to let him extracting the trace output:
- trace is an iterator through the ring-buffer. It's a reader
but not a consumer It doesn't block when no more traces are
available.
- trace pretty similar to the former, except that it adds more
informations such as prempt count, irq flag, ...
- trace_pipe is a reader and a consumer, it will also block
waiting for traces if necessary (heh, yes it's a pipe).
The traces coming from different cpus are curretly mixed up
inside these files. Sometimes it messes up the informations,
sometimes it's useful, depending on what does the tracer
capture.
The tracing_cpumask file is useful to filter the output and
select only the traces captured a custom defined set of cpus.
But still it is not enough powerful to extract at the same time
one trace buffer per cpu.
So this patch creates a new directory: /debug/tracing/per_cpu/.
Inside this directory, you will now find one trace_pipe file and
one trace file per cpu.
Which means if you have two cpus, you will have:
trace0
trace1
trace_pipe0
trace_pipe1
And of course, reading these files will have the same effect
than with the usual tracing files, except that you will only see
the traces from the given cpu.
The original all-in-one cpu trace file are still available on
their original place.
Until now, only one consumer was allowed on trace_pipe to avoid
racy consuming on the ring-buffer. Now the approach changed a
bit, you can have only one consumer per cpu.
Which means you are allowed to read concurrently trace_pipe0 and
trace_pipe1 But you can't have two readers on trace_pipe0 or
trace_pipe1.
Following the same logic, if there is one reader on the common
trace_pipe, you can not have at the same time another reader on
trace_pipe0 or in trace_pipe1. Because in trace_pipe is already
a consumer in all cpu buffers in essence.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Wed, 25 Feb 2009 11:50:07 +0000 (12:50 +0100)]
Merge branch 'tip/tracing/ftrace' of git://git./linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
Ingo Molnar [Wed, 25 Feb 2009 10:03:44 +0000 (11:03 +0100)]
tracing: remove /debug/tracing/latency_trace
Impact: remove old debug/tracing API
/debug/tracing/latency_trace is an old legacy format we kept from
the old latency tracer. Remove the file for now. If there's any
useful bit missing then we'll propagate any useful output bits into
the /debug/tracing/trace output.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Wed, 25 Feb 2009 07:40:09 +0000 (08:40 +0100)]
tracing/hw-branch-tracing: convert bts-tracer mutex to a spinlock
Impact: fix CPU hotplug lockup
bts_hotcpu_handler() is called with irqs disabled, so using mutex_lock()
is a no-no.
All the BTS codepaths here are atomic (they do not schedule), so using
a spinlock is the right solution.
Cc: Markus Metzger <markus.t.metzger@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Steven Rostedt [Tue, 24 Feb 2009 19:15:08 +0000 (14:15 -0500)]
tracing: make event directory structure
This patch adds the directory /debug/tracing/events/ that will contain
all the registered trace points.
# ls /debug/tracing/events/
sched_kthread_stop sched_process_fork sched_switch
sched_kthread_stop_ret sched_process_free sched_wait_task
sched_migrate_task sched_process_wait sched_wakeup
sched_process_exit sched_signal_send sched_wakeup_new
# ls /debug/tracing/events/sched_switch/
enable
# cat /debug/tracing/events/sched_switch/enable
1
# cat /debug/tracing/set_event
sched_switch
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Tue, 24 Feb 2009 15:22:57 +0000 (10:22 -0500)]
tracing: add schedule events to event trace
This patch changes the trace/sched.h to use the DECLARE_TRACE_FMT
such that they are automatically registered with the event tracer.
And it also adds the tracing sched headers to kernel/trace/events.c
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Tue, 24 Feb 2009 15:21:36 +0000 (10:21 -0500)]
tracing: add event trace infrastructure
This patch creates the event tracing infrastructure of ftrace.
It will create the files:
/debug/tracing/available_events
/debug/tracing/set_event
The available_events will list the trace points that have been
registered with the event tracer.
set_events will allow the user to enable or disable an event hook.
example:
# echo sched_wakeup > /debug/tracing/set_event
Will enable the sched_wakeup event (if it is registered).
# echo "!sched_wakeup" >> /debug/tracing/set_event
Will disable the sched_wakeup event (and only that event).
# echo > /debug/tracing/set_event
Will disable all events (notice the '>')
# cat /debug/tracing/available_events > /debug/tracing/set_event
Will enable all registered event hooks.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Steven Rostedt [Tue, 24 Feb 2009 17:07:53 +0000 (12:07 -0500)]
tracing: add DEFINE_TRACE_FMT to tracepoint.h
This patch creates a DEFINE_TRACE_FMT to map to DECLARE_TRACE.
This allows for the developers to place format strings and
args in with their tracepoint declaration. A tracer may now
override the DEFINE_TRACE_FMT macro and use it to record
a default format.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Linus Torvalds [Tue, 24 Feb 2009 23:42:08 +0000 (15:42 -0800)]
Merge branch 'proc-linus' of git://git./linux/kernel/git/adobriyan/proc
* 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc:
proc: fix PG_locked reporting in /proc/kpageflags
Linus Torvalds [Tue, 24 Feb 2009 23:40:19 +0000 (15:40 -0800)]
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
Add i2c_board_info for RiscPC PCF8583
i2c: Make sure i2c_algo_bit_data.timeout is HZ-independent
i2c-dev: Clarify the unit of ioctl I2C_TIMEOUT
i2c: Timeouts reach -1
i2c: Fix misplaced parentheses
Linus Torvalds [Tue, 24 Feb 2009 23:39:54 +0000 (15:39 -0800)]
Merge branch 'firedtv-merge' of git://git./linux/kernel/git/ieee1394/linux1394-2.6
* 'firedtv-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
firedtv: dvb_frontend_info for FireDTV S2, fix "frequency limits undefined" error
firedtv: massive refactoring
firedtv: rename files, variables, functions from firesat to firedtv
firedtv: Use DEFINE_SPINLOCK
firedtv: fix registration - adapter number could only be zero
firedtv: use length_field() of PMT as length
firedtv: fix returned struct for ca_info
firedtv: cleanups and minor fixes
ieee1394: remove superfluous assertions
ieee1394: inherit ud vendor_id from node vendor_id
ieee1394: add hpsb_node_read() and hpsb_node_lock()
ieee1394: use correct barrier types between accesses of nodeid and generation
firesat: copyrights, rename to firedtv, API conversions, fix remote control input
firesat: avc resend
firesat: update isochronous interface, add CI support
firesat: add DVB-S support for DVB-S2 devices
firesat: fix DVB-S2 device recognition
DVB: add firesat driver
Linus Torvalds [Tue, 24 Feb 2009 23:39:34 +0000 (15:39 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: Fix deadlock in ext4_write_begin() and ext4_da_write_begin()
ext4: Add fallback for find_group_flex
Russell King [Tue, 24 Feb 2009 18:19:50 +0000 (19:19 +0100)]
Add i2c_board_info for RiscPC PCF8583
Add the necessary i2c_board_info structure to fix the lack of PCF8583
RTC on RiscPC.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Jean Delvare [Tue, 24 Feb 2009 18:19:49 +0000 (19:19 +0100)]
i2c: Make sure i2c_algo_bit_data.timeout is HZ-independent
i2c_algo_bit_data.timeout is supposed to be in jiffies, so drivers
should use set this value in terms of HZ.
Ultimately I think this field should be discarded in favor of
i2c_adapter.timeout, but that's left for a future patch.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Lennert Buytenhek <kernel@wantstofly.org>
Acked-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Jean Delvare [Tue, 24 Feb 2009 18:19:49 +0000 (19:19 +0100)]
i2c-dev: Clarify the unit of ioctl I2C_TIMEOUT
The unit in which user-space can set the bus timeout value is jiffies
for historical reasons (back when HZ was always 100.) This is however
not good because user-space doesn't know how long a jiffy lasts. The
timeout value should instead be set in a fixed time unit. Given the
original value of HZ, this unit should be 10 ms, for compatibility.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Roel Kluin [Tue, 24 Feb 2009 18:19:48 +0000 (19:19 +0100)]
i2c: Timeouts reach -1
With a postfix decrement these timeouts reach -1 rather than 0, but
after the loop it is tested whether they have become 0.
As pointed out by Jean Delvare, the condition we are waiting for should
also be tested before the timeout. With the current order, you could
exit with a timeout error while the job is actually done.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Roel Kluin [Tue, 24 Feb 2009 18:19:48 +0000 (19:19 +0100)]
i2c: Fix misplaced parentheses
Fix misplaced parentheses.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Helge Bahmann [Fri, 20 Feb 2009 13:24:12 +0000 (16:24 +0300)]
proc: fix PG_locked reporting in /proc/kpageflags
Expr always evaluates to zero.
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Markus Metzger [Tue, 24 Feb 2009 13:12:34 +0000 (14:12 +0100)]
x86, ptrace: remove CONFIG guards around declarations
Remove unnecessary CONFIG guards around type declarations and macro
definitions.
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
Cc: markus.t.metzger@gmail.com
Cc: roland@redhat.com
Cc: eranian@googlemail.com
Cc: oleg@redhat.com
Cc: juan.villacis@intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Markus Metzger [Tue, 24 Feb 2009 12:55:18 +0000 (13:55 +0100)]
x86, ftrace: fix section mismatch in hw-branch-tracer
Fix an invalid memory reference problem when cpu hotplug support is
disabled and the hw-branch-tracer is set as current tracer.
Initializing the tracer calls bts_trace_init() which has already
been freed at this time.
Reported-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Tue, 24 Feb 2009 17:22:39 +0000 (18:22 +0100)]
Merge branch 'tracing/ftrace'; commit 'v2.6.29-rc6' into tracing/core
Beat Michel Liechti [Tue, 24 Feb 2009 14:52:49 +0000 (15:52 +0100)]
firedtv: dvb_frontend_info for FireDTV S2, fix "frequency limits undefined" error
I found that the function fdtv_frontend_init in the file firedtv-fe.c was
missing a case for FIREDTV_DVB_S2 which resulted in "frequency limits
undefined" errors in syslog.
Signed-off-by: Beat Michel Liechti <bml303@gmail.com>
Change by Stefan R: combine it with case case FIREDTV_DVB_S as
originally suggested by Beat Michel. This enables FE_CAN_FEC_AUTO also
for FireDTV-S2 devices which is possible as long as only DVB-S channels
are used. FE_CAN_FEC_AUTO would be wrong for DVB-S2 channels, but those
cannot be used yet since the driver is not yet converted to S2API.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter [Mon, 23 Feb 2009 13:21:10 +0000 (14:21 +0100)]
firedtv: massive refactoring
Combination of the following changes:
Mon, 23 Feb 2009 14:21:10 +0100 (CET)
firedtv: reinstate debug logging option
Henrik Kurelid tells me that FCP debug logging (which I removed during
cleanups) is still useful when working on driver issues together with
end users. So bring it back in an updated form with only 60% of the
original code footprint.
Logging can be enabled with
# echo -1 > /sys/module/firedtv/parameters/debug
1 instead of -1 enables only FCP header logging,
2 instead of -1 enables only hexdumps of the entire FCP frames.
0 switches logging off again.
Fri, 20 Feb 2009 20:54:27 +0100 (CET)
firedtv: build fix for INPUT=m and DVB_FIREDTV=y
Thu, 19 Feb 2009 20:40:39 +0100
firedtv: use msecs_to_jiffies
Pointed out by Mauro Carvalho Chehab.
Sun Feb 15 20:50:46 CET 2009
firedtv: some more housekeeping
Fix an old checkpatch warning and a new compiler warning.
Sun Feb 15 15:33:17 CET 2009
firedtv: rename a file once more
At the moment, about a third of avc.c is specific to FireDTVs rather
than generic AV/C code. Rename it to firedtv-avc.c.
Sun Feb 15 15:33:17 CET 2009
firedtv: dvb demux: more compact channels backing store
Replace struct firedtv_channel { bool active; int pid; } channel[16];
by unsigned long channel_active; u16 channel_pid[16];.
Sun Feb 15 15:33:17 CET 2009
firedtv: dvb demux: some simplifications
c->active was unnecessarily cleared twice.
Also, by marking the channel inactive before the for loop,
the loop becomes identical with fdtv_channel_collect().
Sun Feb 15 15:33:17 CET 2009
firedtv: dvb demux: remove a bogus loop
This loop is unnecessary because
- only active channel[].pid's will be sent to the device,
- when a channel is activated, its pid is set to dvbdmxfeed->pid.
Perhaps the original code was there because it was initially not fully
covered by the fdtv->demux_mutex.
Sun Feb 15 15:33:17 CET 2009
firedtv: dvb demux: fix mutex protection
fdtv_start_feed() accessed the channel list unsafely.
Fully serialize it with itself and fdtv_stop_feed().
Sun Feb 15 15:33:17 CET 2009
firedtv: dvb demux: fix missing braces
Original code was:
...
case DMX_TS_PES_OTHER:
//Dirty fix to keep firesat->channel pid-list up to date
for(k=0;k<16;k++){
if(firesat->channel[k].active == 0)
firesat->channel[k].pid =
dvbdmxfeed->pid;
break;
}
channel = firesat_channel_allocate(firesat);
break;
default:
...
Looks bogus in several respects. For now let's just add braces to the if
because that seems to be what the author meant.
Sun Feb 15 15:33:17 CET 2009
firedtv: allow build without input subsystem
!CONFIG_INPUT is very unlikely on systems on which firedtv is of
interest. But we can easily support it.
Sun Feb 15 15:33:17 CET 2009
firedtv: replace EXTRA_CFLAGS by ccflags
The former are deprecated.
The latter can depend on Kconfig variables.
Sun Feb 15 15:33:17 CET 2009
firedtv: concentrate ieee1394 dependencies
Move the entire interface with drivers/ieee1394 to firedtv-1394.c.
Move 1394-independent module initialization code to firedtv-dvb.c.
This prepares interfacing with drivers/firewire.
Sun Feb 15 15:33:17 CET 2009
firedtv: amend Kconfig menu prompt
Sun Feb 15 15:33:17 CET 2009
firedtv: remove kernel version compatibility macro
Sun Feb 15 15:33:17 CET 2009
firedtv: combine header files
avc.h and firedtv-*.h are small and currently not shared with other
drivers, hence concatenate them all into firedtv.h.
Sun Feb 15 15:33:17 CET 2009
firedtv: misc style touch-ups
Standardize on lower-case hexadecimal constants. Adjust whitespace.
Omit unnecessary pointer type casts and an unnecessary list head
initialization. Use dev_printk.
Wed Feb 11 21:21:04 CET 2009
firedtv: avc, ci: remove unused constants
Wed Feb 11 21:21:04 CET 2009
firedtv: avc: remove bitfields from read descriptor response operands
Don't use bitfields in struct types of on-the-wire data.
Wed Feb 11 21:21:04 CET 2009
firedtv: avc: remove bitfields from DSD command operands
Don't use bitfields in struct types of on-the-wire data.
Wed Feb 11 21:21:04 CET 2009
firedtv: avc: header file cleanup
Remove unused constants and declarations.
Move privately used constants into .c files.
Wed Feb 11 21:21:04 CET 2009
firedtv: avc: remove bitfields from FCP frame types
Don't use bitfields in struct types of on-the-wire data.
Also move many privately used constants from avc.h to avc.c
and remove some unused constants.
Sun, 18 Jan 2009 16:30:00 +0100 (CET)
firedtv: avc: fix offset in avc_tuner_get_ts
The parentheses were wrong. It didn't matter though because this code
only writes a 0 into an area which is already initialized to 0.
Sun, 18 Jan 2009 16:30:00 +0100 (CET)
firedtv: avc: reduce stack usage, remove two typedefs
It is safe to share a memory buffer for command frame and response frame
because the response data come in after the command frame was last used.
Even less stack would be required if only the actual required frame size
instead of the entire FCP register size was allocated.
Also, rename the defined types AVCCmdFrm and AVCRspFrm to
struct avc_command_frame and struct avc_response_frame.
TODO: Remove the bitfields in these types.
Sun, 18 Jan 2009 16:30:00 +0100 (CET)
firedtv: cmp: move code to avc
Sun, 18 Jan 2009 16:30:00 +0100 (CET)
firedtv: iso: move code to firedtv-1394
Sun, 18 Jan 2009 16:30:00 +0100 (CET)
firedtv: iso: remove unnecessary struct type definitions
Sun, 18 Jan 2009 16:30:00 +0100 (CET)
firedtv: iso: style changes and fixlets
Add cleanup after failure in setup_iso_channel.
Replace printk() by dv_err().
Decrease indentation level in rawiso_activity_cb().
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Rambaldi [Sat, 17 Jan 2009 13:47:34 +0000 (14:47 +0100)]
firedtv: rename files, variables, functions from firesat to firedtv
Combination of the following changes:
Sat, 17 Jan 2009 14:47:34 +0100
firedtv: rename variables and functions from firesat to firedtv
Signed-off-by: Rambaldi <Rambaldi@xs4all.nl>
Additional changes by Stefan Richter:
Renamed struct firedtv *firedtv to struct firedtv *fdtv and
firedtv_foo_bar() to fdtv_foo_bar() for brevity.
Sat, 17 Jan 2009 13:07:44 +0100
firedtv: rename files from firesat to firedtv
Signed-off-by: Rambaldi <Rambaldi@xs4all.nl>
Additional changes by Stefan Richter:
Name the directory "firewire" instead of "firedtv".
Standardize on "-" instead of "_" in file names, because that's what
drivers/firewire/ and drivers/media/dvb/dvb-usb/ use too.
Build fix.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Julia Lawall [Thu, 25 Dec 2008 14:34:25 +0000 (15:34 +0100)]
firedtv: Use DEFINE_SPINLOCK
SPIN_LOCK_UNLOCKED is deprecated. The following makes the change suggested
in Documentation/spinlocks.txt
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Henrik Kurelid [Mon, 15 Dec 2008 07:17:12 +0000 (08:17 +0100)]
firedtv: fix registration - adapter number could only be zero
There was a bug causing the initialization to fail if adapter number was
greater than zero. The adapter was however registered which caused the driver
to oops the second time initialization was tried.
Signed-off-by: Henrik Kurelid <henrik@kurelid.se>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Henrik Kurelid [Fri, 5 Dec 2008 09:00:16 +0000 (10:00 +0100)]
firedtv: use length_field() of PMT as length
Parsed and used the length_field() of the PMT message instead of using
the length field of the message struct, which does not seem to be filled
correctly by e.g. MythTV.
Signed-off-by: Henrik Kurelid <henrik@kurelid.se>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Henrik Kurelid [Thu, 4 Dec 2008 21:40:52 +0000 (22:40 +0100)]
firedtv: fix returned struct for ca_info
The SystemId of the ca_info message was filled with garbage.
It now returns what the card returns.
Signed-off-by: Henrik Kurelid <henrik@kurelid.se>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter [Sun, 2 Nov 2008 12:45:00 +0000 (13:45 +0100)]
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter [Mon, 16 Feb 2009 22:42:31 +0000 (23:42 +0100)]
ieee1394: remove superfluous assertions
hpsb_read, hpsb_write, hpsb_lock are sleeping functions which nobody is
in danger to use in atomic context. Besides, in_interrupt does not
cover all types of atomic context.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter [Tue, 26 Aug 2008 23:24:25 +0000 (01:24 +0200)]
ieee1394: inherit ud vendor_id from node vendor_id
While Module_Vendor_ID in the configuration ROM's root directory is
mandatory, there often aren't vendor IDs in unit directories. This
affects the new firedtv driver which is meant to be auto-loaded and
matched only for vendor-specific devices.
We now always copy ne->vendor_id into ud->vendor_id before we scan a
unit directory (and fill in a possibly present vendor ID from there).
This way, the root directory's vendor ID is used as fallback in the
"uevent" environment for modprobe'ing per module alias when a node was
plugged in, and in the driver match routine when protocol drivers are
bound to unit directories. It will however not be used as sysfs
attribute of a unit directory device.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter [Wed, 27 Aug 2008 11:40:02 +0000 (13:40 +0200)]
ieee1394: add hpsb_node_read() and hpsb_node_lock()
These will be used by the firedtv driver. Like hpsb_node_write() they
are much better APIs for high-level drivers than hpsb_write() and its
siblings --- easier to use correctly and also terser.
Unlike hspb_node_write(), the two new functions will only be used by
one call site. Hence make them static inline instead of exported
symbols.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter [Tue, 26 Aug 2008 23:18:32 +0000 (01:18 +0200)]
ieee1394: use correct barrier types between accesses of nodeid and generation
A compiler barrier (explicit on the read side, implicit on the write
side) is not quite enough for what has to be accomplished here. Use
hardware memory barriers on systems which need them.
(Of course a full fix of generation handling would require much more
than this. The ieee1394 core's bus generation counter had to be tied to
the controller's bus generation counter; cf. Kristian's stack. It's
just that I have other current business with the code around these
barrier()s, so why not do at least this small fix.)
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter [Mon, 25 Aug 2008 22:17:30 +0000 (00:17 +0200)]
firesat: copyrights, rename to firedtv, API conversions, fix remote control input
Combination of the following changes:
Tue, 26 Aug 2008 00:17:30 +0200 (CEST)
firedtv: fix remote control input
and update the scancode-to-keycode mapping to a current model. Per
default, various media key keycodes are emitted which closely match what
is printed on the remote. Userland can modify the mapping by means of
evdev ioctls. (Not tested.)
The old scancode-to-keycode mapping is left in the driver but cannot be
modified by ioctls. This preserves status quo for old remotes.
Tue, 26 Aug 2008 00:11:28 +0200 (CEST)
firedtv: replace tasklet by workqueue job
Non-atomic context is a lot nicer to work with.
Sun, 24 Aug 2008 23:30:00 +0200 (CEST)
firedtv: move some code back to ieee1394 core
Partially reverts "ieee1394: remove unused code" of Linux 2.6.25.
Sun, 24 Aug 2008 23:29:30 +0200 (CEST)
firedtv: replace semaphore by mutex
firesat->avc_sem and ->demux_sem have been used exactly like a mutex.
The only exception is the schedule_remotecontrol tasklet which did a
down_trylock in atomic context. This is not possible with
mutex_trylock; however the whole remote control related code is
non-functional anyway at the moment. This should be fixed eventually,
probably by turning the tasklet into a worqueue job.
Convert everything else from semaphore to mutex.
Also rewrite a few of the affected functions to unlock the mutex at a
single exit point, instead of in several branches.
Sun, 24 Aug 2008 23:28:45 +0200 (CEST)
firedtv: some header cleanups
Unify #ifndef/#define/#endif guards against multiple inclusion.
Drop extern keyword from function declarations.
Remove #include's into header files where struct declarations suffice.
Remove unused ohci1394 interface and related unused ieee1394 interfaces.
Add a few missing #include's and remove a few apparently obsolete ones.
Sort them alphabetically.
Sun, 24 Aug 2008 23:27:45 +0200 (CEST)
firedtv: nicer registration message and some initialization fixes
Print the correct name in dvb_register_adapter().
While we are at it, replace two switch cascades by one for loop, remove
a superfluous member of struct firesat and of two unused arguments of
AVCIdentifySubunit(), and fix bogus kfree's in firesat_dvbdev_init().
Tue, 26 Aug 2008 14:24:17 +0200 (CEST)
firesat: rename to firedtv
Suggested by Andreas Monitzer. Besides DVB-S/-S2 receivers, the driver
also supports DVB-C and DVB-T receivers, hence the previous project name
is too narrow now.
Not yet done: Rename source directory, files, types, variables...
Sun, 24 Aug 2008 23:26:23 +0200 (CEST)
firesat: add missing copyright notes
Reported by Andreas Monitzer and Christian Dolzer.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Henrik Kurelid [Sun, 24 Aug 2008 13:20:07 +0000 (15:20 +0200)]
firesat: avc resend
- Add resending of AVC message to the card if no answer is received
- Replace the homebrewed event_wait function with a standard wait queue
- Clean up of log/error messages
- Increase debug level of avc communication
Signed-off-by: Henrik Kurelid <henrik@kurelid.se>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Henrik Kurelid [Fri, 1 Aug 2008 08:00:45 +0000 (10:00 +0200)]
firesat: update isochronous interface, add CI support
I have finally managed to get the CI support for the card working. The
implementation is a bare minimum to get encrypted channels to work in
kaffeine. It works fine with my T/CI card. Now and then I get an AVC
timeout and have to retune a channel in order to get it to work. Once
the CAM seemed to hang so I needed to remove and insert it again. I.e.
there are a number of glitches.
The latest version contains the following changes:
- Implemented the new hpsb iso interface so that data can be received
from the card
- Reduced some timers for demux setup which caused scanning to timeout
- Added possibility to unload driver
- Added support for getting C/N ratio
- Added two debug parameters to the driver; ca_debug and
avc_comm_debug.
- Added CI support that works for me in kaffeine
- Started working on CI MMI support. It now supports:
o Enter menu
o Receiving MMI objects
- Added support for 64-bit platforms
- Corrected DVB-C modulations problems
Signed-off-by: Henrik Kurelid <henrik@kurelid.se>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (rebased, whitespace)
Ben Backx [Sat, 9 Aug 2008 12:35:55 +0000 (14:35 +0200)]
firesat: add DVB-S support for DVB-S2 devices
...so S2 owners now can at least watch DVB-S channels in linux.
Signed-off-by: Ben Backx <ben@bbackx.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Ben Backx [Sun, 22 Jun 2008 14:00:53 +0000 (16:00 +0200)]
firesat: fix DVB-S2 device recognition
This only makes sure that a DVB-S2 device is really recognized as a S2,
nothing else is added yet. It's using the string containing the model
that is stored in the configuration ROM, the older version was using
some hardware revision dependent part of the ROM.
Signed-off-by: Ben Backx <ben@bbackx.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Greg Kroah-Hartman [Fri, 7 Mar 2008 05:30:23 +0000 (21:30 -0800)]
DVB: add firesat driver
Original code written by Christian Dolzer <c.dolzer@digital-everywhere.com>
Cleaned up by Greg.
Major cleanup and reorg by Manu Abraham <manu@linuxtv.org>
Additions also by Ben Backx <ben@bbackx.com>
Cc: Christian Dolzer <c.dolzer@digital-everywhere.com>
Cc: Andreas Monitzer <andy@monitzer.com>
Cc: Manu Abraham <manu@linuxtv.org>
Cc: Fabio De Lorenzo <delorenzo.fabio@gmail.com>
Cc: Robert Berger <robert.berger@reliableembeddedsystems.com>
Signed-off-by: Ben Backx <ben@bbackx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Added missing dependency to dvb/firesat/Kconfig,
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Tweaked dvb/Makefile.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Linus Torvalds [Tue, 24 Feb 2009 04:29:21 +0000 (20:29 -0800)]
Merge git://git./linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
net: amend the fix for SO_BSDCOMPAT gsopt infoleak
netns: build fix for net_alloc_generic
Krzysztof Sachanowicz [Mon, 23 Feb 2009 21:21:55 +0000 (22:21 +0100)]
proc: proc_get_inode should de_put when inode already initialized
de_get is called before every proc_get_inode, but corresponding de_put is
called only when dropping last reference to an inode. This might cause
something like
remove_proc_entry: /proc/stats busy, count=14496
to be printed to the syslog.
The fix is to call de_put in case of an already initialized inode in
proc_get_inode.
Signed-off-by: Krzysztof Sachanowicz <analyzer1@gmail.com>
Tested-by: Marcin Pilipczuk <marcin.pilipczuk@gmail.com>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jesse Barnes [Mon, 23 Feb 2009 23:41:09 +0000 (15:41 -0800)]
i915: suspend/resume interrupt state
In the KMS case, enter/leavevt won't fix up the interrupt handler for
us, so we need to do it at suspend/resume time. Make sure we don't fail
the resume if the chip is hung either.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Karsten Wiese [Mon, 23 Feb 2009 14:07:57 +0000 (15:07 +0100)]
Fix an oops in i915_gem_retire_requests()
dev_priv->hw_status_page can be NULL, if i915_gem_retire_requests()
is called from i915_gem_busy_ioctl().
Signed-off-by Karsten Wiese <fzu@wemgehoertderstaat.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Eugene Teo [Mon, 23 Feb 2009 23:38:41 +0000 (15:38 -0800)]
net: amend the fix for SO_BSDCOMPAT gsopt infoleak
The fix for CVE-2009-0676 (upstream commit
df0bca04) is incomplete. Note
that the same problem of leaking kernel memory will reappear if someone
on some architecture uses struct timeval with some internal padding (for
example tv_sec 64-bit and tv_usec 32-bit) --- then, you are going to
leak the padded bytes to userspace.
Signed-off-by: Eugene Teo <eugeneteo@kernel.sg>
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Clemens Noss [Mon, 23 Feb 2009 23:37:35 +0000 (15:37 -0800)]
netns: build fix for net_alloc_generic
net_alloc_generic was defined in #ifdef CONFIG_NET_NS, but used
unconditionally. Move net_alloc_generic out of #ifdef.
Signed-off-by: Clemens Noss <cnoss@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Mon, 23 Feb 2009 22:38:20 +0000 (14:38 -0800)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: ahash - Fix digest size in /proc/crypto
Linus Torvalds [Mon, 23 Feb 2009 22:36:05 +0000 (14:36 -0800)]
Merge git://git./linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
netns: fix double free at netns creation
veth : add the set_mac_address capability
sunlance: Beyond ARRAY_SIZE of ib->btx_ring
sungem: another error printed one too early
ISDN: fix sc/shmem printk format warning
SMSC: timeout reaches -1
smsc9420: handle magic field of ethtool_eeprom
sundance: missing parentheses?
smsc9420: fix another postfixed timeout
wimax/i2400m: driver loads firmware v1.4 instead of v1.3
vlan: Update skb->mac_header in __vlan_put_tag().
cxgb3: Add support for PCI ID 0x35.
tcp: remove obsoleted comment about different passes
TG3: &&/|| confusion
ATM: misplaced parentheses?
net/mv643xx: don't disable the mib timer too early and lock properly
net/mv643xx: use GFP_ATOMIC while atomic
atl1c: Atheros L1C Gigabit Ethernet driver
net: Kill skb_truesize_check(), it only catches false-positives.
net: forcedeth: Fix wake-on-lan regression
Linus Torvalds [Mon, 23 Feb 2009 04:19:40 +0000 (20:19 -0800)]
Linux 2.6.29-rc6
Randy Dunlap [Mon, 23 Feb 2009 01:05:22 +0000 (17:05 -0800)]
acpi/doc: add missing param value
Add missing parameter value to list of available values
for acpi=<value>.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jan Kara [Mon, 23 Feb 2009 02:09:59 +0000 (21:09 -0500)]
ext4: Fix deadlock in ext4_write_begin() and ext4_da_write_begin()
Functions ext4_write_begin() and ext4_da_write_begin() call
grab_cache_page_write_begin() without AOP_FLAG_NOFS. Thus it
can happen that page reclaim is triggered in that function
and it recurses back into the filesystem (or some other filesystem).
But this can lead to various problems as a transaction is already
started at that point. Add the necessary flag.
http://bugzilla.kernel.org/show_bug.cgi?id=11688
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Linus Torvalds [Mon, 23 Feb 2009 00:26:09 +0000 (16:26 -0800)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm/i915: Add missing mutex_lock(&dev->struct_mutex)
drm/i915: fix WC mapping in non-GEM i915 code.
drm/i915: Fix regression in 95ca9d
drm/i915: Retire requests from i915_gem_busy_ioctl.
drm/i915: suspend/resume GEM when KMS is active
drm/i915: Don't let a device flush to prepare buffers clear new write_domains.
drm/i915: Cut two args to set_to_gpu_domain that confused this tricky path.
Pierre Willenbrock [Mon, 23 Feb 2009 00:12:15 +0000 (10:12 +1000)]
drm/i915: Add missing mutex_lock(&dev->struct_mutex)
there might be a nicer way to fix this but this is the simplest for now.
Signed-off-by: Pierre Willenbrock <pierre@pirsoft.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jesse Barnes [Mon, 23 Feb 2009 00:08:21 +0000 (10:08 +1000)]
drm/i915: fix WC mapping in non-GEM i915 code.
[airlied - taken from mailing list posting]
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Fri, 20 Feb 2009 17:52:20 +0000 (17:52 +0000)]
drm/i915: Fix regression in 95ca9d
The object is dereferenced before the NULL check. Oops.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=20235
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Wed, 18 Feb 2009 17:44:56 +0000 (09:44 -0800)]
drm/i915: Retire requests from i915_gem_busy_ioctl.
This ensures that the user gets the latest information from the hardware
on whether the buffer is busy, potentially reducing the working set of objects
that the user chooses.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jesse Barnes [Tue, 17 Feb 2009 23:13:31 +0000 (15:13 -0800)]
drm/i915: suspend/resume GEM when KMS is active
In the KMS case, we need to suspend/resume GEM as well. So on suspend, make
sure we idle GEM and stop any new rendering from coming in, and on resume,
re-init the framebuffer and clear the suspended flag.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Thu, 19 Feb 2009 22:54:51 +0000 (14:54 -0800)]
drm/i915: Don't let a device flush to prepare buffers clear new write_domains.
The problem was that object_set_to_gpu_domain would set the new write_domains
that are getting set by this batchbuffer, then the accumulated flushes required
for all the objects in preparation for this batchbuffer were posted, and the
brand new write domain would get cleared by the flush being posted. Instead,
hang on to the new (or old if we're not changing it) value and set it after
the flush is queued.
Results from this noticably included conformance test failures from reads
shortly after writes (where the new write domain had been lost and thus not
flushed and waited on), but is a suspected cause of hangs in some apps when
a write domain is lost on a buffer that gets reused for instruction or
commmand state.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Thu, 19 Feb 2009 22:40:50 +0000 (14:40 -0800)]
drm/i915: Cut two args to set_to_gpu_domain that confused this tricky path.
While not strictly required, it helped while thinking about the following
change. This change should be invariant.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Paul Moore [Fri, 20 Feb 2009 21:33:02 +0000 (16:33 -0500)]
selinux: Fix the NetLabel glue code for setsockopt()
At some point we (okay, I) managed to break the ability for users to use the
setsockopt() syscall to set IPv4 options when NetLabel was not active on the
socket in question. The problem was noticed by someone trying to use the
"-R" (record route) option of ping:
# ping -R 10.0.0.1
ping: record route: No message of desired type
The solution is relatively simple, we catch the unlabeled socket case and
clear the error code, allowing the operation to succeed. Please note that we
still deny users the ability to override IPv4 options on socket's which have
NetLabel labeling active; this is done to ensure the labeling remains intact.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
Paul Moore [Fri, 20 Feb 2009 21:32:55 +0000 (16:32 -0500)]
cipso: Fix documentation comment
The CIPSO protocol engine incorrectly stated that the FIPS-188 specification
could be found in the kernel's Documentation directory. This patch corrects
that by removing the comment and directing users to the FIPS-188 documented
hosted online. For the sake of completeness I've also included a link to the
CIPSO draft specification on the NetLabel website.
Thanks to Randy Dunlap for spotting the error and letting me know.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
Linus Torvalds [Sun, 22 Feb 2009 21:26:30 +0000 (13:26 -0800)]
Merge branch 'core/urgent' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'core/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
PM: Split up sysdev_[suspend|resume] from device_power_[down|up], fix
Ingo Molnar [Sun, 22 Feb 2009 21:07:03 +0000 (22:07 +0100)]
PM: Split up sysdev_[suspend|resume] from device_power_[down|up], fix
Impact: module build fix
Fix:
ERROR: "sysdev_resume" [arch/x86/kernel/apm.ko] undefined!
ERROR: "sysdev_suspend" [arch/x86/kernel/apm.ko] undefined!
As these APIs are now used by the APM driver, which can be built
as a module.
Also fix a few extra (and inconsistent) newlines in comment blocks
preceding these functions.
Signed-off-by: Ingo Molnar <mingo@elte.hu>