]> pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
16 years agoIPC: consolidate sem_exit_ns(), msg_exit_ns() and shm_exit_ns()
Pierre Peiffer [Fri, 8 Feb 2008 12:18:57 +0000 (04:18 -0800)]
IPC: consolidate sem_exit_ns(), msg_exit_ns() and shm_exit_ns()

sem_exit_ns(), msg_exit_ns() and shm_exit_ns() are all called when an
ipc_namespace is released to free all ipcs of each type.  But in fact, they
do the same thing: they loop around all ipcs to free them individually by
calling a specific routine.

This patch proposes to consolidate this by introducing a common function,
free_ipcs(), that do the job.  The specific routine to call on each
individual ipcs is passed as parameter.  For this, these ipc-specific
'free' routines are reworked to take a generic 'struct ipc_perm' as
parameter.

Signed-off-by: Pierre Peiffer <pierre.peiffer@bull.net>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Nadia Derbey <Nadia.Derbey@bull.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoIPC: make struct ipc_ids static in ipc_namespace
Pierre Peiffer [Fri, 8 Feb 2008 12:18:57 +0000 (04:18 -0800)]
IPC: make struct ipc_ids static in ipc_namespace

Each ipc_namespace contains a table of 3 pointers to struct ipc_ids (3 for
msg, sem and shm, structure used to store all ipcs) These 'struct ipc_ids'
are dynamically allocated for each icp_namespace as the ipc_namespace
itself (for the init namespace, they are initialized with pointers to
static variables instead)

It is so for historical reason: in fact, before the use of idr to store the
ipcs, the ipcs were stored in tables of variable length, depending of the
maximum number of ipc allowed.  Now, these 'struct ipc_ids' have a fixed
size.  As they are allocated in any cases for each new ipc_namespace, there
is no gain of memory in having them allocated separately of the struct
ipc_namespace.

This patch proposes to make this table static in the struct ipc_namespace.
Thus, we can allocate all in once and get rid of all the code needed to
allocate and free these ipc_ids separately.

Signed-off-by: Pierre Peiffer <pierre.peiffer@bull.net>
Acked-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Nadia Derbey <Nadia.Derbey@bull.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoIPC/semaphores: consolidate SEM_STAT and IPC_STAT commands
Pierre Peiffer [Fri, 8 Feb 2008 12:18:56 +0000 (04:18 -0800)]
IPC/semaphores: consolidate SEM_STAT and IPC_STAT commands

These commands (SEM_STAT and IPC_STAT) are rather doing the same things
(only the meaning of the id given as input and the return value differ).
However, for the semaphores, they are handled in two different places (two
different functions).

This patch consolidates this for clarification by handling these both
commands in the same place in semctl_nolock().  It also removes one unused
parameter for this function.

Signed-off-by: Pierre Peiffer <pierre.peiffer@bull.net>
Cc: Nadia Derbey <Nadia.Derbey@bull.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoipc: uninline some code from util.h
Pavel Emelyanov [Fri, 8 Feb 2008 12:18:54 +0000 (04:18 -0800)]
ipc: uninline some code from util.h

ipc_lock_check_down(), ipc_lock_check() and ipcget() seem too large to be
inline.  Besides, they give no optimization being inline as they perform
calls inside in any case.

Moving them into ipc/util.c saves 500 bytes of vmlinux and shortens IPC
internal API.

$ ./scripts/bloat-o-meter vmlinux-orig vmlinux
add/remove: 3/2 grow/shrink: 0/10 up/down: 490/-989 (-499)
function                                     old     new   delta
ipcget                                         -     392    +392
ipc_lock_check_down                            -      49     +49
ipc_lock_check                                 -      49     +49
sys_semget                                   119     105     -14
sys_shmget                                   108      86     -22
sys_msgget                                   100      78     -22
do_msgsnd                                    665     631     -34
do_msgrcv                                    680     644     -36
do_shmat                                     771     733     -38
sys_msgctl                                  1302    1229     -73
ipcget_new                                    80       -     -80
sys_semtimedop                              1534    1452     -82
sys_semctl                                  2034    1922    -112
sys_shmctl                                  1919    1765    -154
ipcget_public                                322       -    -322

The ipcget() growth is the result of gcc inlining of currently static
ipcget_new/_public.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Nadia Derbey <Nadia.Derbey@bull.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoserial_core: bring mostly into line with coding style
Alan Cox [Fri, 8 Feb 2008 12:18:53 +0000 (04:18 -0800)]
serial_core: bring mostly into line with coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago8250: enable rate reporting via termios
Alan Cox [Fri, 8 Feb 2008 12:18:53 +0000 (04:18 -0800)]
8250: enable rate reporting via termios

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoserial8250: coding style
Alan Cox [Fri, 8 Feb 2008 12:18:52 +0000 (04:18 -0800)]
serial8250: coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago8250_pci: coding style
Alan Cox [Fri, 8 Feb 2008 12:18:51 +0000 (04:18 -0800)]
8250_pci: coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago8250_hub6: codding style
Alan Cox [Fri, 8 Feb 2008 12:18:51 +0000 (04:18 -0800)]
8250_hub6: codding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago8250_hp300: coding style
Alan Cox [Fri, 8 Feb 2008 12:18:50 +0000 (04:18 -0800)]
8250_hp300: coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago8250_gsc: coding style
Alan Cox [Fri, 8 Feb 2008 12:18:50 +0000 (04:18 -0800)]
8250_gsc: coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago8250_early: coding style
Alan Cox [Fri, 8 Feb 2008 12:18:49 +0000 (04:18 -0800)]
8250_early: coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotty_ioctl: drag screaming into compliance with the coding style
Alan Cox [Fri, 8 Feb 2008 12:18:48 +0000 (04:18 -0800)]
tty_ioctl: drag screaming into compliance with the coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotty_io: drag screaming into coding style compliance
Alan Cox [Fri, 8 Feb 2008 12:18:47 +0000 (04:18 -0800)]
tty_io: drag screaming into coding style compliance

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotty_audit: fix checkpatch complaint
Alan Cox [Fri, 8 Feb 2008 12:18:46 +0000 (04:18 -0800)]
tty_audit: fix checkpatch complaint

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agorocket: don't let random users reset the controller
Alan Cox [Fri, 8 Feb 2008 12:18:45 +0000 (04:18 -0800)]
rocket: don't let random users reset the controller

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agorocket: first pass at termios reporting
Alan Cox [Fri, 8 Feb 2008 12:18:45 +0000 (04:18 -0800)]
rocket: first pass at termios reporting

Also removes a cflag comparison that caused some mode changes to get wrongly
ignored

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agon_tty: clean up old code to follow coding style and (mostly) checkpatch
Alan Cox [Fri, 8 Feb 2008 12:18:44 +0000 (04:18 -0800)]
n_tty: clean up old code to follow coding style and (mostly) checkpatch

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomoxa: first pass at termios reporting
Alan Cox [Fri, 8 Feb 2008 12:18:43 +0000 (04:18 -0800)]
moxa: first pass at termios reporting

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofix "modules: make module_address_lookup() safe"
Andrew Morton [Fri, 8 Feb 2008 12:18:43 +0000 (04:18 -0800)]
fix "modules: make module_address_lookup() safe"

Get the constness right, avoid nasty cast.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomodules: include sections.h to avoid defining linker variables explicitly
Christoph Lameter [Fri, 8 Feb 2008 12:18:42 +0000 (04:18 -0800)]
modules: include sections.h to avoid defining linker variables explicitly

module.c should not define linker variables on its own. We have an include
file for that.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoModules: handle symbols that have a zero value
Christoph Lameter [Fri, 8 Feb 2008 12:18:41 +0000 (04:18 -0800)]
Modules: handle symbols that have a zero value

The module subsystem cannot handle symbols that are zero.  If symbols are
present that have a zero value then the module resolver prints out a
message that these symbols are unresolved.

[akinobu.mita@gmail.com: fix __find_symbl() error checks]
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Kay Sievers <kay.sievers@vrfy.org
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotty: s390 support for termios2.
Heiko Carstens [Fri, 8 Feb 2008 12:18:40 +0000 (04:18 -0800)]
tty: s390 support for termios2.

Backend for s390.

Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotty: let architectures override the user/kernel macros.
Heiko Carstens [Fri, 8 Feb 2008 12:18:39 +0000 (04:18 -0800)]
tty: let architectures override the user/kernel macros.

Give architectures that support the new termios2 the possibilty to overide the
user_termios_to_kernel_termios and kernel_termios_to_user_termios macros.  As
soon as all architectures that use the generic variant have been converted the
ifdefs can go away again.  Architectures in question are avr32, frv, powerpc
and s390.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agointel-iommu: fault_reason index cleanup
mark gross [Fri, 8 Feb 2008 12:18:39 +0000 (04:18 -0800)]
intel-iommu: fault_reason index cleanup

Fix an off by one bug in the fault reason string reporting function, and
clean up some of the code around this buglet.

[akpm@linux-foundation.org: cleanup]
Signed-off-by: mark gross <mgross@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agointel-iommu: PMEN support
mark gross [Fri, 8 Feb 2008 12:18:38 +0000 (04:18 -0800)]
intel-iommu: PMEN support

Add support for protected memory enable bits by clearing them if they are
set at startup time.  Some future boot loaders or firmware could have this
bit set after it loads the kernel, and it needs to be cleared if DMA's are
going to happen effectively.

Signed-off-by: mark gross <mgross@intel.com>
Acked-by: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: fix ->open'less usage due to ->proc_fops flip
Alexey Dobriyan [Fri, 8 Feb 2008 12:18:37 +0000 (04:18 -0800)]
proc: fix ->open'less usage due to ->proc_fops flip

Typical PDE creation code looks like:

pde = create_proc_entry("foo", 0, NULL);
if (pde)
pde->proc_fops = &foo_proc_fops;

Notice that PDE is first created, only then ->proc_fops is set up to
final value. This is a problem because right after creation
a) PDE is fully visible in /proc , and
b) ->proc_fops are proc_file_operations which do not have ->open callback. So, it's
   possible to ->read without ->open (see one class of oopses below).

The fix is new API called proc_create() which makes sure ->proc_fops are
set up before gluing PDE to main tree. Typical new code looks like:

pde = proc_create("foo", 0, NULL, &foo_proc_fops);
if (!pde)
return -ENOMEM;

Fix most networking users for a start.

In the long run, create_proc_entry() for regular files will go.

BUG: unable to handle kernel NULL pointer dereference at virtual address 00000024
printing eip: c1188c1b *pdpt = 000000002929e001 *pde = 0000000000000000
Oops: 0002 [#1] PREEMPT SMP DEBUG_PAGEALLOC
last sysfs file: /sys/block/sda/sda1/dev
Modules linked in: foo af_packet ipv6 cpufreq_ondemand loop serio_raw psmouse k8temp hwmon sr_mod cdrom

Pid: 24679, comm: cat Not tainted (2.6.24-rc3-mm1 #2)
EIP: 0060:[<c1188c1b>] EFLAGS: 00210002 CPU: 0
EIP is at mutex_lock_nested+0x75/0x25d
EAX: 000006fe EBX: fffffffb ECX: 00001000 EDX: e9340570
ESI: 00000020 EDI: 00200246 EBP: e9340570 ESP: e8ea1ef8
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process cat (pid: 24679, ti=E8EA1000 task=E9340570 task.ti=E8EA1000)
Stack: 00000000 c106f7ce e8ee05b4 00000000 00000001 458003d0 f6fb6f20 fffffffb
       00000000 c106f7aa 00001000 c106f7ce 08ae9000 f6db53f0 00000020 00200246
       00000000 00000002 00000000 00200246 00200246 e8ee05a0 fffffffb e8ee0550
Call Trace:
 [<c106f7ce>] seq_read+0x24/0x28a
 [<c106f7aa>] seq_read+0x0/0x28a
 [<c106f7ce>] seq_read+0x24/0x28a
 [<c106f7aa>] seq_read+0x0/0x28a
 [<c10818b8>] proc_reg_read+0x60/0x73
 [<c1081858>] proc_reg_read+0x0/0x73
 [<c105a34f>] vfs_read+0x6c/0x8b
 [<c105a6f3>] sys_read+0x3c/0x63
 [<c10025f2>] sysenter_past_esp+0x5f/0xa5
 [<c10697a7>] destroy_inode+0x24/0x33
 =======================
INFO: lockdep is turned off.
Code: 75 21 68 e1 1a 19 c1 68 87 00 00 00 68 b8 e8 1f c1 68 25 73 1f c1 e8 84 06 e9 ff e8 52 b8 e7 ff 83 c4 10 9c 5f fa e8 28 89 ea ff <f0> fe 4e 04 79 0a f3 90 80 7e 04 00 7e f8 eb f0 39 76 34 74 33
EIP: [<c1188c1b>] mutex_lock_nested+0x75/0x25d SS:ESP 0068:e8ea1ef8

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: fix the threaded /proc/self
Eric W. Biederman [Fri, 8 Feb 2008 12:18:35 +0000 (04:18 -0800)]
proc: fix the threaded /proc/self

Long ago when the CLONE_THREAD support first went it someone thought it
would be wise to point /proc/self at /proc/<tgid> instead of /proc/<pid>.

Given that /proc/<tgid> can return information about a very different task
(if enough things have been unshared) then our current process /proc/<tgid>
seems blatantly wrong.  So far I have yet to think up an example where the
current behavior would be advantageous, and I can see several places where
it is seriously non-intuitive.

We may be stuck with the current broken behavior for backwards
compatibility reasons but lets try fixing our ancient bug for the 2.6.25
time frame and see if anyone screams.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: "Guillaume Chazarain" <guichaz@yahoo.fr>
Cc: "Pavel Emelyanov" <xemul@openvz.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: proper pidns handling for /proc/self
Eric W. Biederman [Fri, 8 Feb 2008 12:18:34 +0000 (04:18 -0800)]
proc: proper pidns handling for /proc/self

Currently if you access a /proc that is not mounted with your processes
current pid namespace /proc/self will point at a completely random task.

This patch fixes /proc/self to point to the current process if it is
available in the particular mount of /proc or to return -ENOENT if the
current process is not visible.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: seqfile convert proc_pid_status to properly handle pid namespaces
Eric W. Biederman [Fri, 8 Feb 2008 12:18:33 +0000 (04:18 -0800)]
proc: seqfile convert proc_pid_status to properly handle pid namespaces

Currently we possibly lookup the pid in the wrong pid namespace.  So
seq_file convert proc_pid_status which ensures the proper pid namespaces is
passed in.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: another build fix]
[akpm@linux-foundation.org: s390 build fix]
[akpm@linux-foundation.org: fix task_name() output]
[akpm@linux-foundation.org: fix nommu build]
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Andrew Morgan <morgan@kernel.org>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Menage <menage@google.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoseqfile convert proc_pid_statm
Eric W. Biederman [Fri, 8 Feb 2008 12:18:32 +0000 (04:18 -0800)]
seqfile convert proc_pid_statm

This conversion is just for code cleanliness, uniformity, and general safety.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: rewrite do_task_stat to correctly handle pid namespaces.
Eric W. Biederman [Fri, 8 Feb 2008 12:18:31 +0000 (04:18 -0800)]
proc: rewrite do_task_stat to correctly handle pid namespaces.

Currently (as pointed out by Oleg) do_task_stat has a race when calling
task_pid_nr_ns with the task exiting.  In addition do_task_stat is not
currently displaying information in the context of the pid namespace that
mounted the /proc filesystem.  So "cut -d' ' -f 1 /proc/<pid>/stat" may not
equal <pid>.

This patch fixes the problem by converting to a single_open seq_file show
method.  Getting the pid namespace from the filesystem superblock instead of
current, and simply using the the struct pid from the inode instead of
attempting to get that same pid from the task.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: implement proc_single_file_operations
Eric W. Biederman [Fri, 8 Feb 2008 12:18:30 +0000 (04:18 -0800)]
proc: implement proc_single_file_operations

Currently many /proc/pid files use a crufty precursor to the current seq_file
api, and they don't have direct access to the pid_namespace or the pid of for
which they are displaying data.

So implement proc_single_file_operations to make the seq_file routines easy to
use, and to give access to the full state of the pid of we are displaying data
for.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: detect duplicate names on registration
Zhang Rui [Fri, 8 Feb 2008 12:18:29 +0000 (04:18 -0800)]
proc: detect duplicate names on registration

Print a warning if PDE is registered with a name which already exists in
target directory.

Bug report and a simple fix can be found here:
http://bugzilla.kernel.org/show_bug.cgi?id=8798

[\n fixlet and no undescriptive variable usage --adobriyan]
[akpm@linux-foundation.org: make printk comprehensible]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: remove useless check on symlink removal
Alexey Dobriyan [Fri, 8 Feb 2008 12:18:28 +0000 (04:18 -0800)]
proc: remove useless check on symlink removal

proc symlinks always have valid ->data containing destination of symlink.  No
need to check it on removal -- proc_symlink() already done it.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: simplify function prototypes
Alexey Dobriyan [Fri, 8 Feb 2008 12:18:27 +0000 (04:18 -0800)]
proc: simplify function prototypes

Move code around so as to reduce the number of forward-declarations.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: less LOCK operations during lookup
Alexey Dobriyan [Fri, 8 Feb 2008 12:18:27 +0000 (04:18 -0800)]
proc: less LOCK operations during lookup

Pseudo-code for lookup effectively is:

LOCK kernel
LOCK proc_subdir_lock
find PDE
UNLOCK proc_subdir_lock

get inode

LOCK proc_subdir_lock
goto unlock
UNLOCK proc_subdir_lock
UNLOCK kernel

We can get rid of LOCK/UNLOCK pair after getting inode simply by jumping
to unlock_kernel() directly.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: remove MODULE_LICENSE
Alexey Dobriyan [Fri, 8 Feb 2008 12:18:26 +0000 (04:18 -0800)]
proc: remove MODULE_LICENSE

proc is not modular, so MODULE_LICENSE just expands to empty space.  proc
without doubts remains GPLed.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonamespaces: mark NET_NS with "depends on NAMESPACES"
Pavel Emelyanov [Fri, 8 Feb 2008 12:18:25 +0000 (04:18 -0800)]
namespaces: mark NET_NS with "depends on NAMESPACES"

There's already an option controlling the net namespaces cloning code, so make
it work the same way as all the other namespaces' options.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Kirill Korotaev <dev@sw.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonamespaces: cleanup the code managed with PID_NS option
Pavel Emelyanov [Fri, 8 Feb 2008 12:18:24 +0000 (04:18 -0800)]
namespaces: cleanup the code managed with PID_NS option

Just like with the user namespaces, move the namespace management code into
the separate .c file and mark the (already existing) PID_NS option as "depend
on NAMESPACES"

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Kirill Korotaev <dev@sw.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonamespaces: cleanup the code managed with the USER_NS option
Pavel Emelyanov [Fri, 8 Feb 2008 12:18:23 +0000 (04:18 -0800)]
namespaces: cleanup the code managed with the USER_NS option

Make the user_namespace.o compilation depend on this option and move the
init_user_ns into user.c file to make the kernel compile and work without the
namespaces support.  This make the user namespace code be organized similar to
other namespaces'.

Also mask the USER_NS option as "depend on NAMESPACES".

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Kirill Korotaev <dev@sw.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonamespaces: move the IPC namespace under IPC_NS option
Pavel Emelyanov [Fri, 8 Feb 2008 12:18:22 +0000 (04:18 -0800)]
namespaces: move the IPC namespace under IPC_NS option

Currently the IPC namespace management code is spread over the ipc/*.c files.
I moved this code into ipc/namespace.c file which is compiled out when needed.

The linux/ipc_namespace.h file is used to store the prototypes of the
functions in namespace.c and the stubs for NAMESPACES=n case.  This is done
so, because the stub for copy_ipc_namespace requires the knowledge of the
CLONE_NEWIPC flag, which is in sched.h.  But the linux/ipc.h file itself in
included into many many .c files via the sys.h->sem.h sequence so adding the
sched.h into it will make all these .c depend on sched.h which is not that
good.  On the other hand the knowledge about the namespaces stuff is required
in 4 .c files only.

Besides, this patch compiles out some auxiliary functions from ipc/sem.c,
msg.c and shm.c files.  It turned out that moving these functions into
namespaces.c is not that easy because they use many other calls and macros
from the original file.  Moving them would make this patch complicated.  On
the other hand all these functions can be consolidated, so I will send a
separate patch doing this a bit later.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Kirill Korotaev <dev@sw.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonamespaces: move the UTS namespace under UTS_NS option
Pavel Emelyanov [Fri, 8 Feb 2008 12:18:21 +0000 (04:18 -0800)]
namespaces: move the UTS namespace under UTS_NS option

Currently all the namespace management code is in the kernel/utsname.c file,
so just compile it out and make stubs in the appropriate header.

The init namespace itself is in init/version.c and is in the kernel all the
time.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Kirill Korotaev <dev@sw.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonamespaces: add the NAMESPACES config option
Pavel Emelyanov [Fri, 8 Feb 2008 12:18:19 +0000 (04:18 -0800)]
namespaces: add the NAMESPACES config option

The option is selectable if EMBEDDED is chosen only.  When the EMBEDDED is off
namespaces will be on.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Kirill Korotaev <dev@sw.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agohugetlb: add locking for overcommit sysctl
Nishanth Aravamudan [Fri, 8 Feb 2008 12:18:18 +0000 (04:18 -0800)]
hugetlb: add locking for overcommit sysctl

When I replaced hugetlb_dynamic_pool with nr_overcommit_hugepages I used
proc_doulongvec_minmax() directly.  However, hugetlb.c's locking rules
require that all counter modifications occur under the hugetlb_lock.  Add a
callback into the hugetlb code similar to the one for nr_hugepages.  Grab
the lock around the manipulation of nr_overcommit_hugepages in
proc_doulongvec_minmax().

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Acked-by: Adam Litke <agl@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinotify: fix check for one-shot watches before destroying them
Ulisses Furquim [Fri, 8 Feb 2008 12:18:16 +0000 (04:18 -0800)]
inotify: fix check for one-shot watches before destroying them

As the IN_ONESHOT bit is never set when an event is sent we must check it
in the watch's mask and not in the event's mask.

Signed-off-by: Ulisses Furquim <ulissesf@gmail.com>
Reported-by: "Clem Taylor" <clem.taylor@gmail.com>
Tested-by: "Clem Taylor" <clem.taylor@gmail.com>
Cc: Amy Griffis <amy.griffis@hp.com>
Cc: Robert Love <rlove@google.com>
Cc: John McCutchan <ttb@tentacle.dhs.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoCRIS v32: Remove hwregs/timer_defs.h, it is now architecture specific.
Jesper Nilsson [Fri, 8 Feb 2008 16:51:15 +0000 (17:51 +0100)]
CRIS v32: Remove hwregs/timer_defs.h, it is now architecture specific.

- File is moved to arch-v32/mach-fs/hwregs/timer_defs.h

16 years agoCRIS v32: Change drivers/i2c.c locking.
Jesper Nilsson [Fri, 8 Feb 2008 16:00:25 +0000 (17:00 +0100)]
CRIS v32: Change drivers/i2c.c locking.

- Change spin_lock + local_irq_save into spin_lock_irqsave
- Change spin_unlock + local_irq_restore into spin_unlock_irqrestore
- Return ENOTTY if ioctl is not recognized as a cris ioctl.
- Make init functions static.

16 years agoCRIS v32: Rewrite ARTPEC-3 gpio driver to avoid volatiles and general cleanup.
Jesper Nilsson [Fri, 8 Feb 2008 15:28:36 +0000 (16:28 +0100)]
CRIS v32: Rewrite ARTPEC-3 gpio driver to avoid volatiles and general cleanup.

Changes as suggested by Andrew Morton, plus general cleanup to
ease later consolidation of driver into machine common driver.

- Correct parameter type of gpio_write to const char __user *
- Remove volatile from the arrays of machine dependent registers, use
  readl and writel to access them instead.
- Remove useless casts of void.
- Use spin_lock_irqsave for locking.
- Break gpio_write into smaller sub-functions.
- Remove useless breaks after returns.
- Don't perform any change in IO_CFG_WRITE_MODE if values are invalid.
  (previously values were set and then set to zero)
- Change cast for copy_to_user to (void __user *)
- Make file_operations gpio_fops static and const.
- Make setget_output static. (However, it's still inline since the CRIS
  architecture is still not SMP, which makes the function small enough
  to inline)

16 years agoEnhanced partition statistics: documentation update
Jerome Marchand [Fri, 8 Feb 2008 10:10:56 +0000 (11:10 +0100)]
Enhanced partition statistics: documentation update

Update the documentation to reflect the change in userspace interface.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoEnhanced partition statistics: remove old partition statistics
Jerome Marchand [Fri, 8 Feb 2008 11:06:21 +0000 (12:06 +0100)]
Enhanced partition statistics: remove old partition statistics

Removes the now unused old partition statistic code.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoEnhanced partition statistics: procfs
Jerome Marchand [Fri, 8 Feb 2008 10:04:56 +0000 (11:04 +0100)]
Enhanced partition statistics: procfs

Reports enhanced partition statistics in /proc/diskstats.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
16 years agoEnhanced partition statistics: sysfs
Jerome Marchand [Fri, 8 Feb 2008 10:04:55 +0000 (11:04 +0100)]
Enhanced partition statistics: sysfs

Reports enhanced partition statistics in sysfs.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
16 years agoEnhanced partition statistics: aoe fix
Jerome Marchand [Fri, 8 Feb 2008 10:04:53 +0000 (11:04 +0100)]
Enhanced partition statistics: aoe fix

Updates the enhanced partition statistics in ATA over Ethernet driver
(not tested).

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
16 years agoEnhanced partition statistics: update partition statitics
Jerome Marchand [Fri, 8 Feb 2008 10:04:35 +0000 (11:04 +0100)]
Enhanced partition statistics: update partition statitics

Updates the enhanced partition statistics in generic block layer
besides the disk statistics.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoEnhanced partition statistics: core statistics
Jerome Marchand [Fri, 8 Feb 2008 10:04:09 +0000 (11:04 +0100)]
Enhanced partition statistics: core statistics

This patch contain the core infrastructure of enhanced partition
statistics. It adds to struct hd_struct the same stats data as struct
gendisk and define basics function to manipulate them.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblock: fixup rq_init() a bit
Jens Axboe [Fri, 8 Feb 2008 11:41:03 +0000 (12:41 +0100)]
block: fixup rq_init() a bit

Rearrange fields in cache order and initialize some fields that
we didn't previously init. Remove init of ->completion_data, it's
part of a union with ->hash. Luckily clearing the rb node is the same
as setting it to null!

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoCRIS: Add new timerfd syscall entries.
Jesper Nilsson [Fri, 8 Feb 2008 10:54:30 +0000 (11:54 +0100)]
CRIS: Add new timerfd syscall entries.

16 years agoMAINTAINERS: Add my information for the CRIS port.
Jesper Nilsson [Fri, 25 Jan 2008 12:22:29 +0000 (13:22 +0100)]
MAINTAINERS: Add my information for the CRIS port.

16 years agoCRIS v32: Correct spelling of bandwidth in function name.
Jesper Nilsson [Fri, 8 Feb 2008 09:44:05 +0000 (10:44 +0100)]
CRIS v32: Correct spelling of bandwidth in function name.

16 years agoCRIS v32: Clean up nandflash.c for ARTPEC-3 and ETRAX FS.
Jesper Nilsson [Fri, 8 Feb 2008 09:24:41 +0000 (10:24 +0100)]
CRIS v32: Clean up nandflash.c for ARTPEC-3 and ETRAX FS.

Clean up issues noticed by Andrew Morton:

- Use a combined struct for allocating the mtd_info and nand_chip structs
  instead of using anonymous memory as the example in
  Documentation/DocBook/mtdnand.tmpl
- Use kzalloc instead of using kmalloc/memset(0)
- Make crisv32_device_ready static.

16 years agoCRIS v10: Cleanup of drivers/gpio.c
Jesper Nilsson [Wed, 6 Feb 2008 13:52:40 +0000 (14:52 +0100)]
CRIS v10: Cleanup of drivers/gpio.c

- Change parameters of gpio_write (const char * buf -> const char __user *buf)
- Don't initialize static variables to zero.
- Remove useless casts from void.
- Change name of interrupt routine (gpio_pa_interrupt -> gpio_interrupt)
- Use kzmalloc instead of allocating memory and zeroing it manually.
- Correct casts for copy_to_user and copy_from_user to (void __user *)
- Make file_operations gpio_fops static.
- Make ioif_watcher static, not used outside this file.

16 years agoCRIS v10: drivers/net/cris/eth_v10.c rename LED defines to CRIS_LED to avoid name...
Jesper Nilsson [Wed, 6 Feb 2008 12:35:07 +0000 (13:35 +0100)]
CRIS v10: drivers/net/cris/eth_v10.c rename LED defines to CRIS_LED to avoid name clash.

16 years agoCRIS: Make io_pwm_set_period members unsigned in etraxgpio.h
Jesper Nilsson [Wed, 6 Feb 2008 12:33:32 +0000 (13:33 +0100)]
CRIS: Make io_pwm_set_period members unsigned in etraxgpio.h

16 years agoCRIS: Move ETRAX_AXISFLASHMAP to common Kconfig file.
Jesper Nilsson [Wed, 6 Feb 2008 12:21:28 +0000 (13:21 +0100)]
CRIS: Move ETRAX_AXISFLASHMAP to common Kconfig file.

16 years agoCRIS: Drop regs parameter from call to profile_tick in kernel/time.c
Jesper Nilsson [Thu, 31 Jan 2008 16:56:24 +0000 (17:56 +0100)]
CRIS: Drop regs parameter from call to profile_tick in kernel/time.c

16 years agoCRIS v32: Fix minor formatting issue in mach-a3/io.c
Jesper Nilsson [Tue, 29 Jan 2008 17:54:55 +0000 (18:54 +0100)]
CRIS v32: Fix minor formatting issue in mach-a3/io.c

16 years agoCRIS v32: Initialize GIO even if we're rambooting in kernel/head.S
Jesper Nilsson [Tue, 29 Jan 2008 17:54:05 +0000 (18:54 +0100)]
CRIS v32: Initialize GIO even if we're rambooting in kernel/head.S

16 years agoCRIS v32: Remove kernel/arbiter.c, it now exists in machine dependent directory.
Jesper Nilsson [Tue, 29 Jan 2008 17:52:42 +0000 (18:52 +0100)]
CRIS v32: Remove kernel/arbiter.c, it now exists in machine dependent directory.

16 years agoCRIS v32: Minor changes to avoid errors in asm-cris/arch-v32/hwregs/reg_rdwr.h
Jesper Nilsson [Tue, 29 Jan 2008 09:43:05 +0000 (10:43 +0100)]
CRIS v32: Minor changes to avoid errors in asm-cris/arch-v32/hwregs/reg_rdwr.h

- Add ifdef around macros to read and write hardware registers
- Add parens around REG_READ expression to avoid possible precedence errors.
- Remove useless CVS id tag.

16 years agoCRIS v32: arch-v32/hwregs/intr_vect_defs.h moved to machine dependent directory.
Jesper Nilsson [Tue, 29 Jan 2008 09:37:33 +0000 (10:37 +0100)]
CRIS v32: arch-v32/hwregs/intr_vect_defs.h moved to machine dependent directory.

16 years agoCRIS v32: Correct offset for TASK_pid in asm-cris/arch-v32/offset.h
Jesper Nilsson [Mon, 28 Jan 2008 17:15:11 +0000 (18:15 +0100)]
CRIS v32: Correct offset for TASK_pid in asm-cris/arch-v32/offset.h

16 years agoCRIS v32: Move register map header to machine dependent directory.
Jesper Nilsson [Mon, 28 Jan 2008 17:13:50 +0000 (18:13 +0100)]
CRIS v32: Move register map header to machine dependent directory.

This file is machine dependent, and needs to be in
asm-cris/arch-v32/mach-fs/hwregs/reg_map.h instead.

16 years agoCRIS v32: Let compiler know that memory is clobbered after a break op.
Jesper Nilsson [Mon, 28 Jan 2008 17:11:29 +0000 (18:11 +0100)]
CRIS v32: Let compiler know that memory is clobbered after a break op.

16 years agoCRIS v32: Remove SMP stub from asm-cris/arch-v32/system.h
Jesper Nilsson [Mon, 28 Jan 2008 17:08:44 +0000 (18:08 +0100)]
CRIS v32: Remove SMP stub from asm-cris/arch-v32/system.h

CRIS v32 is not SMP.

16 years agoCRIS v32: Completely rework spinlocks for ETRAX FS and ARTPEC-3
Jesper Nilsson [Mon, 28 Jan 2008 17:07:58 +0000 (18:07 +0100)]
CRIS v32: Completely rework spinlocks for ETRAX FS and ARTPEC-3

16 years agoCRIS v32: Change name for simulator config in asm-cris/arch-v32/processor.h
Jesper Nilsson [Mon, 28 Jan 2008 17:06:43 +0000 (18:06 +0100)]
CRIS v32: Change name for simulator config in asm-cris/arch-v32/processor.h

16 years agoCRIS v32: Add prototype for crisv32_pinmux_dealloc_fixed in asm-cris/arch-v32/pinmux.h
Jesper Nilsson [Mon, 28 Jan 2008 17:06:11 +0000 (18:06 +0100)]
CRIS v32: Add prototype for crisv32_pinmux_dealloc_fixed in asm-cris/arch-v32/pinmux.h

Deallocation was not possible before, but is now.

16 years agoCRIS v32: Change name for simulator config in asm-cris/arch-v32/page.h
Jesper Nilsson [Mon, 28 Jan 2008 17:04:46 +0000 (18:04 +0100)]
CRIS v32: Change name for simulator config in asm-cris/arch-v32/page.h

Also, fix a typo.

16 years agoCRIS v32: Remove juliette.h, it is not supported for CRIS v32.
Jesper Nilsson [Mon, 28 Jan 2008 17:03:26 +0000 (18:03 +0100)]
CRIS v32: Remove juliette.h, it is not supported for CRIS v32.

16 years agoCRIS v32: Add support for ETRAX FS and ARTPEC-3 for arch-v32/hwregs/eth_defs.h
Jesper Nilsson [Mon, 28 Jan 2008 16:56:56 +0000 (17:56 +0100)]
CRIS v32: Add support for ETRAX FS and ARTPEC-3 for arch-v32/hwregs/eth_defs.h

- A couple of fields have changed name:
reg_eth_rw_ga_lo.table -> tbl
reg_eth_rw_ga_hi.table -> tbl
reg_eth_rw_gen_ctrl.flow_ctrl_dis -> flow_ctrl

- Add some new register fields.
reg_eth_rw_gen_ctrl.gtxclk_out
reg_eth_rw_gen_ctrl.phyrst_n
reg_eth_rw_tr_ctrl.carrier_ext

- max_size in reg_eth_rw_rec_ctrl had the wrong size.

- Registers reg_eth_rw_mgm_ctrl and reg_eth_r_stat was reworked completely.

16 years agoCRIS v32: Rename variable used in macro for arch-v32/hwregs/dma.h
Jesper Nilsson [Mon, 28 Jan 2008 16:42:17 +0000 (17:42 +0100)]
CRIS v32: Rename variable used in macro for arch-v32/hwregs/dma.h

The old name "r" would quite often produce warnings when other
variables with the same name was shadowed. Rename it __x to
make it more unlikely to happen.

16 years agoCRIS v32: Remove useless CVS id tag from arch-v32/hwregs/Makefile
Jesper Nilsson [Mon, 28 Jan 2008 15:55:21 +0000 (16:55 +0100)]
CRIS v32: Remove useless CVS id tag from arch-v32/hwregs/Makefile

16 years agoCRIS v32: Add defines for udelay and ndelay in arch-v32/delay.h
Jesper Nilsson [Mon, 28 Jan 2008 15:54:51 +0000 (16:54 +0100)]
CRIS v32: Add defines for udelay and ndelay in arch-v32/delay.h

Both of these are implemented using cris_delay10ns().

16 years agoCRIS v32: Adjust arch-v32/atomic.h for new spinlock/rwlock infrastructure
Jesper Nilsson [Mon, 28 Jan 2008 15:53:19 +0000 (16:53 +0100)]
CRIS v32: Adjust arch-v32/atomic.h for new spinlock/rwlock infrastructure

16 years agoCRIS v32: Add missing header to include/asm-cris/arch-v32/Kbuild
Jesper Nilsson [Mon, 28 Jan 2008 15:51:31 +0000 (16:51 +0100)]
CRIS v32: Add missing header to include/asm-cris/arch-v32/Kbuild

16 years agoCRIS: Break long comment line in include/asm-cris/arch-v10/page.h
Jesper Nilsson [Mon, 28 Jan 2008 15:50:32 +0000 (16:50 +0100)]
CRIS: Break long comment line in include/asm-cris/arch-v10/page.h

16 years agoCRIS: Rename LED macros to CRIS_LED to avoid name clash in io.h
Jesper Nilsson [Mon, 28 Jan 2008 15:49:39 +0000 (16:49 +0100)]
CRIS: Rename LED macros to CRIS_LED to avoid name clash in io.h

This is done to avoid collision with linux/leds.h

16 years agoCRIS: Add missing headers to include/asm-cris Kbuild files.
Jesper Nilsson [Thu, 31 Jan 2008 16:40:37 +0000 (17:40 +0100)]
CRIS: Add missing headers to include/asm-cris Kbuild files.

16 years agoCRIS: Add sched_clock to kernel/time.c
Jesper Nilsson [Mon, 28 Jan 2008 15:40:21 +0000 (16:40 +0100)]
CRIS: Add sched_clock to kernel/time.c

Also, clean up some whitespace errors.

16 years agoCRIS: Register cpus in kernel/setup.c
Jesper Nilsson [Mon, 28 Jan 2008 15:39:00 +0000 (16:39 +0100)]
CRIS: Register cpus in kernel/setup.c

Also, fix some white space errors, and constify cpuinfo_op.

16 years agoCRIS: Remove include of linux/init.h, not needed anymore.
Jesper Nilsson [Mon, 28 Jan 2008 15:34:30 +0000 (16:34 +0100)]
CRIS: Remove include of linux/init.h, not needed anymore.

16 years agoCRIS: Remove CONFIG_NO_IOMEM from ARTPEC-3 default config.
Jesper Nilsson [Mon, 28 Jan 2008 15:33:21 +0000 (16:33 +0100)]
CRIS: Remove CONFIG_NO_IOMEM from ARTPEC-3 default config.

16 years agoCRIS: Remove useless CVS log from kernel/ptrace.c
Jesper Nilsson [Mon, 28 Jan 2008 15:30:35 +0000 (16:30 +0100)]
CRIS: Remove useless CVS log from kernel/ptrace.c

Also, fix some whitespace errors.

16 years agoCRIS: Remove useless CVS id and log from kernel/process.c
Jesper Nilsson [Mon, 28 Jan 2008 15:29:21 +0000 (16:29 +0100)]
CRIS: Remove useless CVS id and log from kernel/process.c

16 years agoCRIS: Add configuration possibility for using kmalloc for modules.
Jesper Nilsson [Mon, 28 Jan 2008 15:28:10 +0000 (16:28 +0100)]
CRIS: Add configuration possibility for using kmalloc for modules.

Using kmalloc instead of vmalloc solves the stability problems
experienced by some 100 LX products.

16 years agoCRIS: Remove CONFIG_NO_IOMEM from default configs.
Jesper Nilsson [Mon, 28 Jan 2008 15:25:13 +0000 (16:25 +0100)]
CRIS: Remove CONFIG_NO_IOMEM from default configs.

16 years agoCRIS v32: Fix startup oops and replace hardcoded pagesize in vmlinux.lds.S
Jesper Nilsson [Wed, 30 Jan 2008 11:57:31 +0000 (12:57 +0100)]
CRIS v32: Fix startup oops and replace hardcoded pagesize in vmlinux.lds.S

- Move alignment of init data to page size outside define CONFIG_BLK_DEV_INITRD
  This avoids oops due to memory on the same page as init data being freed.
- Change hardcoded page size to use macro from asm/page.h
- Add reserved memory via CONFIG_ETRAX_VMEM_SIZE.
- Use available defines for TEXT_TEXT and INITCALLS.
- Cleanup whitespace.

16 years agoCRIS v32: Avoid work when switching between tasks with shared memory descriptors...
Jesper Nilsson [Fri, 25 Jan 2008 17:08:07 +0000 (18:08 +0100)]
CRIS v32: Avoid work when switching between tasks with shared memory descriptors in mm/tlb.c

There is no need to do all this work if they share memory descriptors.
Also, fix some minor whitespace and long lines.

16 years agoCRIS v32: Add workaround for MMU hardware bug for ETRAX FS in mm/mmu.S
Jesper Nilsson [Fri, 25 Jan 2008 17:05:12 +0000 (18:05 +0100)]
CRIS v32: Add workaround for MMU hardware bug for ETRAX FS in mm/mmu.S