firefly-linux-kernel-4.4.55.git
13 years agom68knommu: introduce little-endian bitops
Akinobu Mita [Wed, 23 Mar 2011 23:42:00 +0000 (16:42 -0700)]
m68knommu: introduce little-endian bitops

Introduce little-endian bit operations by renaming native ext2 bit
operations.  The ext2 bit operations are kept as wrapper macros using
little-endian bit operations to maintain bisectability until the
conversions are finished.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agobitops: introduce CONFIG_GENERIC_FIND_BIT_LE
Akinobu Mita [Wed, 23 Mar 2011 23:41:59 +0000 (16:41 -0700)]
bitops: introduce CONFIG_GENERIC_FIND_BIT_LE

This introduces CONFIG_GENERIC_FIND_BIT_LE to tell whether to use generic
implementation of find_*_bit_le() in lib/find_next_bit.c or not.

For now we select CONFIG_GENERIC_FIND_BIT_LE for all architectures which
enable CONFIG_GENERIC_FIND_NEXT_BIT.

But m68knommu wants to define own faster find_next_zero_bit_le() and
continues using generic find_next_{,zero_}bit().
(CONFIG_GENERIC_FIND_NEXT_BIT and !CONFIG_GENERIC_FIND_BIT_LE)

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agom68k: introduce little-endian bitops
Akinobu Mita [Wed, 23 Mar 2011 23:41:58 +0000 (16:41 -0700)]
m68k: introduce little-endian bitops

Introduce little-endian bit operations by renaming native ext2 bit
operations and changing find_*_bit_le() to take a "void *".  The ext2 bit
operations are kept as wrapper macros using little-endian bit operations
to maintain bisectability until the conversions are finished.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoarm: introduce little-endian bitops
Akinobu Mita [Wed, 23 Mar 2011 23:41:57 +0000 (16:41 -0700)]
arm: introduce little-endian bitops

Introduce little-endian bit operations by renaming native ext2 bit
operations.  The ext2 and minix bit operations are kept as wrapper macros
using little-endian bit operations to maintain bisectability until the
conversions are finished.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agos390: introduce little-endian bitops
Akinobu Mita [Wed, 23 Mar 2011 23:41:57 +0000 (16:41 -0700)]
s390: introduce little-endian bitops

Introduce little-endian bit operations by renaming native ext2 bit
operations.  The ext2 bit operations are kept as wrapper macros using
little-endian bit operations to maintain bisectability until the
conversions are finished.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agopowerpc: introduce little-endian bitops
Akinobu Mita [Wed, 23 Mar 2011 23:41:56 +0000 (16:41 -0700)]
powerpc: introduce little-endian bitops

Introduce little-endian bit operations by renaming existing powerpc native
little-endian bit operations and changing them to take any pointer types.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoasm-generic: change little-endian bitops to take any pointer types
Akinobu Mita [Wed, 23 Mar 2011 23:41:50 +0000 (16:41 -0700)]
asm-generic: change little-endian bitops to take any pointer types

This makes the little-endian bitops take any pointer types by changing the
prototypes and adding casts in the preprocessor macros.

That would seem to at least make all the filesystem code happier, and they
can continue to do just something like

  #define ext2_set_bit __test_and_set_bit_le

(or whatever the exact sequence ends up being).

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Mikael Starvik <starvik@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Matthew Wilcox <willy@debian.org>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Chris Zankel <chris@zankel.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoasm-generic: rename generic little-endian bitops functions
Akinobu Mita [Wed, 23 Mar 2011 23:41:47 +0000 (16:41 -0700)]
asm-generic: rename generic little-endian bitops functions

As a preparation for providing little-endian bitops for all architectures,
This renames generic implementation of little-endian bitops.  (remove
"generic_" prefix and postfix "_le")

s/generic_find_next_le_bit/find_next_bit_le/
s/generic_find_next_zero_le_bit/find_next_zero_bit_le/
s/generic_find_first_zero_le_bit/find_first_zero_bit_le/
s/generic___test_and_set_le_bit/__test_and_set_bit_le/
s/generic___test_and_clear_le_bit/__test_and_clear_bit_le/
s/generic_test_le_bit/test_bit_le/
s/generic___set_le_bit/__set_bit_le/
s/generic___clear_le_bit/__clear_bit_le/
s/generic_test_and_set_le_bit/test_and_set_bit_le/
s/generic_test_and_clear_le_bit/test_and_clear_bit_le/

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agobitops: merge little and big endian definisions in asm-generic/bitops/le.h
Akinobu Mita [Wed, 23 Mar 2011 23:41:46 +0000 (16:41 -0700)]
bitops: merge little and big endian definisions in asm-generic/bitops/le.h

This patch series introduces little-endian bit operations in asm/bitops.h
for all architectures and converts all ext2 non-atomic and minix bit
operations to use little-endian bit operations.  It enables us to remove
ext2 non-atomic and minix bit operations from asm/bitops.h.  The reason
they should be removed from asm/bitops.h is as follows:

For ext2 non-atomic bit operations, they are used for little-endian byte
order bitmap access by some filesystems and modules.  But using ext2_*()
functions on a module other than ext2 filesystem makes some feel strange.

For minix bit operations, they are only used by minix filesystem and are
useless by other modules.  Because byte order of inode and block bitmap is

This patch:

In order to make the forthcoming changes smaller, this merges macro
definisions in asm-generic/bitops/le.h for big-endian and little-endian as
much as possible.

This also removes unused BITOP_WORD macro.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agords: stop including asm-generic/bitops/le.h directly
Akinobu Mita [Wed, 23 Mar 2011 23:41:45 +0000 (16:41 -0700)]
rds: stop including asm-generic/bitops/le.h directly

asm-generic/bitops/le.h is only intended to be included directly from
asm-generic/bitops/ext2-non-atomic.h or asm-generic/bitops/minix-le.h
which implements generic ext2 or minix bit operations.

This stops including asm-generic/bitops/le.h directly and use ext2
non-atomic bit operations instead.

It seems odd to use ext2_*_bit() on rds, but it will replaced with
__{set,clear,test}_bit_le() after introducing little endian bit operations
for all architectures.  This indirect step is necessary to maintain
bisectability for some architectures which have their own little-endian
bit operations.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Andy Grover <andy.grover@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agokvm: stop including asm-generic/bitops/le.h directly
Akinobu Mita [Wed, 23 Mar 2011 23:41:44 +0000 (16:41 -0700)]
kvm: stop including asm-generic/bitops/le.h directly

asm-generic/bitops/le.h is only intended to be included directly from
asm-generic/bitops/ext2-non-atomic.h or asm-generic/bitops/minix-le.h
which implements generic ext2 or minix bit operations.

This stops including asm-generic/bitops/le.h directly and use ext2
non-atomic bit operations instead.

It seems odd to use ext2_set_bit() on kvm, but it will replaced with
__set_bit_le() after introducing little endian bit operations for all
architectures.  This indirect step is necessary to maintain bisectability
for some architectures which have their own little-endian bit operations.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agofs/adfs/adfs.h: fix unsigned comparison
Andrew Morton [Wed, 23 Mar 2011 23:41:43 +0000 (16:41 -0700)]
fs/adfs/adfs.h: fix unsigned comparison

fs/adfs/adfs.h: In function 'append_filetype_suffix':
fs/adfs/adfs.h:115: warning: comparison is always false due to limited range of data type

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Stuart Swales <stuart.swales.croftnuisk@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoia64: fix build breakage in asm/thread_info.h
Luck, Tony [Wed, 23 Mar 2011 23:41:43 +0000 (16:41 -0700)]
ia64: fix build breakage in asm/thread_info.h

In commit 504f52b5439aaf26d3e2c1d45ec10fce38c8dd27
    mm: NUMA aware alloc_task_struct_node()

Eric Dumazet forgot a "\".  Add it.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoRevert "drm/i915: Don't save/restore hardware status page address register"
Chris Wilson [Wed, 23 Mar 2011 18:16:55 +0000 (18:16 +0000)]
Revert "drm/i915: Don't save/restore hardware status page address register"

This reverts commit a7a75c8f70d6f6a2f16c9f627f938bbee2d32718.

There are two different variations on how Intel hardware addresses the
"Hardware Status Page". One as a location in physical memory and the
other as an offset into the virtual memory of the GPU, used in more
recent chipsets. (The HWS itself is a cacheable region of memory which
the GPU can write to without requiring CPU synchronisation, used for
updating various details of hardware state, such as the position of
the GPU head in the ringbuffer, the last breadcrumb seqno, etc).

These two types of addresses were updated in different locations of code
- one inline with the ringbuffer initialisation, and the other during
device initialisation. (The HWS page is logically associated with
the rings, and there is one HWS page per ring.) During resume, only the
ringbuffers were being re-initialised along with the virtual HWS page,
leaving the older physical address HWS untouched. This then caused a
hang on the older gen3/4 (915GM, 945GM, 965GM) the first time we tried
to synchronise the GPU as the breadcrumbs were never being updated.

Reported-and-tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Jan Niehusmann <jan@gondor.com>
Reported-by: Justin P. Mattock <justinmattock@gmail.com>
Reported-and-tested-by: Michael "brot" Groh <brot@minad.de>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodeal with races in /proc/*/{syscall,stack,personality}
Al Viro [Wed, 23 Mar 2011 19:52:50 +0000 (15:52 -0400)]
deal with races in /proc/*/{syscall,stack,personality}

All of those are rw-r--r-- and all are broken for suid - if you open
a file before the target does suid-root exec, you'll be still able
to access it.  For personality it's not a big deal, but for syscall
and stack it's a real problem.

Fix: check that task is tracable for you at the time of read().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoproc: enable writing to /proc/pid/mem
Stephen Wilson [Sun, 13 Mar 2011 19:49:24 +0000 (15:49 -0400)]
proc: enable writing to /proc/pid/mem

With recent changes there is no longer a security hazard with writing to
/proc/pid/mem.  Remove the #ifdef.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoproc: make check_mem_permission() return an mm_struct on success
Stephen Wilson [Sun, 13 Mar 2011 19:49:23 +0000 (15:49 -0400)]
proc: make check_mem_permission() return an mm_struct on success

This change allows us to take advantage of access_remote_vm(), which in turn
eliminates a security issue with the mem_write() implementation.

The previous implementation of mem_write() was insecure since the target task
could exec a setuid-root binary between the permission check and the actual
write.  Holding a reference to the target mm_struct eliminates this
vulnerability.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoproc: hold cred_guard_mutex in check_mem_permission()
Stephen Wilson [Sun, 13 Mar 2011 19:49:22 +0000 (15:49 -0400)]
proc: hold cred_guard_mutex in check_mem_permission()

Avoid a potential race when task exec's and we get a new ->mm but check against
the old credentials in ptrace_may_access().

Holding of the mutex is implemented by factoring out the body of the code into a
helper function __check_mem_permission().  Performing this factorization now
simplifies upcoming changes and minimizes churn in the diff's.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoproc: disable mem_write after exec
Stephen Wilson [Sun, 13 Mar 2011 19:49:21 +0000 (15:49 -0400)]
proc: disable mem_write after exec

This change makes mem_write() observe the same constraints as mem_read().  This
is particularly important for mem_write as an accidental leak of the fd across
an exec could result in arbitrary modification of the target process' memory.
IOW, /proc/pid/mem is implicitly close-on-exec.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agomm: implement access_remote_vm
Stephen Wilson [Sun, 13 Mar 2011 19:49:20 +0000 (15:49 -0400)]
mm: implement access_remote_vm

Provide an alternative to access_process_vm that allows the caller to obtain a
reference to the supplied mm_struct.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agomm: factor out main logic of access_process_vm
Stephen Wilson [Sun, 13 Mar 2011 19:49:19 +0000 (15:49 -0400)]
mm: factor out main logic of access_process_vm

Introduce an internal helper __access_remote_vm and base access_process_vm on
top of it.  This new method may be called with a NULL task_struct if page fault
accounting is not desired.  This code will be shared with a new address space
accessor that is independent of task_struct.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agomm: use mm_struct to resolve gate vma's in __get_user_pages
Stephen Wilson [Sun, 13 Mar 2011 19:49:18 +0000 (15:49 -0400)]
mm: use mm_struct to resolve gate vma's in __get_user_pages

We now check if a requested user page overlaps a gate vma using the supplied mm
instead of the supplied task.  The given task is now used solely for accounting
purposes and may be NULL.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agomm: arch: rename in_gate_area_no_task to in_gate_area_no_mm
Stephen Wilson [Sun, 13 Mar 2011 19:49:17 +0000 (15:49 -0400)]
mm: arch: rename in_gate_area_no_task to in_gate_area_no_mm

Now that gate vma's are referenced with respect to a particular mm and not a
particular task it only makes sense to propagate the change to this predicate as
well.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Reviewed-by: Michel Lespinasse <walken@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agomm: arch: make in_gate_area take an mm_struct instead of a task_struct
Stephen Wilson [Sun, 13 Mar 2011 19:49:16 +0000 (15:49 -0400)]
mm: arch: make in_gate_area take an mm_struct instead of a task_struct

Morally, the question of whether an address lies in a gate vma should be asked
with respect to an mm, not a particular task.  Moreover, dropping the dependency
on task_struct will help make existing and future operations on mm's more
flexible and convenient.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Reviewed-by: Michel Lespinasse <walken@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agomm: arch: make get_gate_vma take an mm_struct instead of a task_struct
Stephen Wilson [Sun, 13 Mar 2011 19:49:15 +0000 (15:49 -0400)]
mm: arch: make get_gate_vma take an mm_struct instead of a task_struct

Morally, the presence of a gate vma is more an attribute of a particular mm than
a particular task.  Moreover, dropping the dependency on task_struct will help
make both existing and future operations on mm's more flexible and convenient.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Reviewed-by: Michel Lespinasse <walken@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agox86: mark associated mm when running a task in 32 bit compatibility mode
Stephen Wilson [Sun, 13 Mar 2011 19:49:14 +0000 (15:49 -0400)]
x86: mark associated mm when running a task in 32 bit compatibility mode

This patch simply follows the same practice as for setting the TIF_IA32 flag.
In particular, an mm is marked as holding 32-bit tasks when a 32-bit binary is
exec'ed.  Both ELF and a.out formats are updated.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Reviewed-by: Michel Lespinasse <walken@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agox86: add context tag to mark mm when running a task in 32-bit compatibility mode
Stephen Wilson [Sun, 13 Mar 2011 19:49:13 +0000 (15:49 -0400)]
x86: add context tag to mark mm when running a task in 32-bit compatibility mode

This tag is intended to mirror the thread info TIF_IA32 flag.  Will be used to
identify mm's which support 32 bit tasks running in compatibility mode without
requiring a reference to the task itself.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Reviewed-by: Michel Lespinasse <walken@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoauxv: require the target to be tracable (or yourself)
Al Viro [Wed, 16 Feb 2011 03:52:11 +0000 (22:52 -0500)]
auxv: require the target to be tracable (or yourself)

same as for environ, except that we didn't do any checks to
prevent access after suid execve

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoclose race in /proc/*/environ
Al Viro [Wed, 16 Feb 2011 03:26:01 +0000 (22:26 -0500)]
close race in /proc/*/environ

Switch to mm_for_maps().  Maybe we ought to make it r--r--r--,
since we do checks on IO anyway...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoreport errors in /proc/*/*map* sanely
Al Viro [Wed, 16 Feb 2011 03:22:54 +0000 (22:22 -0500)]
report errors in /proc/*/*map* sanely

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agopagemap: close races with suid execve
Al Viro [Wed, 16 Feb 2011 03:04:37 +0000 (22:04 -0500)]
pagemap: close races with suid execve

just use mm_for_maps()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agomake sessionid permissions in /proc/*/task/* match those in /proc/*
Al Viro [Wed, 16 Feb 2011 02:24:05 +0000 (21:24 -0500)]
make sessionid permissions in /proc/*/task/* match those in /proc/*

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoMerge branches 'misc', 'nes' and 'srp' into for-next
Roland Dreier [Wed, 23 Mar 2011 18:13:37 +0000 (11:13 -0700)]
Merge branches 'misc', 'nes' and 'srp' into for-next

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Wed, 23 Mar 2011 14:58:09 +0000 (07:58 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: HDA: Realtek: Avoid unnecessary volume control index on Surround/Side
  ASoC: Support !REGULATOR build for sgtl5000
  ALSA: hda - VIA: Fix VT1708 can't build up Headphone control issue
  ALSA: hda - VIA: Correct stream names for VT1818S
  ALSA: hda - VIA: Fix codec type for VT1708BCE at the right timing
  ALSA: hda - VIA: Fix invalid A-A path volume adjust issue
  ALSA: hda - VIA: Add missing support for VT1718S in A-A path
  ALSA: hda - VIA: Fix independent headphone no sound issue
  ALSA: hda - VIA: Fix stereo mixer recording no sound issue
  ALSA: hda - Set EAPD for Realtek ALC665
  ALSA: usb - Remove trailing spaces from USB card name strings
  sound: read i_size with i_size_read()
  ASoC: Remove bogus check for register validity in debugfs write
  ASoC: mini2440: Fix uda134x codec problem.

13 years agosys_swapon: fix inode locking
Cesar Eduardo Barros [Wed, 23 Mar 2011 02:03:13 +0000 (23:03 -0300)]
sys_swapon: fix inode locking

A conflict between 52c50567d8ab ("mm: swap: unlock swapfile inode mutex
before closing file on bad swapfiles") and 83ef99befc32 ("sys_swapon:
remove did_down variable") caused a double unlock of the inode mutex
(once in bad_swap: before the filp_close, once at the end just before
returning).

The patch which added the extra unlock cleared did_down to avoid
unlocking twice, but the other patch removed the did_down variable.

To fix, set inode to NULL after the first unlock, since it will be used
after that point only for the final unlock.

While checking this patch, I found a path which could unlock without
locking, in case the same inode was added as a swapfile twice. To fix,
move the setting of the inode variable further down, to just before
claim_swapfile, which will lock the inode before doing anything else.

Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Eric B Munson <emunson@mgebm.net>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agosmp: add missing init.h include
Heiko Carstens [Wed, 23 Mar 2011 07:24:58 +0000 (08:24 +0100)]
smp: add missing init.h include

Commit 34db18a054c6 ("smp: move smp setup functions to kernel/smp.c")
causes this build error on s390 because of a missing init.h include:

  CC      arch/s390/kernel/asm-offsets.s
  In file included from /home2/heicarst/linux-2.6/arch/s390/include/asm/spinlock.h:14:0,
  from include/linux/spinlock.h:87,
  from include/linux/seqlock.h:29,
  from include/linux/time.h:8,
  from include/linux/timex.h:56,
  from include/linux/sched.h:57,
  from arch/s390/kernel/asm-offsets.c:10:
  include/linux/smp.h:117:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'setup_nr_cpu_ids'
  include/linux/smp.h:118:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'smp_init'

Fix it by adding the include statement.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: WANG Cong <amwang@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agofix leaks in path_lookupat()
Al Viro [Wed, 23 Mar 2011 13:56:30 +0000 (09:56 -0400)]
fix leaks in path_lookupat()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoMerge branch 'topic/asoc' into for-linus
Takashi Iwai [Wed, 23 Mar 2011 11:05:01 +0000 (12:05 +0100)]
Merge branch 'topic/asoc' into for-linus

13 years agomfd: Push byte swaps out of wm8994 bulk read path
Mark Brown [Fri, 18 Mar 2011 12:50:10 +0000 (12:50 +0000)]
mfd: Push byte swaps out of wm8994 bulk read path

For consistency with the write path push byte swaps of the WM8994 register
data out of the bulk read data path into the per-register APIs. The only
user of the bulk register read is the interrupt code which is updated to
do the swaps itself part of this patch.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Rename ab8500 gpadc header
Linus Walleij [Tue, 15 Mar 2011 13:26:37 +0000 (14:26 +0100)]
mfd: Rename ab8500 gpadc header

Rename AB8500 GPADC header so as not to be redunantly named.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Constify WM8994 write path
Mark Brown [Thu, 17 Mar 2011 21:42:30 +0000 (21:42 +0000)]
mfd: Constify WM8994 write path

Allow const buffers to be passed in without type safety issues.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Push byte swap out of WM8994 bulk I/O
Mark Brown [Thu, 17 Mar 2011 21:42:29 +0000 (21:42 +0000)]
mfd: Push byte swap out of WM8994 bulk I/O

For bulk I/O it is both convenient and more sensible to pre-swap the data
rather than doing the swap as part of the I/O operation so move the byte
swaps we're currently doing into the core write function into the register
based functions, giving the bulk write function a straight pass through
to the chip.

This leaves reads inconsistent, this will be addressed as a followup patch.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Avoid copying data in WM8994 I2C write
Mark Brown [Thu, 17 Mar 2011 21:42:28 +0000 (21:42 +0000)]
mfd: Avoid copying data in WM8994 I2C write

As well as providing a trivial performance optimisation this also avoids
allocating a copy of the message on the stack which is beneficial when
doing large transfers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Remove copy from WM831x I2C write function
Mark Brown [Thu, 17 Mar 2011 21:40:51 +0000 (21:40 +0000)]
mfd: Remove copy from WM831x I2C write function

This saves us allocating an array on the stack, giving a meaningless
performance improvement and ensuring that if drivers ever do large writes
we'll not allocate large arrays on the stack.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Staticise WM8994 PM ops
Mark Brown [Thu, 17 Mar 2011 16:33:49 +0000 (16:33 +0000)]
mfd: Staticise WM8994 PM ops

They're not exported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agoregulator: Add a subdriver for TI TPS6105x regulator portions v2
Linus Walleij [Wed, 9 Mar 2011 12:02:55 +0000 (12:02 +0000)]
regulator: Add a subdriver for TI TPS6105x regulator portions v2

This adds a subdriver for the regulator found inside the TPS61050
and TPS61052 chips.

Cc: Samuel Ortiz <samuel.ortiz@intel.com>
Cc: Ola Lilja <ola.o.lilja@stericsson.com>
Cc: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add a core driver for TI TPS61050/TPS61052 chips v2
Linus Walleij [Wed, 9 Mar 2011 12:02:38 +0000 (13:02 +0100)]
mfd: Add a core driver for TI TPS61050/TPS61052 chips v2

The TPS61050/TPS61052 are boost converters, LED drivers, LED flash
drivers and a simple GPIO pin chips.

Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Jonas Aberg <jonas.aberg@stericsson.com>
Cc: Ola Lilja <ola.o.lilja@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agogpio: Add Tunnel Creek support to sch_gpio
Denis Turischev [Mon, 14 Mar 2011 10:53:05 +0000 (12:53 +0200)]
gpio: Add Tunnel Creek support to sch_gpio

Almost the same driver for both Poulsbo and Tunnel Creek.
The difference is in quantity of GPIOs powered by the core power
rail and by suspend power supply, default values for some GPIOs, etc.
Detect actual hardware by platform device ID assigned in lpc_sch
and set configuration accordingly.

Signed-off-by: Denis Turischev <denis@compulab.co.il>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add Tunnel Creek support to lpc_sch
Denis Turischev [Sun, 13 Mar 2011 15:28:59 +0000 (17:28 +0200)]
mfd: Add Tunnel Creek support to lpc_sch

Intel Poulsbo SCH and Tunnel Creek provide almost the
same LPC interface. Use the same driver for both devices while
storing PCI ID to distinguish between platforms to apply plarform
related quirks.

Signed-off-by: Denis Turischev <denis@compulab.co.il>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agopci_ids: Add Intel Tunnel Creek LPC Bridge device ID.
Denis Turischev [Sun, 13 Mar 2011 15:26:40 +0000 (17:26 +0200)]
pci_ids: Add Intel Tunnel Creek LPC Bridge device ID.

Signed-off-by: Denis Turischev <denis@compulab.co.il>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agoregulator: MAX8997/8966 support
MyungJoo Ham [Fri, 11 Mar 2011 02:34:44 +0000 (11:34 +0900)]
regulator: MAX8997/8966 support

This patch supports PMIC/Regulator part of MAX8997/MAX8966 MFD.
In this initial release, selecting voltages or current-limit
and switching on/off the regulators are supported.

Controlling voltages for DVS with GPIOs is not implemented fully
and requires more considerations: it controls multiple bucks (selection
of 1, 2, and 5) at the same time with SET1~3 gpios. Thus, when DVS-GPIO
is activated, we lose the ability to control the voltage of a single
buck regulator independently; i.e., contolling a buck affects other two
bucks. Therefore, using the conventional regulator framework directly
might be problematic. However, in this driver, we try to choose
a setting without such side effect of affecting other regulators and
then try to choose a setting with the minimum side effect (the sum of
voltage changes in other regulators).

On the other hand, controlling all the three bucks simultenously based
on the voltage set table may help build cpufreq and similar system
more robust; i.e., all the three voltages are consistent every time
without glitches during transition.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add WM8994 bulk register write operation
Mark Brown [Thu, 10 Mar 2011 13:54:07 +0000 (13:54 +0000)]
mfd: Add WM8994 bulk register write operation

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Append additional read write on 88pm860x
Haojian Zhuang [Mon, 7 Mar 2011 15:43:16 +0000 (23:43 +0800)]
mfd: Append additional read write on 88pm860x

Append the additional read/write operation on 88pm860x for accessing
test page in 88PM860x.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Adopt mfd_data in 88pm860x input driver
Haojian Zhuang [Mon, 7 Mar 2011 15:43:12 +0000 (23:43 +0800)]
mfd: Adopt mfd_data in 88pm860x input driver

Copy 88pm860x platform data into different mfd_data structure for
onkey/touch/codec/power driver. So move the identification of
device node from those drivers to mfd driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Adopt mfd_data in 88pm860x regulator
Haojian Zhuang [Mon, 7 Mar 2011 15:43:11 +0000 (23:43 +0800)]
mfd: Adopt mfd_data in 88pm860x regulator

Copy 88pm860x platform data into different mfd_data structure for
regulator driver. So move the identification of device node from
regulator driver to mfd driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Adopt mfd_data in 88pm860x led
Haojian Zhuang [Mon, 7 Mar 2011 15:43:10 +0000 (23:43 +0800)]
mfd: Adopt mfd_data in 88pm860x led

Copy 88pm860x platform data into different mfd_data structure for
led driver. So move the identification of device node from led
driver to mfd driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Adopt mfd_data in 88pm860x backlight
Haojian Zhuang [Mon, 7 Mar 2011 15:43:09 +0000 (23:43 +0800)]
mfd: Adopt mfd_data in 88pm860x backlight

Copy 88pm860x platform data into different mfd_data structure for
backlight driver. So move the identification of device node from
backlight driver to mfd driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Fix MAX8997 Kconfig entry typos
Randy Dunlap [Mon, 14 Mar 2011 10:28:37 +0000 (11:28 +0100)]
mfd: Fix MAX8997 Kconfig entry typos

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add "platform:" prefix for twl4030-madc platform modalias
Axel Lin [Mon, 7 Mar 2011 03:02:29 +0000 (11:02 +0800)]
mfd: Add "platform:" prefix for twl4030-madc platform modalias

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf (platform: prefix MODALIAS
with "platform:"), the platform modalias is prefixed with "platform:".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Fix ab8500-gpadc to measure charger current
Karl Komierowski [Sat, 5 Mar 2011 10:46:45 +0000 (11:46 +0100)]
mfd: Fix ab8500-gpadc to measure charger current

The GPADC in the AB8500 was incorrectly configured when a charger
current channel was selected.

Signed-off-by: Karl Komierowski <karl.komierowski@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Calibrate ab8500 gpadc using OTP values
Johan Palsson [Sat, 5 Mar 2011 10:46:37 +0000 (11:46 +0100)]
mfd: Calibrate ab8500 gpadc using OTP values

The GPADC found in the AB8500 needs to be calibrated to work
properly. This is done by writing a number of special OTP
(one-time-programmable) registers at production. This patch
makes sure that these values are used to calibrate the returned
value from the GPADC so that it is correct.

Signed-off-by: Johan Palsson <johan.palsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Free dangling irq in ab8500 gpadc probe error path
Daniel Willerud [Sat, 5 Mar 2011 10:46:27 +0000 (11:46 +0100)]
mfd: Free dangling irq in ab8500 gpadc probe error path

Signed-off-by: Daniel Willerud <daniel.willerud@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Reentrance and revamp ab8500 gpadc fetching interface
Daniel Willerud [Sat, 5 Mar 2011 10:46:13 +0000 (11:46 +0100)]
mfd: Reentrance and revamp ab8500 gpadc fetching interface

This revamps the interface so that AB8500 GPADCs are fetched by
name. Probed GPADCs are added to a list and this list is searched
for a matching GPADC. This makes it possible to have multiple
AB8500 GPADC instances instead of it being a singleton, and
rids the need to keep a GPADC pointer around in the core AB8500
MFD struct.

Currently the match is made to the device name which is by default
numbered from the device instance such as "ab8500-gpadc.0" but
by using the .init_name field of the device a more intiutive
naming for the GPADC blocks can be achieved if desired.

Signed-off-by: Daniel Willerud <daniel.willerud@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Move ab8500 gpadc header to subdir
Daniel Willerud [Sat, 5 Mar 2011 10:46:01 +0000 (11:46 +0100)]
mfd: Move ab8500 gpadc header to subdir

This moves the ab8500-gpadc.h header down into the ab8500/
subdir in include/linux/mfd and fixes some whitespace in the
header in the process.

Signed-off-by: Daniel Willerud <daniel.willerud@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: MAX8997/8966 support
MyungJoo Ham [Fri, 4 Mar 2011 06:50:26 +0000 (15:50 +0900)]
mfd: MAX8997/8966 support

MAX8997/MAX8966 chip is a multi-function device with I2C bussses. The
chip includes PMIC, RTC, Fuel Gauge, MUIC, Haptic, Flash control, and
Battery (charging) control.

This patch is an initial release of a MAX8997/8966 driver that supports
to enable the chip with its primary I2C bus that connects every device
mentioned above except for Fuel Gauge, which uses another I2C bus. The
fuel gauge is not supported by this mfd driver and is supported by a
seperated driver of MAX17042 Fuel Gauge (yes, the fuel gauge part is
compatible with MAX17042).

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Rename mfd_shared_cell_{en,dis}able to drop the "shared" part
Andres Salomon [Thu, 3 Mar 2011 17:51:58 +0000 (09:51 -0800)]
mfd: Rename mfd_shared_cell_{en,dis}able to drop the "shared" part

As requested by Samuel, there's not really any reason to have "shared"
in the name.

This also modifies the only user of the function, as well.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agow1: Silence ds1wm warnings related to mfd_get_cell changes
Andres Salomon [Tue, 1 Mar 2011 21:55:07 +0000 (13:55 -0800)]
w1: Silence ds1wm warnings related to mfd_get_cell changes

mfd_get_cell returns a const, so change the ds1wm client to store
a const mfd cell.  This silences type mismatch warnings.

Since we're guaranteed to have the mfd_cell, we can also simplify
the code a bit to get rid of a temporary variable and NULL check.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: ab8500-core switch off status added
Mattias Wallin [Wed, 2 Mar 2011 10:52:36 +0000 (11:52 +0100)]
mfd: ab8500-core switch off status added

This patch adds a sysfs file with the ab8500 switch off status.
The switch off status contains information of what caused the ab8500
chip to power off. A print during boot is also added.

Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: ab8500 chip revision 3.0 support
Mattias Wallin [Wed, 2 Mar 2011 10:51:11 +0000 (11:51 +0100)]
mfd: ab8500 chip revision 3.0 support

This patch adds support for ab8500 chip revision cut 3.0.
Also rephrased from Changes to Author in the header.

Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agojz4740: silence warnings related to mfd_get_cell changes
Andres Salomon [Tue, 1 Mar 2011 21:35:48 +0000 (13:35 -0800)]
jz4740: silence warnings related to mfd_get_cell changes

mfd_get_cell returns a const, so change the jz4740 clients to store
a const mfd cell.  This silences type mismatch warnings.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agotmio: Silence warnings introduced by mfd changes
Andres Salomon [Tue, 1 Mar 2011 20:32:20 +0000 (12:32 -0800)]
tmio: Silence warnings introduced by mfd changes

This silences warnings such as

drivers/video/tmiofb.c: In function 'tmiofb_hw_init':
drivers/video/tmiofb.c:270: warning: initialization discards qualifiers from pointer target type

These were added by me in commit 2a79bb1d.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add platform data to support multiple WM831x devices per board
Mark Brown [Tue, 1 Mar 2011 20:12:46 +0000 (20:12 +0000)]
mfd: Add platform data to support multiple WM831x devices per board

If a system contains multiple WM831x devices we need to pass a device
number through to the MFD so that we use unique device IDs when we
instantiate child devices. In order to get support for this into 2.6.39
add some platform data to support the configuration, but no implementation
as yet.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Convert WM8994/58 interrupt masking to enable/disable operations
Mark Brown [Tue, 1 Mar 2011 20:12:45 +0000 (20:12 +0000)]
mfd: Convert WM8994/58 interrupt masking to enable/disable operations

The WM8994/58 interrupt masking support is a much better match for the genirq
enable and disable operations than for the mask and unmask operations. The
latter are intended to used during interrupt handling for temporary changes
which isn't really practical on a slow bus. Convert the operations over to
match this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Convert WM831x interrupt masking to enable/disable operations
Mark Brown [Tue, 1 Mar 2011 20:12:44 +0000 (20:12 +0000)]
mfd: Convert WM831x interrupt masking to enable/disable operations

The WM831x interrupt masking support is a much better match for the genirq
enable and disable operations than for the mask and unmask operations. The
latter are intended to used during interrupt handling for temporary changes
which isn't really practical on a slow bus. Convert the operations over to
match this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agohwmon: twl4030: Hwmon Driver for TWL4030 MADC
Keerthy [Tue, 1 Mar 2011 13:42:36 +0000 (19:12 +0530)]
hwmon: twl4030: Hwmon Driver for TWL4030 MADC

This driver exposes the sysfs nodes of the TWL4030 MADC module.
All the voltage channel values are expressed in terms of mV. Channel 13
and channel 14 are reserved. There are channels which represent
temperature and current the output is represented by celcius
and mA respectively.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add twl4030 madc driver
Keerthy [Tue, 1 Mar 2011 13:42:26 +0000 (19:12 +0530)]
mfd: Add twl4030 madc driver

Introducing a driver for MADC on TWL4030 powerIC. MADC stands for monitoring
ADC. This driver monitors the real time conversion of analog signals like
battery temperature, battery cuurent etc.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add MODULE_DEVICE_TABLE to vx855
Axel Lin [Mon, 28 Feb 2011 06:34:27 +0000 (14:34 +0800)]
mfd: Add MODULE_DEVICE_TABLE to vx855

The device table is required to load modules based on modaliases.
After adding the MODULE_DEVICE_TABLE, below entries will be added to
modules.pcimap:
vx855                0x00001106 0x00008409 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add MODULE_DEVICE_TABLE to pcf50633-core
Axel Lin [Mon, 28 Feb 2011 06:33:12 +0000 (14:33 +0800)]
mfd: Add MODULE_DEVICE_TABLE to pcf50633-core

The device table is required to load modules based on modaliases.
After adding the MODULE_DEVICE_TABLE, below entries will be added to
modules.alias:
alias i2c:pcf50633 pcf50633

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add MODULE_DEVICE_TABLE to mc13xxx-core
Axel Lin [Mon, 28 Feb 2011 06:32:15 +0000 (14:32 +0800)]
mfd: Add MODULE_DEVICE_TABLE to mc13xxx-core

The device table is required to load modules based on modaliases.
After adding the MODULE_DEVICE_TABLE, below entries will be added to
modules.alias:
alias spi:mc13892 mc13xxx_core
alias spi:mc13783 mc13xxx_core

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add sharing for cs5535 acpi/pms cells
Andres Salomon [Fri, 18 Feb 2011 03:07:36 +0000 (19:07 -0800)]
mfd: Add sharing for cs5535 acpi/pms cells

This enables sharing of cs5535-mfd cells via the new mfd_shared_* API.
Hooks for enable/disble of resources are added, with refcounting of
resources being automatically handled so that cs5535_mfd_res_enable/disable
are only called when necessary.

Clients of cs5535-mfd (in this case, olpc-xo1.c) are also modified to
use the mfd_shared API.  The platform drivers are also renamed to
olpc-xo1-{pms,acpi}, and resource enabling/disabling is replaced
with mfd_shared API calls.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: add platform_device sharing support for mfd
Andres Salomon [Fri, 18 Feb 2011 03:07:35 +0000 (19:07 -0800)]
mfd: add platform_device sharing support for mfd

This adds functions to enable platform_device sharing for mfd clients.

Each platform driver (mfd client) that wants to share an mfd_cell's
platform_device uses the mfd_shared_platform_driver_{un,}register()
functions instead of platform_driver_{un,}register().  Along with
registering the platform driver, these also register a new platform
device with the same characteristics as the original cell, but a different
name.  Given an mfd_cell with the name "foo", drivers that want to
share access to its resources can call mfd_shared_platform_driver_register
with platform drivers named (for example) "bar" and "baz".  This
will register two platform devices and drivers named "bar" and "baz"
that share the same cell as the platform device "foo".  The drivers
can then call "foo" cell's enable hooks (or mfd_shared_cell_enable)
to enable resources, and obtain platform resources as they normally
would.

This deals with platform handling only; mfd driver-specific details,
hardware handling, refcounting, etc are all dealt with separately.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add refcounting support to mfd_cells
Andres Salomon [Fri, 18 Feb 2011 03:07:34 +0000 (19:07 -0800)]
mfd: Add refcounting support to mfd_cells

This provides convenience functions for sharing of cells across
multiple mfd clients.  Mfd drivers can provide enable/disable hooks
to actually tweak the hardware, and clients can call
mfd_shared_cell_{en,dis}able without having to worry about whether
or not another client happens to have enabled or disabled the
cell/hardware.

Note that this is purely optional; drivers can continue to use
the mfd_cell's enable/disable hooks for their own purposes, if
desired.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Remove driver_data field from mfd_cell
Andres Salomon [Fri, 18 Feb 2011 03:07:33 +0000 (19:07 -0800)]
mfd: Remove driver_data field from mfd_cell

All users of this have now been switched over to using mfd_data;
it can go away now.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agordc321x-southbridge: Use mfd_data instead of driver_data
Andres Salomon [Fri, 18 Feb 2011 03:07:32 +0000 (19:07 -0800)]
rdc321x-southbridge: Use mfd_data instead of driver_data

Use mfd_data for passing information from mfd drivers to soc
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agofb: Use mfd_data instead of driver_data for tmio-fb
Andres Salomon [Fri, 18 Feb 2011 03:07:31 +0000 (19:07 -0800)]
fb: Use mfd_data instead of driver_data for tmio-fb

Use mfd_data for passing information from mfd drivers to mfd
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().  This changes tmio-fb only; mfd drivers with
other cells are not modified.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomtd: Use mfd_data instead of driver_data for tmio_nand
Andres Salomon [Fri, 18 Feb 2011 03:07:30 +0000 (19:07 -0800)]
mtd: Use mfd_data instead of driver_data for tmio_nand

Use mfd_data for passing information from mfd drivers to mfd
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().  This changes tmio-nand only; mfd drivers with
other cells are not modified.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agommc: Use mfd_data instead of driver_data for tmio-mmc
Andres Salomon [Fri, 18 Feb 2011 03:07:29 +0000 (19:07 -0800)]
mmc: Use mfd_data instead of driver_data for tmio-mmc

Use mfd_data for passing information from mfd drivers to mfd
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().  This changes tmio-mmc only; mfd drivers with
other cells are not modified.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agow1: Use mfd_data instead of driver_data for dsw1wm.c
Andres Salomon [Fri, 18 Feb 2011 03:07:28 +0000 (19:07 -0800)]
w1: Use mfd_data instead of driver_data for dsw1wm.c

Use mfd_data for passing information from mfd drivers to mfd
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().  This changes ds1wm only; mfd drivers with
other cells are not modified, with the exception of led_cell.

The led_cell.driver_data line is dropped from htc-pasic3.c in this
patch as well.  It's not used in mainline (there's no leds-pasic3
platform driver), so it should be safe to take care of that here.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agoasoc: wm8400-codec: Use mfd_data instead of driver_data
Andres Salomon [Fri, 18 Feb 2011 03:07:27 +0000 (19:07 -0800)]
asoc: wm8400-codec: Use mfd_data instead of driver_data

Use mfd_data for passing information from mfd drivers to soc
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agoasoc: davinci_voicecodec: use mfd_data instead of driver_data
Andres Salomon [Mon, 28 Feb 2011 16:24:03 +0000 (17:24 +0100)]
asoc: davinci_voicecodec: use mfd_data instead of driver_data

Use mfd_data for passing information from mfd drivers to soc
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Rename platform_data field of mfd_cell to mfd_data
Andres Salomon [Fri, 18 Feb 2011 03:07:25 +0000 (19:07 -0800)]
mfd: Rename platform_data field of mfd_cell to mfd_data

Rename the platform_data variable to imply a distinction between
common platform_data driver usage (typically accessed via
pdev->dev.platform_data) and the way MFD passes data down to
clients (using a wrapper named mfd_get_data).

All clients have already been changed to use the wrapper function,
so this can be a quick single-commit change that only touches things
in drivers/mfd.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Drop data_size from mfd_cell struct
Andres Salomon [Fri, 18 Feb 2011 03:07:24 +0000 (19:07 -0800)]
mfd: Drop data_size from mfd_cell struct

Now that there are no more users of this, drop it.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mfd_cell is now implicitly available to mc13xxx drivers
Andres Salomon [Fri, 18 Feb 2011 03:07:23 +0000 (19:07 -0800)]
mfd: mfd_cell is now implicitly available to mc13xxx drivers

The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.

Note that mfd-core no longer makes a copy of platform_data, but the
mc13xxx-core driver creates the pdata structures on the stack.  In
order to get around that, the various ARM mach types that set the
pdata have been changed to hold the variable in static (global) memory.
Also note that __initdata references in aforementioned pdata structs
have been dropped.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mfd_cell is now implicitly available to janz drivers
Andres Salomon [Fri, 18 Feb 2011 03:07:22 +0000 (19:07 -0800)]
mfd: mfd_cell is now implicitly available to janz drivers

The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mfd_cell is now implicitly available to tc6387xb drivers
Andres Salomon [Fri, 18 Feb 2011 03:07:21 +0000 (19:07 -0800)]
mfd: mfd_cell is now implicitly available to tc6387xb drivers

No need to explicitly set the cell's platform_data/data_size.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mfd_cell is now implicitly available to twl4030 drivers
Andres Salomon [Fri, 18 Feb 2011 03:07:20 +0000 (19:07 -0800)]
mfd: mfd_cell is now implicitly available to twl4030 drivers

The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mfd_cell is now implicitly available to tc6393xb drivers
Andres Salomon [Fri, 18 Feb 2011 03:07:19 +0000 (19:07 -0800)]
mfd: mfd_cell is now implicitly available to tc6393xb drivers

No need to explicitly set the cell's platform_data/data_size.

Modify clients to use mfd_get_cell helper function instead of
accessing platform_data directly.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mfd_cell is now implicitly available to sh_mobile_sdhi drivers
Andres Salomon [Fri, 18 Feb 2011 03:07:18 +0000 (19:07 -0800)]
mfd: mfd_cell is now implicitly available to sh_mobile_sdhi drivers

No need to explicitly set the cell's platform_data/data_size.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mfd_cell is now implicitly available to wl1273 drivers
Andres Salomon [Fri, 18 Feb 2011 03:07:17 +0000 (19:07 -0800)]
mfd: mfd_cell is now implicitly available to wl1273 drivers

The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mfd_cell is now implicitly available to t7166xb drivers
Andres Salomon [Fri, 18 Feb 2011 03:07:16 +0000 (19:07 -0800)]
mfd: mfd_cell is now implicitly available to t7166xb drivers

No need to explicitly set the cell's platform_data/data_size.

Modify clients to use mfd_get_cell helper function instead of
accessing platform_data directly.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>