pandora-kernel.git
12 years agoum: take ldt.h to arch/x86/um/asm/mm_context.h
Al Viro [Thu, 18 Aug 2011 19:10:49 +0000 (20:10 +0100)]
um: take ldt.h to arch/x86/um/asm/mm_context.h

it's x86-only and we have no business playing with it in asm/mmu.h; make
the latter have
struct uml_arch_mm_context arch;
instead of
struct uml_ldt ldt;
and let arch/<subarch>/um/asm/mm_context.h decide what'll be in there.
While we are at it, kill host_ldt.h - it's not needed in part of places
that include it (we want asm/ldt.h in those) and it can be trivially
expanded into the single remaining one.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge signal_{32,64}.c
Al Viro [Thu, 18 Aug 2011 19:10:39 +0000 (20:10 +0100)]
um: merge signal_{32,64}.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: no need to play with save_sp in signal frame setup anymore
Al Viro [Thu, 18 Aug 2011 19:10:29 +0000 (20:10 +0100)]
um: no need to play with save_sp in signal frame setup anymore

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: increase stack growth cushion in pagefault
Al Viro [Thu, 18 Aug 2011 19:10:19 +0000 (20:10 +0100)]
um: increase stack growth cushion in pagefault

analog of [PATCH] i386: let usermode execute the "enter" instruction from
circa 2006.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge HOST_... of registers common on i386 and amd64
Al Viro [Thu, 18 Aug 2011 19:10:09 +0000 (20:10 +0100)]
um: merge HOST_... of registers common on i386 and amd64

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: sanitize paths in sys_call_table* includes
Al Viro [Thu, 18 Aug 2011 19:09:59 +0000 (20:09 +0100)]
um: sanitize paths in sys_call_table* includes

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge os-Linux/tls.c into arch/x86/um/os-Linux/tls.c
Al Viro [Thu, 18 Aug 2011 19:09:49 +0000 (20:09 +0100)]
um: merge os-Linux/tls.c into arch/x86/um/os-Linux/tls.c

it's i386-specific; moreover, analogs on other targets have
incompatible interface - PTRACE_GET_THREAD_AREA does exist
elsewhere, but struct user_desc does *not*

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: move asm/desc.h into arch/x86/um/asm
Al Viro [Thu, 18 Aug 2011 19:09:39 +0000 (20:09 +0100)]
um: move asm/desc.h into arch/x86/um/asm

its only purpose is to shadow the x86 asm/desc.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge host_ldt_{32,64}.h
Al Viro [Thu, 18 Aug 2011 19:09:29 +0000 (20:09 +0100)]
um: merge host_ldt_{32,64}.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge tls_{32,64}.h
Al Viro [Thu, 18 Aug 2011 19:09:19 +0000 (20:09 +0100)]
um: merge tls_{32,64}.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take um_mmu.h to asm/mmu.h, clean asm/mmu_context.h a bit
Al Viro [Thu, 18 Aug 2011 19:09:09 +0000 (20:09 +0100)]
um: take um_mmu.h to asm/mmu.h, clean asm/mmu_context.h a bit

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill useless include of user.h
Al Viro [Thu, 18 Aug 2011 19:08:59 +0000 (20:08 +0100)]
um: kill useless include of user.h

everything in USER_OBJ gets it via -include user.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill um_uaccess.h
Al Viro [Thu, 18 Aug 2011 19:08:49 +0000 (20:08 +0100)]
um: kill um_uaccess.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take mconsole*.h to arch/um/drivers
Al Viro [Thu, 18 Aug 2011 19:08:39 +0000 (20:08 +0100)]
um: take mconsole*.h to arch/um/drivers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take chan_*.h and line.h to arch/um/drivers
Al Viro [Thu, 18 Aug 2011 19:08:29 +0000 (20:08 +0100)]
um: take chan_*.h and line.h to arch/um/drivers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take register_winch_irq() into the caller of is_skas_winch()
Al Viro [Thu, 18 Aug 2011 19:08:19 +0000 (20:08 +0100)]
um: take register_winch_irq() into the caller of is_skas_winch()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill shared/mem_kern.h
Al Viro [Thu, 18 Aug 2011 19:08:09 +0000 (20:08 +0100)]
um: kill shared/mem_kern.h

... nothing declared there exists

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill shared/tlb.h
Al Viro [Thu, 18 Aug 2011 19:07:59 +0000 (20:07 +0100)]
um: kill shared/tlb.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: make flush_tlb_kernel_range_common() static
Al Viro [Thu, 18 Aug 2011 19:07:49 +0000 (20:07 +0100)]
um: make flush_tlb_kernel_range_common() static

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill shared/task.h and HOST_TASK_REGS
Al Viro [Thu, 18 Aug 2011 19:07:39 +0000 (20:07 +0100)]
um: kill shared/task.h and HOST_TASK_REGS

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: shared/syscall.h is not even included
Al Viro [Thu, 18 Aug 2011 19:07:29 +0000 (20:07 +0100)]
um: shared/syscall.h is not even included

... and functions declared in it do not exist

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: don't include kern.h unless it's needed
Al Viro [Thu, 18 Aug 2011 19:07:19 +0000 (20:07 +0100)]
um: don't include kern.h unless it's needed

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: trim kern.h
Al Viro [Thu, 18 Aug 2011 19:07:09 +0000 (20:07 +0100)]
um: trim kern.h

most of the functions in there are not used in anything that ends up
including that header...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: make load_initrd() static, kill shared/initrd.h
Al Viro [Thu, 18 Aug 2011 19:06:59 +0000 (20:06 +0100)]
um: make load_initrd() static, kill shared/initrd.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: bury unused macros around ptrace.h
Al Viro [Thu, 18 Aug 2011 19:06:49 +0000 (20:06 +0100)]
um: bury unused macros around ptrace.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take arch/um/sys-x86 to arch/x86/um
Al Viro [Thu, 18 Aug 2011 19:06:39 +0000 (20:06 +0100)]
um: take arch/um/sys-x86 to arch/x86/um

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge Makefile-{i386,x86_64}
Al Viro [Thu, 18 Aug 2011 19:06:29 +0000 (20:06 +0100)]
um: merge Makefile-{i386,x86_64}

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: trim detritus from Makefile-i386
Al Viro [Thu, 18 Aug 2011 19:06:19 +0000 (20:06 +0100)]
um: trim detritus from Makefile-i386

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: arch_hweight.h is needed only on uml-x86
Al Viro [Thu, 18 Aug 2011 19:06:09 +0000 (20:06 +0100)]
um: arch_hweight.h is needed only on uml-x86

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge kernel_offsets_*.h
Al Viro [Thu, 18 Aug 2011 19:05:59 +0000 (20:05 +0100)]
um: merge kernel_offsets_*.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge skas_ptrace.h 32/64bit variants
Al Viro [Thu, 18 Aug 2011 19:05:49 +0000 (20:05 +0100)]
um: merge skas_ptrace.h 32/64bit variants

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: sysdep/barrier.h is not used for anything
Al Viro [Thu, 18 Aug 2011 19:05:39 +0000 (20:05 +0100)]
um: sysdep/barrier.h is not used for anything

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: shared/process.h is empty now; kill it
Al Viro [Thu, 18 Aug 2011 19:05:29 +0000 (20:05 +0100)]
um: shared/process.h is empty now; kill it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: finish conversion to mcontext_t
Al Viro [Thu, 18 Aug 2011 19:05:19 +0000 (20:05 +0100)]
um: finish conversion to mcontext_t

now we don't mix host and guest signal frame layouts anymore; moreover,
we don't need host's struct sigcontext at all.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: start switching the references to host mcontext_t to its userland type
Al Viro [Thu, 18 Aug 2011 19:05:09 +0000 (20:05 +0100)]
um: start switching the references to host mcontext_t to its userland type

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take userland definition of barrier() to user.h
Al Viro [Thu, 18 Aug 2011 19:04:59 +0000 (20:04 +0100)]
um: take userland definition of barrier() to user.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take system.h out of shared/sysdep
Al Viro [Thu, 18 Aug 2011 19:04:49 +0000 (20:04 +0100)]
um: take system.h out of shared/sysdep

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: fill the handlers array at build time
Al Viro [Thu, 18 Aug 2011 19:04:39 +0000 (20:04 +0100)]
um: fill the handlers array at build time

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: simplify set_handler()
Al Viro [Thu, 18 Aug 2011 19:04:29 +0000 (20:04 +0100)]
um: simplify set_handler()

For one thing, we always block the same signals (IRQ ones - IO, WINCH, VTALRM),
so there's no need to pass sa_mask elements in arguments.  For another, the
flags depend only on whether it's an IRQ signal or not (we add SA_RESTART
for them).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: don't bother blocking SIGARLM and SIGUSR1
Al Viro [Thu, 18 Aug 2011 19:04:19 +0000 (20:04 +0100)]
um: don't bother blocking SIGARLM and SIGUSR1

We used to generate those, but we hadn't done that for a long
time.  No need to bother blocking them for signal handlers.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: switch stub_segv_handler to SA_SIGINFO variant, get rid of magic crap in there
Al Viro [Thu, 18 Aug 2011 19:04:09 +0000 (20:04 +0100)]
um: switch stub_segv_handler to SA_SIGINFO variant, get rid of magic crap in there

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill includes of sysdep/sigcontext.h from stuff built with kernel headers
Al Viro [Thu, 18 Aug 2011 19:03:59 +0000 (20:03 +0100)]
um: kill includes of sysdep/sigcontext.h from stuff built with kernel headers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge arch/um/os-Linux/sys-{i386,x86_64}
Al Viro [Thu, 18 Aug 2011 19:03:49 +0000 (20:03 +0100)]
um: merge arch/um/os-Linux/sys-{i386,x86_64}

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge hard_handler() instances, switch to use of SA_SIGINFO
Al Viro [Thu, 18 Aug 2011 19:03:39 +0000 (20:03 +0100)]
um: merge hard_handler() instances, switch to use of SA_SIGINFO

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill dead code around uaccess
Al Viro [Thu, 18 Aug 2011 19:03:29 +0000 (20:03 +0100)]
um: kill dead code around uaccess

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge arch/um/sys-{i386,x86_64}
Al Viro [Thu, 18 Aug 2011 19:03:19 +0000 (20:03 +0100)]
um: merge arch/um/sys-{i386,x86_64}

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge arch/um/sys-{i386,x86_64}/shared
Al Viro [Thu, 18 Aug 2011 19:03:09 +0000 (20:03 +0100)]
um: merge arch/um/sys-{i386,x86_64}/shared

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: merge arch/um/sys-{i386,x86_64}/asm
Al Viro [Thu, 18 Aug 2011 19:02:59 +0000 (20:02 +0100)]
um: merge arch/um/sys-{i386,x86_64}/asm

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: get rid of unused macros in ptrace_user.h
Al Viro [Thu, 18 Aug 2011 19:02:49 +0000 (20:02 +0100)]
um: get rid of unused macros in ptrace_user.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: get rid of sysdep/sc.h
Al Viro [Thu, 18 Aug 2011 19:02:39 +0000 (20:02 +0100)]
um: get rid of sysdep/sc.h

only sysdep/sigcontext.h uses it and very few definitions are
actually used.  The rest refers to symbols that don't even
exist anymore anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: Get rid of UPT_SET/UPT_REG macros
Al Viro [Thu, 18 Aug 2011 19:02:29 +0000 (20:02 +0100)]
um: Get rid of UPT_SET/UPT_REG macros

the only users are arch getreg()/putreg() and it's easier to handle
it there instead of playing with macros from hell

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take vm-flags.h to sys-*/asm
Al Viro [Thu, 18 Aug 2011 19:02:19 +0000 (20:02 +0100)]
um: take vm-flags.h to sys-*/asm

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: get rid of sysdep/checksum.h
Al Viro [Thu, 18 Aug 2011 19:02:09 +0000 (20:02 +0100)]
um: get rid of sysdep/checksum.h

Move those to sys-.../asm/checksum.h, kill include/asm/checksum.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: trim unused junk from user.h
Al Viro [Thu, 18 Aug 2011 19:01:59 +0000 (20:01 +0100)]
um: trim unused junk from user.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: get rid of kern_constants.h
Al Viro [Thu, 18 Aug 2011 19:01:49 +0000 (20:01 +0100)]
um: get rid of kern_constants.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill a couple of useless includes of kern_constants.h
Al Viro [Thu, 18 Aug 2011 19:01:39 +0000 (20:01 +0100)]
um: kill a couple of useless includes of kern_constants.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: -include user.h for USER_OBJ, trim includes
Al Viro [Thu, 18 Aug 2011 19:01:29 +0000 (20:01 +0100)]
um: -include user.h for USER_OBJ, trim includes

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: take user_constants.h to include/generated
Al Viro [Thu, 18 Aug 2011 19:01:19 +0000 (20:01 +0100)]
um: take user_constants.h to include/generated

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: kill skas_ptregs.h
Al Viro [Thu, 18 Aug 2011 19:01:09 +0000 (20:01 +0100)]
um: kill skas_ptregs.h

It's a plain include of user_constants.h and all (2) users are
including user_constants.h directly prior to that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: switch to -idirafter, get saner kern_constants.h out of that
Al Viro [Thu, 18 Aug 2011 19:00:59 +0000 (20:00 +0100)]
um: switch to -idirafter, get saner kern_constants.h out of that

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: series of __get_user() is costly in sigframe handling
Al Viro [Thu, 18 Aug 2011 19:00:49 +0000 (20:00 +0100)]
um: series of __get_user() is costly in sigframe handling

It's not x86, where __get_user() is a single dereference; here it's
a single ptrace(2) call in host, which obviously costs a lot more.
IOW, it's cheaper to do copy_{to,from}_user() once than bother with
fields one by one...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: make copy_sc() static
Al Viro [Thu, 18 Aug 2011 19:00:39 +0000 (20:00 +0100)]
um: make copy_sc() static

... and kill it in amd64 - not used.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: don't rely on sc.fpstate not having been reassigned prior to rt_sigreturn()
Al Viro [Thu, 18 Aug 2011 19:00:29 +0000 (20:00 +0100)]
um: don't rely on sc.fpstate not having been reassigned prior to rt_sigreturn()

native rt_sigreturn() doesn't...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: switch {rt_,}sigreturn() to set_current_blocked()
Al Viro [Thu, 18 Aug 2011 19:00:19 +0000 (20:00 +0100)]
um: switch {rt_,}sigreturn() to set_current_blocked()

same story as on x86 native...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agoum: use subarch-obj instead of copying...
Al Viro [Thu, 18 Aug 2011 19:00:09 +0000 (20:00 +0100)]
um: use subarch-obj instead of copying...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agovfs: add d_prune dentry operation
Sage Weil [Fri, 28 Oct 2011 17:02:42 +0000 (10:02 -0700)]
vfs: add d_prune dentry operation

This adds a d_prune dentry operation that is called by the VFS prior to
pruning (i.e. unhashing and killing) a hashed dentry from the dcache.
Wrap dentry_lru_del() and use the new _prune() helper in the cases where we
are about to unhash and kill the dentry.

This will be used by Ceph to maintain a flag indicating whether the
complete contents of a directory are contained in the dcache, allowing it
to satisfy lookups and readdir without addition server communication.

Renumber a few DCACHE_* #defines to group DCACHE_OP_PRUNE with the other
DCACHE_OP_ bits.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agovfs: protect i_nlink
Miklos Szeredi [Fri, 28 Oct 2011 12:13:30 +0000 (14:13 +0200)]
vfs: protect i_nlink

Prevent direct modification of i_nlink by making it const and adding a
non-const __i_nlink alias.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agofilesystems: add set_nlink()
Miklos Szeredi [Fri, 28 Oct 2011 12:13:29 +0000 (14:13 +0200)]
filesystems: add set_nlink()

Replace remaining direct i_nlink updates with a new set_nlink()
updater function.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agofilesystems: add missing nlink wrappers
Miklos Szeredi [Fri, 28 Oct 2011 12:13:28 +0000 (14:13 +0200)]
filesystems: add missing nlink wrappers

Replace direct i_nlink updates with the respective updater function
(inc_nlink, drop_nlink, clear_nlink, inode_dec_link_count).

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
12 years agologfs: remove unnecessary nlink setting
Miklos Szeredi [Fri, 28 Oct 2011 12:13:27 +0000 (14:13 +0200)]
logfs: remove unnecessary nlink setting

alloc_inode() initializes i_nlink to 1.  Remove unnecessary
re-initialization.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Joern Engel <joern@logfs.org>
CC: Prasad Joshi <prasadjoshi.linux@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoocfs2: remove unnecessary nlink setting
Miklos Szeredi [Fri, 28 Oct 2011 12:13:26 +0000 (14:13 +0200)]
ocfs2: remove unnecessary nlink setting

alloc_inode() initializes i_nlink to 1.  Remove unnecessary
re-initialization.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Joel Becker <jlbec@evilplan.org>
CC: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agojfs: remove unnecessary nlink setting
Miklos Szeredi [Fri, 28 Oct 2011 12:13:25 +0000 (14:13 +0200)]
jfs: remove unnecessary nlink setting

alloc_inode() initializes i_nlink to 1.  Remove unnecessary
re-initialization.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agohypfs: remove unnecessary nlink setting
Miklos Szeredi [Fri, 28 Oct 2011 12:13:24 +0000 (14:13 +0200)]
hypfs: remove unnecessary nlink setting

alloc_inode() initializes i_nlink to 1.  Remove unnecessary
re-initialization.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agovfs: ignore error on forced remount
Miklos Szeredi [Fri, 28 Oct 2011 12:13:20 +0000 (14:13 +0200)]
vfs: ignore error on forced remount

On emergency remount we want to force MS_RDONLY on the super block
even if ->remount_fs() failed for some reason.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoreadlinkat: ensure we return ENOENT for the empty pathname for normal lookups
Andy Whitcroft [Wed, 2 Nov 2011 08:44:39 +0000 (09:44 +0100)]
readlinkat: ensure we return ENOENT for the empty pathname for normal lookups

Since the commit below which added O_PATH support to the *at() calls, the
error return for readlink/readlinkat for the empty pathname has switched
from ENOENT to EINVAL:

  commit 65cfc6722361570bfe255698d9cd4dccaf47570d
  Author: Al Viro <viro@zeniv.linux.org.uk>
  Date:   Sun Mar 13 15:56:26 2011 -0400

    readlinkat(), fchownat() and fstatat() with empty relative pathnames

This is both unexpected for userspace and makes readlink/readlinkat
inconsistant with all other interfaces; and inconsistant with our stated
return for these pathnames.

As the readlinkat call does not have a flags parameter we cannot use the
AT_EMPTY_PATH approach used in the other calls.  Therefore expose whether
the original path is infact entry via a new user_path_at_empty() path
lookup function.  Use this to determine whether to default to EINVAL or
ENOENT for failures.

Addresses http://bugs.launchpad.net/bugs/817187

[akpm@linux-foundation.org: remove unused getname_flags()]
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agovfs: fix dentry leak in simple_fill_super()
Konstantin Khlebnikov [Tue, 1 Nov 2011 13:12:33 +0000 (16:12 +0300)]
vfs: fix dentry leak in simple_fill_super()

put dentry if inode allocation failed, d_genocide() cannot release it

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoMerge branch 'next/soc' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 04:08:03 +0000 (21:08 -0700)]
Merge branch 'next/soc' of git://git.linaro.org/people/arnd/arm-soc

* 'next/soc' of git://git.linaro.org/people/arnd/arm-soc: (21 commits)
  MAINTAINERS: add ARM/FREESCALE IMX6 entry
  arm/imx: merge i.MX3 and i.MX6
  arm/imx6q: add suspend/resume support
  arm/imx6q: add device tree machine support
  arm/imx6q: add smp and cpu hotplug support
  arm/imx6q: add core drivers clock, gpc, mmdc and src
  arm/imx: add gic_handle_irq function
  arm/imx6q: add core definitions and low-level debug uart
  arm/imx6q: add device tree source
  ARM: highbank: add suspend support
  ARM: highbank: Add cpu hotplug support
  ARM: highbank: add SMP support
  MAINTAINERS: add Calxeda Highbank ARM platform
  ARM: add Highbank core platform support
  ARM: highbank: add devicetree source
  ARM: l2x0: add empty l2x0_of_init
  picoxcell: add a definition of VMALLOC_END
  picoxcell: remove custom ioremap implementation
  picoxcell: add the DTS for the PC7302 board
  picoxcell: add the DTS for pc3x2 and pc3x3 devices
  ...

Fix up trivial conflicts in arch/arm/Kconfig, and some more header file
conflicts in arch/arm/mach-omap2/board-generic.c (as per an ealier merge
by Arnd).

12 years agoMerge branch 'next/dt' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 04:02:35 +0000 (21:02 -0700)]
Merge branch 'next/dt' of git://git.linaro.org/people/arnd/arm-soc

* 'next/dt' of git://git.linaro.org/people/arnd/arm-soc:
  ARM: gic: use module.h instead of export.h
  ARM: gic: fix irq_alloc_descs handling for sparse irq
  ARM: gic: add OF based initialization
  ARM: gic: add irq_domain support
  irq: support domains with non-zero hwirq base
  of/irq: introduce of_irq_init
  ARM: at91: add at91sam9g20 and Calao USB A9G20 DT support
  ARM: at91: dt: at91sam9g45 family and board device tree files
  arm/mx5: add device tree support for imx51 babbage
  arm/mx5: add device tree support for imx53 boards
  ARM: msm: Add devicetree support for msm8660-surf
  msm_serial: Add devicetree support
  msm_serial: Use relative resources for iomem

Fix up conflicts in arch/arm/mach-at91/{at91sam9260.c,at91sam9g45.c}

12 years agoMerge branch 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:58:25 +0000 (20:58 -0700)]
Merge branch 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc

* 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc: (31 commits)
  ARM: OMAP: Warn if omap_ioremap is called before SoC detection
  ARM: OMAP: Move set_globals initialization to happen in init_early
  ARM: OMAP: Map SRAM later on with ioremap_exec()
  ARM: OMAP: Remove calls to SRAM allocations for framebuffer
  ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done
  ARM: OMAP1: Use generic map_io, init_early and init_irq
  arm/dts: OMAP3+: Add mpu, dsp and iva nodes
  arm/dts: OMAP4: Add a main ocp entry bound to l3-noc driver
  ARM: OMAP2+: l3-noc: Add support for device-tree
  ARM: OMAP2+: board-generic: Add i2c static init
  ARM: OMAP2+: board-generic: Add DT support to generic board
  arm/dts: Add support for OMAP3 Beagle board
  arm/dts: Add initial device tree support for OMAP3 SoC
  arm/dts: Add support for OMAP4 SDP board
  arm/dts: Add support for OMAP4 PandaBoard
  arm/dts: Add initial device tree support for OMAP4 SoC
  ARM: OMAP: omap_device: Add a method to build an omap_device from a DT node
  ARM: OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration
  of: Add helpers to get one string in multiple strings property
  ARM: OMAP2+: devices: Remove all omap_device_pm_latency structures
  ...

Fix up trivial header file conflicts in arch/arm/mach-omap2/board-generic.c

12 years agoMerge branch 'next/cross-platform' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:34:22 +0000 (20:34 -0700)]
Merge branch 'next/cross-platform' of git://git.linaro.org/people/arnd/arm-soc

* 'next/cross-platform' of git://git.linaro.org/people/arnd/arm-soc:
  arm/imx: use Kconfig choice for low-level debug UART selection
  ARM: realview: use Kconfig choice for debug UART selection
  ARM: plat-samsung: use Kconfig choice for debug UART selection
  ARM: versatile: convert logical CPU numbers to physical numbers
  ARM: ux500: convert logical CPU numbers to physical numbers
  ARM: shmobile: convert logical CPU numbers to physical numbers
  ARM: msm: convert logical CPU numbers to physical numbers
  ARM: exynos4: convert logical CPU numbers to physical numbers

Fix up trivial conflict (config DEBUG_S3C_UART move/split vs addition of
ARM_KPROBES_TEST option) in arch/arm/Kconfig.debug

12 years agoMerge branch 'next/devel' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:31:25 +0000 (20:31 -0700)]
Merge branch 'next/devel' of git://git.linaro.org/people/arnd/arm-soc

* 'next/devel' of git://git.linaro.org/people/arnd/arm-soc: (50 commits)
  ARM: tegra: update defconfig
  arm/tegra: Harmony: Configure PMC for low-level interrupts
  arm/tegra: device tree support for ventana board
  arm/tegra: add support for ventana pinmuxing
  arm/tegra: prepare Seaboard pinmux code for derived boards
  arm/tegra: pinmux: ioremap registers
  gpio/tegra: Convert to a platform device
  arm/tegra: Convert pinmux driver to a platform device
  arm/dt: Tegra: Add pinmux node to tegra20.dtsi
  arm/tegra: Prep boards for gpio/pinmux conversion to pdevs
  ARM: mx5: fix clock usage for suspend
  ARM i.MX entry-macro.S: remove now unused code
  ARM i.MX boards: use CONFIG_MULTI_IRQ_HANDLER
  ARM i.MX tzic: add handle_irq function
  ARM i.MX avic: add handle_irq function
  ARM: mx25: Add the missing IIM base definition
  ARM i.MX avic: convert to use generic irq chip
  mx31moboard: Add poweroff support
  ARM: mach-qong: Add watchdog support
  ARM: davinci: AM18x: Add wl1271/wlan support
  ...

Fix up conflicts in:
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-mx5/devices-imx53.h
arch/arm/plat-mxc/include/mach/memory.h

12 years agoMerge branch 'next/board' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:25:36 +0000 (20:25 -0700)]
Merge branch 'next/board' of git://git.linaro.org/people/arnd/arm-soc

* 'next/board' of git://git.linaro.org/people/arnd/arm-soc: (34 commits)
  ep93xx: add support Vision EP9307 SoM
  ARM: mxs: Add initial support for DENX MX28
  ARM: EXYNOS4: Add support SMDK4412 Board
  ARM: EXYNOS4: Add MCT support for EXYNOS4412
  ARM: EXYNOS4: Add functions for gic interrupt handling
  ARM: EXYNOS4: Add support clock for EXYNOS4412
  ARM: EXYNOS4: Add support new EXYNOS4412 SoC
  ARM: EXYNOS4: Add support MCT PPI for EXYNOS4212
  ARM: EXYNOS4: Add support PPI in external GIC
  ARM: EXYNOS4: convert boot_params to atag_offset
  ixp4xx: support omicron ixp425 based boards
  ARM: EXYNOS4: Add support SMDK4212 Board
  ARM: EXYNOS4: Add support PM for EXYNOS4212
  ARM: EXYNOS4: Add support clock for EXYNOS4212
  ARM: EXYNOS4: Add support new EXYNOS4212 SoC
  at91: USB-A9G20 C01 & C11 board support
  at91: merge board USB-A9260 and USB-A9263 together
  at91: add support for RSIs EWS board
  ARM: SAMSUNG: Fix mask value for S5P64X0 CPU IDs
  ARM: SAMSUNG: Fix mask for S3C64xx CPU IDs
  ...

12 years agoMerge branch 'next/deletion' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:24:30 +0000 (20:24 -0700)]
Merge branch 'next/deletion' of git://git.linaro.org/people/arnd/arm-soc

* 'next/deletion' of git://git.linaro.org/people/arnd/arm-soc:
  ARM: mach-nuc93x: delete

Fix up trivial delete/edit conflicts in
arch/arm/mach-nuc93x/{Makefile.boot,mach-nuc932evb.c,time.c}

12 years agoMerge branch 'next/pm' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:22:01 +0000 (20:22 -0700)]
Merge branch 'next/pm' of git://git.linaro.org/people/arnd/arm-soc

* 'next/pm' of git://git.linaro.org/people/arnd/arm-soc: (66 commits)
  ARM: CSR: PM: use outer_resume to resume L2 cache
  ARM: CSR: call l2x0_of_init to init L2 cache of SiRFprimaII
  ARM: OMAP: voltage: voltage layer present, even when CONFIG_PM=n
  ARM: CSR: PM: add sleep entry for SiRFprimaII
  ARM: CSR: PM: save/restore irq status in suspend cycle
  ARM: CSR: PM: save/restore timer status in suspend cycle
  OMAP4: PM: TWL6030: add cmd register
  OMAP4: PM: TWL6030: fix ON/RET/OFF voltages
  OMAP4: PM: TWL6030: address 0V conversions
  OMAP4: PM: TWL6030: fix uv to voltage for >0x39
  OMAP4: PM: TWL6030: fix voltage conversion formula
  omap: voltage: add a stub header file for external/regulator use
  OMAP2+: VC: more registers are per-channel starting with OMAP5
  OMAP3+: voltage: update nominal voltage in voltdm_scale() not VC post-scale
  OMAP3+: voltage: rename omap_voltage_get_nom_volt -> voltdm_get_voltage
  OMAP3+: voltdm: final removal of omap_vdd_info
  OMAP3+: voltage: move/rename curr_volt from vdd_info into struct voltagedomain
  OMAP3+: voltage: rename scale and reset functions using voltdm_ prefix
  OMAP3+: VP: combine setting init voltage into common function
  OMAP3+: VP: remove unused omap_vp_get_curr_volt()
  ...

Fix up trivial conflict in arch/arm/mach-prima2/l2x0.c (code removal vs
edit)

12 years agoMerge branch 'next/timer' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:18:05 +0000 (20:18 -0700)]
Merge branch 'next/timer' of git://git.linaro.org/people/arnd/arm-soc

* 'next/timer' of git://git.linaro.org/people/arnd/arm-soc:
  clocksource: fixup ux500 build problems
  ARM: omap: use __devexit_p in dmtimer driver
  ARM: ux500: Reprogram timers upon resume
  ARM: plat-nomadik: timer: Export reset functions
  ARM: plat-nomadik: timer: Add support for periodic timers
  ARM: ux500: Move timer code to separate file
  ARM: ux500: add support for clocksource DBX500 PRCMU
  clocksource: add DBX500 PRCMU Timer support
  ARM: plat-nomadik: MTU sched_clock as an option
  ARM: OMAP: dmtimer: add error handling to export APIs
  ARM: OMAP: dmtimer: low-power mode support
  ARM: OMAP: dmtimer: skip reserved timers
  ARM: OMAP: dmtimer: pm_runtime support
  ARM: OMAP: dmtimer: switch-over to platform device driver
  ARM: OMAP: dmtimer: platform driver
  ARM: OMAP2+: dmtimer: convert to platform devices
  ARM: OMAP1: dmtimer: conversion to platform devices
  ARM: OMAP2+: dmtimer: add device names to flck nodes
  ARM: OMAP: Add support for dmtimer v2 ip

12 years agoMerge branch 'next/driver' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:16:43 +0000 (20:16 -0700)]
Merge branch 'next/driver' of git://git.linaro.org/people/arnd/arm-soc

* 'next/driver' of git://git.linaro.org/people/arnd/arm-soc:
  hw_random: add driver for atmel true hardware random number generator
  ARM: at91: at91sam9g45: add trng clock and platform device
  MX53 Enable the AHCI SATA on MX53 SMD board
  MX53 Enable the AHCI SATA on MX53 LOCO board
  MX53 Enable the AHCI SATA on MX53 ARD board
  AHCI Add the AHCI SATA feature on the MX53 platforms
  Fix pata imx resource
  ARM: imx: Define functions for registering PATA
  ARM: imx: Add PATA clock support
  ARM: imx: Add PATA resources for other i.MX processors
  imx: efika: Enable pata.
  imx51: add pata clock
  imx51: add pata device

Fix up trivial conflict (new selects next to each other from separate
branches for EFIKA_COMMON) in arch/arm/mach-mx5/Kconfig

12 years agoMerge branch 'next/cleanup' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 03:11:00 +0000 (20:11 -0700)]
Merge branch 'next/cleanup' of git://git.linaro.org/people/arnd/arm-soc

* 'next/cleanup' of git://git.linaro.org/people/arnd/arm-soc: (125 commits)
  ARM: mach-mxs: fix machines' initializers order
  mmc: mxcmmc: explicitly includes mach/hardware.h
  arm/imx: explicitly includes mach/hardware.h in pm-imx27.c
  arm/imx: remove mx27_setup_weimcs() from mx27.h
  arm/imx: explicitly includes mach/hardware.h in mach-kzm_arm11_01.c
  arm/imx: remove mx31_setup_weimcs() from mx31.h
  ARM: tegra: devices.c should include devices.h
  ARM: tegra: cpu-tegra: unexport two functions
  ARM: tegra: cpu-tegra: sparse type fix
  ARM: tegra: dma: staticify some tables and functions
  ARM: tegra: tegra2_clocks: don't export some tables
  ARM: tegra: tegra_powergate_is_powered should be static
  ARM: tegra: tegra_rtc_read_ms should be static
  ARM: tegra: tegra_init_cache should be static
  ARM: tegra: pcie: 0 -> NULL changes
  ARM: tegra: pcie: include board.h
  ARM: tegra: pcie: don't cast __iomem pointers
  ARM: tegra: tegra2_clocks: 0 -> NULL changes
  ARM: tegra: tegra2_clocks: don't cast __iomem pointers
  ARM: tegra: timer: don't cast __iomem pointers
  ...

Fix up trivial conflicts in
  arch/arm/mach-omap2/Makefile,
  arch/arm/mach-u300/{Makefile.boot,core.c}
  arch/arm/plat-{mxc,omap}/devices.c

12 years agoMerge branch 'next/fixes' of git://git.linaro.org/people/arnd/arm-soc
Linus Torvalds [Wed, 2 Nov 2011 02:55:06 +0000 (19:55 -0700)]
Merge branch 'next/fixes' of git://git.linaro.org/people/arnd/arm-soc

* 'next/fixes' of git://git.linaro.org/people/arnd/arm-soc: (28 commits)
  ARM: pxa/cm-x300: properly set bt_reset pin
  ARM: mmp: rename SHEEVAD to GPLUGD
  ARM: imx: Fix typo 'MACH_MX31_3DS_MXC_NAND_USE_BBT'
  ARM: i.MX28: shift frac value in _CLK_SET_RATE
  plat-mxc: iomux-v3.h: implicitly enable pull-up/down when that's desired
  ARM: mx5: fix clock usage for suspend
  ARM: pxa: use correct __iomem annotations
  ARM: pxa: sharpsl pm needs SPI
  ARM: pxa: centro and treo680 need palm27x
  ARM: pxa: make pxafb_smart_*() empty when not enabled
  ARM: pxa: select POWER_SUPPLY on raumfeld
  ARM: pxa: pxa95x is incompatible with earlier pxa
  ARM: pxa: CPU_FREQ_TABLE is needed for CPU_FREQ
  ARM: pxa: pxa95x/saarb depends on pxa3xx code
  ARM: pxa: allow selecting just one of TREO680/CENTRO
  ARM: pxa: export symbols from pxa3xx-ulpi
  ARM: pxa: make zylonite_pxa*_init declaration match code
  ARM: pxa/z2: fix building error of pxa27x_cpu_suspend() no longer available
  ARM: at91: add defconfig for at91sam9g45 family
  ARM: at91: remove dependency for Atmel PWM driver selector in Kconfig
  ...

12 years agoMerge branch 'imx/imx6q' into next/soc
Arnd Bergmann [Wed, 2 Nov 2011 01:46:55 +0000 (02:46 +0100)]
Merge branch 'imx/imx6q' into next/soc

Conflicts:
Documentation/devicetree/bindings/arm/fsl.txt
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/plat-mxc/include/mach/common.h

12 years agoMerge branch 'picoxcell/soc' into next/soc
Arnd Bergmann [Wed, 2 Nov 2011 01:46:17 +0000 (02:46 +0100)]
Merge branch 'picoxcell/soc' into next/soc

12 years agoMerge branch 'highbank/soc' into next/soc
Arnd Bergmann [Wed, 2 Nov 2011 01:46:10 +0000 (02:46 +0100)]
Merge branch 'highbank/soc' into next/soc

Conflicts:
arch/arm/mach-mxs/include/mach/gpio.h
arch/arm/mach-omap2/board-generic.c
arch/arm/plat-mxc/include/mach/gpio.h

12 years agovirtio-blk: use ida to allocate disk index
Michael S. Tsirkin [Sun, 30 Oct 2011 19:29:59 +0000 (21:29 +0200)]
virtio-blk: use ida to allocate disk index

Based on a patch by Mark Wu <dwu@redhat.com>

Current index allocation in virtio-blk is based on a monotonically
increasing variable "index". This means we'll run out of numbers
after a while.  It also could cause confusion about the disk
name in the case of hot-plugging disks.
Change virtio-blk to use ida to allocate index, instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: Add platform bus driver for memory mapped virtio device
Pawel Moll [Mon, 24 Oct 2011 13:07:03 +0000 (14:07 +0100)]
virtio: Add platform bus driver for memory mapped virtio device

This patch, based on virtio PCI driver, adds support for memory
mapped (platform) virtio device. This should allow environments
like qemu to use virtio-based block & network devices even on
platforms without PCI support.

One can define and register a platform device which resources
will describe memory mapped control registers and "mailbox"
interrupt. Such device can be also instantiated using the Device
Tree node with compatible property equal "virtio,mmio".

Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Michael S.Tsirkin <mst@redhat.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: Dont add "config" to list for !per_vq_vector
Krishna Kumar [Wed, 5 Oct 2011 05:38:59 +0000 (11:08 +0530)]
virtio: Dont add "config" to list for !per_vq_vector

For the MSI but non-per_vq_vector case, the config/change vq
also gets added to the list of vqs that need to process the
MSI interrupt. This is not needed as config has it's own
handler (vp_config_changed). In any case, vring_interrupt()
finds nothing needs to be done on this vq.

I tested this patch by testing the "Fallback:" and "Finally
fall back" cases in vp_find_vqs(). Please review.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: console: wait for first console port for early console output
Christian Borntraeger [Thu, 22 Sep 2011 18:14:23 +0000 (23:44 +0530)]
virtio: console: wait for first console port for early console output

On s390 I have seen some random

"Warning: unable to open an initial console"

boot failure. Turns out that tty_open fails, because the
hvc_alloc was not yet done. In former times this could not happen,
since the probe function automatically called hvc_alloc. With newer
versions (multiport) some host<->guest interaction is required
before hvc_alloc is called. This might be too late, especially if
an initramfs is involved. Lets use a completion if we have
multiport and an early console.

[Amit:
  * Use NULL instead of 0 for pointer comparison
  * Rename 'port_added' to 'early_console_added'
  * Re-format, re-word commit message
  * Rebase patch on top of current queue]

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Chrstian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: console: add port stats for bytes received, sent and discarded
Amit Shah [Wed, 14 Sep 2011 07:36:46 +0000 (13:06 +0530)]
virtio: console: add port stats for bytes received, sent and discarded

This commit adds port-specific stats for the number of bytes received,
sent and discarded.  They're exposed via the debugfs interface.  This
data can be used to check for data loss bugs (or disprove such claims).
It can also be used for accounting, if there's such a need.

The stats remain valid throughout the lifetime of the port.  Unplugging
a port will reset the stats.  The numbers are not reset across port
opens/closes.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: console: make discard_port_data() use get_inbuf()
Amit Shah [Wed, 14 Sep 2011 07:36:45 +0000 (13:06 +0530)]
virtio: console: make discard_port_data() use get_inbuf()

discard_port_data() used virtqueue_get_buf() directly instead of using
get_inbuf().  Fix this, so that we get accounting for all received
bytes.  This also simplifies the code a lot.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: console: rename variable
Amit Shah [Wed, 14 Sep 2011 07:36:44 +0000 (13:06 +0530)]
virtio: console: rename variable

'ret' is a misnomer in discard_port_data() since we don't return the
value.  Rename it to 'err'.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: console: make get_inbuf() return port->inbuf if present
Amit Shah [Wed, 14 Sep 2011 07:36:43 +0000 (13:06 +0530)]
virtio: console: make get_inbuf() return port->inbuf if present

Instead of pulling in a buffer from the vq each time it's called,
get_inbuf() now checks if the current active buffer, in port->inbuf is
valid.  If it is, just returns a pointer to it.  This ends up
simplifying a lot of code calling get_inbuf() since the check for
port->inbuf being valid was done by all the callers.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: console: Fix return type for get_inbuf()
Amit Shah [Wed, 14 Sep 2011 07:36:42 +0000 (13:06 +0530)]
virtio: console: Fix return type for get_inbuf()

get_inbuf() returns void *.  There's no reason to return void pointers
instead of the correct struct port_buffer *.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>