pandora-kernel.git
12 years agoext4: use kzalloc in ext4_kzalloc()
Mathias Krause [Wed, 3 Aug 2011 18:57:11 +0000 (14:57 -0400)]
ext4: use kzalloc in ext4_kzalloc()

Commit 9933fc0i (ext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and
ext4_kvfree()) intruduced wrappers around k*alloc/vmalloc but introduced
a typo for ext4_kzalloc() by not using kzalloc() but kmalloc().

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoxen/self-balloon: Add dependency on tmem.
Konrad Rzeszutek Wilk [Sat, 30 Jul 2011 15:21:09 +0000 (11:21 -0400)]
xen/self-balloon: Add dependency on tmem.

Without enabling CONFIG_XEN_TMEM we get this:

drivers/xen/xen-selfballoon.c:461: undefined reference to `tmem_enabled'

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/balloon: Fix compile errors - missing header files.
Konrad Rzeszutek Wilk [Fri, 22 Jul 2011 18:01:16 +0000 (14:01 -0400)]
xen/balloon: Fix compile errors - missing header files.

With a specific enough .config file compile errors show
for missing workqueue declarations.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/grant: Fix compile warning.
Konrad Rzeszutek Wilk [Fri, 22 Jul 2011 18:00:06 +0000 (14:00 -0400)]
xen/grant: Fix compile warning.

drivers/xen/grant-table.c:85: warning: ‘rc’ may be used uninitialized in this function

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/pciback: remove duplicated #include
Huang Weiyi [Sat, 23 Jul 2011 08:21:57 +0000 (16:21 +0800)]
xen/pciback: remove duplicated #include

Remove duplicated #include('s) in
  drivers/xen/xen-pciback/xenbus.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agodrm/i915: Try enabling RC6 by default (again)
Keith Packard [Wed, 3 Aug 2011 17:52:24 +0000 (10:52 -0700)]
drm/i915: Try enabling RC6 by default (again)

Jesse Barnes and I found a couple of issues where incorrect mode
setting would cause problems with RC6 enabled. We're hopeful that
fixing those will resolve the outstanding issues with a few machines
that had trouble before 3.0 with rc6.

Cc: Pekka Enberg <penberg@kernel.org>
Cc: Francesco Allertsen <fallertsen@gmail.com>
Cc: Ted Phelps <phelps@gnusto.com>
Cc: Gu Rui <chaos.proton@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38567
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=38332
Signed-off-by: Keith Packard <keithp@keithp.com>
12 years agoMerge branch 'drm-intel-fixes' into drm-intel-next
Keith Packard [Wed, 3 Aug 2011 17:41:19 +0000 (10:41 -0700)]
Merge branch 'drm-intel-fixes' into drm-intel-next

12 years agoRevert "drm/i915/dp: Zero the DPCD data before connection probe"
Keith Packard [Wed, 3 Aug 2011 17:34:58 +0000 (10:34 -0700)]
Revert "drm/i915/dp: Zero the DPCD data before connection probe"

This reverts commit 97cdd7101079adc3c626d159c62d43de949516c8.

Clearing the dpcd data means that if the fetch fails, any previous
data will be lost. On eDP, this is no fun as we only fetch dpcd at
init time, so the memset will destroy that the next time through.

12 years agoMerge branch 'apei' into apei-release
Len Brown [Wed, 3 Aug 2011 15:30:42 +0000 (11:30 -0400)]
Merge branch 'apei' into apei-release

Some trivial conflicts due to other various merges
adding to the end of common lists sooner than this one.

arch/ia64/Kconfig
arch/powerpc/Kconfig
arch/x86/Kconfig
lib/Kconfig
lib/Makefile

Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoACPI, APEI, EINJ Param support is disabled by default
Huang Ying [Wed, 20 Jul 2011 08:09:29 +0000 (16:09 +0800)]
ACPI, APEI, EINJ Param support is disabled by default

EINJ parameter support is only usable for some specific BIOS.
Originally, it is expected to have no harm for BIOS does not support
it.  But now, we found it will cause issue (memory overwriting) for
some BIOS.  So param support is disabled by default and only enabled
when newly added module parameter named "param_extension" is
explicitly specified.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Matthew Garrett <mjg@redhat.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoAPEI GHES: 32-bit buildfix
Len Brown [Tue, 2 Aug 2011 22:00:21 +0000 (18:00 -0400)]
APEI GHES: 32-bit buildfix

drivers/acpi/apei/ghes.c:542: warning: integer overflow in expression
drivers/acpi/apei/ghes.c:619: warning: integer overflow in expression

ghes.c:(.text+0x46289): undefined reference to `__udivdi3'
  in function ghes_estatus_cache_add().

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoACPI: APEI build fix
Len Brown [Sat, 16 Jul 2011 22:14:21 +0000 (18:14 -0400)]
ACPI: APEI build fix

as GHES is optional...

When # CONFIG_ACPI_APEI_GHES is not set:

(.init.text+0x4c22): undefined reference to `ghes_disable'

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoACPI, APEI, GHES: Add hardware memory error recovery support
Huang Ying [Wed, 13 Jul 2011 05:14:28 +0000 (13:14 +0800)]
ACPI, APEI, GHES: Add hardware memory error recovery support

memory_failure_queue() is called when recoverable memory errors are
notified by firmware to do the recovery work.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoHWPoison: add memory_failure_queue()
Huang Ying [Wed, 13 Jul 2011 05:14:27 +0000 (13:14 +0800)]
HWPoison: add memory_failure_queue()

memory_failure() is the entry point for HWPoison memory error
recovery.  It must be called in process context.  But commonly
hardware memory errors are notified via MCE or NMI, so some delayed
execution mechanism must be used.  In MCE handler, a work queue + ring
buffer mechanism is used.

In addition to MCE, now APEI (ACPI Platform Error Interface) GHES
(Generic Hardware Error Source) can be used to report memory errors
too.  To add support to APEI GHES memory recovery, a mechanism similar
to that of MCE is implemented.  memory_failure_queue() is the new
entry point that can be called in IRQ context.  The next step is to
make MCE handler uses this interface too.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoACPI, APEI, GHES, Error records content based throttle
Huang Ying [Wed, 13 Jul 2011 05:14:26 +0000 (13:14 +0800)]
ACPI, APEI, GHES, Error records content based throttle

printk is used by GHES to report hardware errors.  Ratelimit is
enforced on the printk to avoid too many hardware error reports in
kernel log.  Because there may be thousands or even millions of
corrected hardware errors during system running.

Currently, a simple scheme is used.  That is, the total number of
hardware error reporting is ratelimited.  This may cause some issues
in practice.

For example, there are two kinds of hardware errors occurred in
system.  One is corrected memory error, because the fault memory
address is accessed frequently, there may be hundreds error report
per-second.  The other is corrected PCIe AER error, it will be
reported once per-second.  Because they share one ratelimit control
structure, it is highly possible that only memory error is reported.

To avoid the above issue, an error record content based throttle
algorithm is implemented in the patch.  Where after the first
successful reporting, all error records that are same are throttled for
some time, to let other kinds of error records have the opportunity to
be reported.

In above example, the memory errors will be throttled for some time,
after being printked.  Then the PCIe AER error will be printked
successfully.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoACPI, APEI, GHES, printk support for recoverable error via NMI
Huang Ying [Wed, 13 Jul 2011 05:14:25 +0000 (13:14 +0800)]
ACPI, APEI, GHES, printk support for recoverable error via NMI

Some APEI GHES recoverable errors are reported via NMI, but printk is
not safe in NMI context.

To solve the issue, a lock-less memory allocator is used to allocate
memory in NMI handler, save the error record into the allocated
memory, put the error record into a lock-less list.  On the other
hand, an irq_work is used to delay the operation from NMI context to
IRQ context.  The irq_work IRQ handler will remove nodes from
lock-less list, printk the error record and do some further processing
include recovery operation, then free the memory.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agolib, Make gen_pool memory allocator lockless
Huang Ying [Wed, 13 Jul 2011 05:14:24 +0000 (13:14 +0800)]
lib, Make gen_pool memory allocator lockless

This version of the gen_pool memory allocator supports lockless
operation.

This makes it safe to use in NMI handlers and other special
unblockable contexts that could otherwise deadlock on locks.  This is
implemented by using atomic operations and retries on any conflicts.
The disadvantage is that there may be livelocks in extreme cases.  For
better scalability, one gen_pool allocator can be used for each CPU.

The lockless operation only works if there is enough memory available.
If new memory is added to the pool a lock has to be still taken.  So
any user relying on locklessness has to ensure that sufficient memory
is preallocated.

The basic atomic operation of this allocator is cmpxchg on long.  On
architectures that don't have NMI-safe cmpxchg implementation, the
allocator can NOT be used in NMI handler.  So code uses the allocator
in NMI handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agolib, Add lock-less NULL terminated single list
Huang Ying [Wed, 13 Jul 2011 05:14:23 +0000 (13:14 +0800)]
lib, Add lock-less NULL terminated single list

Cmpxchg is used to implement adding new entry to the list, deleting
all entries from the list, deleting first entry of the list and some
other operations.

Because this is a single list, so the tail can not be accessed in O(1).

If there are multiple producers and multiple consumers, llist_add can
be used in producers and llist_del_all can be used in consumers.  They
can work simultaneously without lock.  But llist_del_first can not be
used here.  Because llist_del_first depends on list->first->next does
not changed if list->first is not changed during its operation, but
llist_del_first, llist_add, llist_add (or llist_del_all, llist_add,
llist_add) sequence in another consumer may violate that.

If there are multiple producers and one consumer, llist_add can be
used in producers and llist_del_all or llist_del_first can be used in
the consumer.

This can be summarized as follow:

           |   add    | del_first |  del_all
 add       |    -     |     -     |     -
 del_first |          |     L     |     L
 del_all   |          |           |     -

Where "-" stands for no lock is needed, while "L" stands for lock is
needed.

The list entries deleted via llist_del_all can be traversed with
traversing function such as llist_for_each etc.  But the list entries
can not be traversed safely before deleted from the list.  The order
of deleted entries is from the newest to the oldest added one.  If you
want to traverse from the oldest to the newest, you must reverse the
order by yourself before traversing.

The basic atomic operation of this list is cmpxchg on long.  On
architectures that don't have NMI-safe cmpxchg implementation, the
list can NOT be used in NMI handler.  So code uses the list in NMI
handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoAdd Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG
Huang Ying [Wed, 13 Jul 2011 05:14:22 +0000 (13:14 +0800)]
Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG

cmpxchg() is widely used by lockless code, including NMI-safe lockless
code.  But on some architectures, the cmpxchg() implementation is not
NMI-safe, on these architectures the lockless code may need a
spin_trylock_irqsave() based implementation.

This patch adds a Kconfig option: ARCH_HAVE_NMI_SAFE_CMPXCHG, so that
NMI-safe lockless code can depend on it or provide different
implementation according to it.

On many architectures, cmpxchg is only NMI-safe for several specific
operand sizes. So, ARCH_HAVE_NMI_SAFE_CMPXCHG define in this patch
only guarantees cmpxchg is NMI-safe for sizeof(unsigned long).

Signed-off-by: Huang Ying <ying.huang@intel.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: Richard Henderson <rth@twiddle.net>
CC: Mikael Starvik <starvik@axis.com>
Acked-by: David Howells <dhowells@redhat.com>
CC: Yoshinori Sato <ysato@users.sourceforge.jp>
CC: Tony Luck <tony.luck@intel.com>
CC: Hirokazu Takata <takata@linux-m32r.org>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Michal Simek <monstr@monstr.eu>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
CC: Kyle McMartin <kyle@mcmartin.ca>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
CC: Chen Liqin <liqin.chen@sunplusct.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Ingo Molnar <mingo@redhat.com>
CC: Chris Zankel <chris@zankel.net>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years ago[S390] signal: use set_restore_sigmask() helper
Heiko Carstens [Wed, 3 Aug 2011 14:44:32 +0000 (16:44 +0200)]
[S390] signal: use set_restore_sigmask() helper

We should call set_restore_sigmask() instead of directly setting
TIF_RESTORE_SIGMASK. This change should have been done three years
earlier... see 4e4c22 "signals: add set_restore_sigmask".

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] smp: remove pointless comments in startup_secondary()
Heiko Carstens [Wed, 3 Aug 2011 14:44:31 +0000 (16:44 +0200)]
[S390] smp: remove pointless comments in startup_secondary()

Remove pointless comments in startup_secondary(). There is not too much
value in having comments like e.g. "call cpu notifiers" just before a
call to notify_cpu*().

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] qdio: Use kstrtoul_from_user
Peter Huewe [Wed, 3 Aug 2011 14:44:30 +0000 (16:44 +0200)]
[S390] qdio: Use kstrtoul_from_user

This patch replaces the code for getting an unsigned long from a
userspace buffer by a simple call to kstroul_from_user.
This makes it easier to read and less error prone.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] sclp_async: Use kstrtoul_from_user
Peter Huewe [Wed, 3 Aug 2011 14:44:29 +0000 (16:44 +0200)]
[S390] sclp_async: Use kstrtoul_from_user

This patch replaces the code for getting an unsigned long from a
userspace buffer by a simple call to kstroul_from_user.
This makes it easier to read and less error prone.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] exec: remove redundant set_fs(USER_DS)
Mathias Krause [Wed, 3 Aug 2011 14:44:28 +0000 (16:44 +0200)]
[S390] exec: remove redundant set_fs(USER_DS)

The address limit is already set in flush_old_exec() so those calls to
set_fs(USER_DS) are redundant.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] cpu hotplug: on cpu start wait until being marked active
Heiko Carstens [Wed, 3 Aug 2011 14:44:27 +0000 (16:44 +0200)]
[S390] cpu hotplug: on cpu start wait until being marked active

This is the same as fd8a7de1 "x86: cpu-hotplug: Prevent softirq wakeup
on wrong CPU".
Unlike on x86 this doesn't fix a bug on s390 since we do not have
threaded interrupt handlers. However we want to keep the same
initialization order like on x86. This should prevent bugs caused by
code which assumes (and relies on) the init order is the same on each
architecture.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] signal: convert to use set_current_blocked()
Heiko Carstens [Wed, 3 Aug 2011 14:44:26 +0000 (16:44 +0200)]
[S390] signal: convert to use set_current_blocked()

Convert to use set_current_blocked() like x86.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] asm offsets: fix coding style
Heiko Carstens [Wed, 3 Aug 2011 14:44:25 +0000 (16:44 +0200)]
[S390] asm offsets: fix coding style

Because of readability reasons we ignore the 80 character line limit
in asm offsets. Just one line per define, nothing else.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] Add support for IBM zEnterprise 114
Heiko Carstens [Wed, 3 Aug 2011 14:44:24 +0000 (16:44 +0200)]
[S390] Add support for IBM zEnterprise 114

Just fix up the Kconfig description and the elf platform.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] dasd: check if raw track access is supported
Stefan Haberland [Wed, 3 Aug 2011 14:44:23 +0000 (16:44 +0200)]
[S390] dasd: check if raw track access is supported

To use raw track access some special storage server commands are
needed. Older storage hardware may not support these commands.
So check if raw track access is possible while setting the DASD
online.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] Use diagnose 308 for system reset
Michael Holzheu [Wed, 3 Aug 2011 14:44:22 +0000 (16:44 +0200)]
[S390] Use diagnose 308 for system reset

The diagnose 308 call is the prefered method for clearing all ongoing I/O.
Therefore if it is available we use it instead of doing a manual reset.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] Export store_status() function
Michael Holzheu [Wed, 3 Aug 2011 14:44:21 +0000 (16:44 +0200)]
[S390] Export store_status() function

For kdump we need a store status function to save the registers for the
current CPU. Therefore this patch exports a function "store_status()".
In addition to that now also floating point registers are saved correctly.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] dasd: use vmalloc for statistics input buffer
Stefan Weinhuber [Wed, 3 Aug 2011 14:44:20 +0000 (16:44 +0200)]
[S390] dasd: use vmalloc for statistics input buffer

The size of the buffer that is used to store DASD statistics input
strings depends on the user input. If the input string is to large,
the write operation could fail with -ENOMEM. To avoid this, use
vmalloc instead of kmalloc.

Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] Add PSW restart shutdown trigger
Michael Holzheu [Wed, 3 Aug 2011 14:44:19 +0000 (16:44 +0200)]
[S390] Add PSW restart shutdown trigger

With this patch a new S390 shutdown trigger "restart" is added. If under
z/VM "systerm restart" is entered or under the HMC the "PSW restart" button
is pressed, the PSW located at 0 (31 bit) or 0x1a0 (64 bit) bit is loaded.
Now we execute do_restart() that processes the restart action that is
defined under /sys/firmware/shutdown_actions/on_restart. Currently the
following actions are possible: reipl (default), stop, vmcmd, dump, and
dump_reipl.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] missing return in page_table_alloc_pgste
Jan Glauber [Wed, 3 Aug 2011 14:44:18 +0000 (16:44 +0200)]
[S390] missing return in page_table_alloc_pgste

Fix the following compile warning for !CONFIG_PGSTE:

  CC      arch/s390/mm/pgtable.o
arch/s390/mm/pgtable.c: In function ‘page_table_alloc_pgste’:
arch/s390/mm/pgtable.c:531:1: warning: no return statement in function returning non-void [-Wreturn-type]

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years ago[S390] qdio: 2nd stage retry on SIGA-W busy conditions
Jan Glauber [Wed, 3 Aug 2011 14:44:17 +0000 (16:44 +0200)]
[S390] qdio: 2nd stage retry on SIGA-W busy conditions

The SIGA-W may return with the busy bit set which means the device was
blocked. The busy loop which retries the SIGA-W for 100us may not be
long enough when running under a heavily loaded hypervisor.

Extend the retry mechanism by adding a longer second stage which retries
the SIGA-W for up to 10s. In difference to the first retry loop the second
stage is using mdelay to stop the cpu between the retries and thereby
avoid additional preassure in on the hypervisor.
If the second stage retry is successfull a device reset is avoided.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for...
John W. Linville [Wed, 3 Aug 2011 13:18:21 +0000 (09:18 -0400)]
Merge git://git./linux/kernel/git/linville/wireless-next into for-davem

12 years agodt: add of_alias_scan and of_alias_get_id
Shawn Guo [Wed, 3 Aug 2011 10:28:14 +0000 (11:28 +0100)]
dt: add of_alias_scan and of_alias_get_id

The patch adds function of_alias_scan to populate a global lookup
table with the properties of 'aliases' node and function
of_alias_get_id for drivers to find alias id from the lookup table.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
[grant.likely: add locking and rework parse loop]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agonet: fix NULL dereferences in check_peer_redir()
Eric Dumazet [Fri, 29 Jul 2011 19:00:53 +0000 (19:00 +0000)]
net: fix NULL dereferences in check_peer_redir()

Gergely Kalman reported crashes in check_peer_redir().

It appears commit f39925dbde778 (ipv4: Cache learned redirect
information in inetpeer.) added a race, leading to possible NULL ptr
dereference.

Since we can now change dst neighbour, we should make sure a reader can
safely use a neighbour.

Add RCU protection to dst neighbour, and make sure check_peer_redir()
can be called safely by different cpus in parallel.

As neighbours are already freed after one RCU grace period, this patch
should not add typical RCU penalty (cache cold effects)

Many thanks to Gergely for providing a pretty report pointing to the
bug.

Reported-by: Gergely Kalman <synapse@hippy.csoma.elte.hu>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Clear MDIO access warning during first driver load
Yaniv Rosner [Tue, 2 Aug 2011 23:00:12 +0000 (23:00 +0000)]
bnx2x: Clear MDIO access warning during first driver load

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix BCM578xx MAC test
Yaniv Rosner [Tue, 2 Aug 2011 23:00:06 +0000 (23:00 +0000)]
bnx2x: Fix BCM578xx MAC test

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix BCM54618se invalid link indication
Yaniv Rosner [Tue, 2 Aug 2011 23:00:00 +0000 (23:00 +0000)]
bnx2x: Fix BCM54618se invalid link indication

After resetting BCM54618se, link partner would still see link since the PHY wasn't put into low-power state.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix BCM84833 link
Yaniv Rosner [Tue, 2 Aug 2011 22:59:53 +0000 (22:59 +0000)]
bnx2x: Fix BCM84833 link

BCM84833 fail to link due to incorrect auto-negotiation setting.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix link issue with DAC over 578xx
Yaniv Rosner [Tue, 2 Aug 2011 22:59:47 +0000 (22:59 +0000)]
bnx2x: Fix link issue with DAC over 578xx

Fix no-link issue on BCM578xx when direct attached cable is connected since Warpcore microcode restart was missing to re-read the new mode.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix LED behavior
Yaniv Rosner [Tue, 2 Aug 2011 22:59:40 +0000 (22:59 +0000)]
bnx2x: Fix LED behavior

This fix resolve two problems seen regarding LED:
1. LED doesn't flash during port identification.
2. Traffic LED sometimes do not blink.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix BCM578xx-B0 MDIO access
Yaniv Rosner [Tue, 2 Aug 2011 22:59:32 +0000 (22:59 +0000)]
bnx2x: Fix BCM578xx-B0 MDIO access

Fix MDIO access to Warpcore on new chip version of 578xx.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix remote fault handling
Yaniv Rosner [Tue, 2 Aug 2011 22:59:25 +0000 (22:59 +0000)]
bnx2x: Fix remote fault handling

Fix couple of issues of remote fault detection and handling:
Link may go down due to remote fault indications during link establishment.
Possible link down after primary function migration.
Remote fault was not detected on 578xx.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix chip hanging due to TX pipe stall.
Yaniv Rosner [Tue, 2 Aug 2011 22:59:18 +0000 (22:59 +0000)]
bnx2x: Fix chip hanging due to TX pipe stall.

Fix a problem in which the 578xx chip hangs after running traffic, and then pulling the network cable.
This occurs since TX pipe is stalled due to missing XON indication towards the NIG.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix missing pause on for 578xx
Yaniv Rosner [Tue, 2 Aug 2011 22:59:10 +0000 (22:59 +0000)]
bnx2x: Fix missing pause on for 578xx

When link speed is 1G and below, pause weren't sent due to missing pause setting in the UMAC.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcm_fc: Handle DDP/SW fc_frame_payload_get failures in ft_recv_write_data
Kiran Patil [Wed, 3 Aug 2011 09:20:01 +0000 (09:20 +0000)]
tcm_fc: Handle DDP/SW fc_frame_payload_get failures in ft_recv_write_data

Problem: HW DDP context was not invalidated in case of ABORTS, etc...
This leads to the problem where memory pages which are used for DDP
as user descriptor could get reused for some other purpose (such as to
satisfy new memory allocation request either by kernel or user mode threads)
and since HW DDP context was not invalidated, HW continue to write to
those pages, hence causing memory corruption.

Fix: Either on incoming ABORTS or due to exchange time out, allowed the
target to cleanup HW DDP context if it was setup for respective ft_cmd.
Added new function to perform this cleanup, furthur it can be enhanced
for other cleanup activity.  Fix ft_recv_write_data() to properly handle
fc_frame_payload_get to return pointer to payload if it exist. If there is
no payload which is most common case (+ve case in case if DDP is working
as expected, it will return NULL. Yes, scope of buf is limited to printk.
Invalidation of HW context (which is done inside ft_invl_hw_context() is
necessary in SUCCESS and FAILURE case of DDP. Hence invalidation is DONE
as long as there was DDP setup (whether it worked correctly or not,

NOTE: For some reason, if there is any error w.r.t DDP such as out of
order packet reception, HW simply post the full packet in rx queue.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Cc: Robert W Love <robert.w.love@intel.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
12 years agoMerge branch 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Wed, 3 Aug 2011 07:18:39 +0000 (21:18 -1000)]
Merge branch 'pstore-efi' of git://git./linux/kernel/git/aegl/linux-2.6

* 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  efivars: fix warnings when CONFIG_PSTORE=n

12 years agoMerge branch 'tools-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb...
Linus Torvalds [Wed, 3 Aug 2011 07:17:39 +0000 (21:17 -1000)]
Merge branch 'tools-release' of git://git./linux/kernel/git/lenb/linux-idle-2.6

* 'tools-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
  tools/power turbostat: fit output into 80 columns on snb-ep
  tools/power x86_energy_perf_policy: fix print of uninitialized string

12 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Wed, 3 Aug 2011 07:17:02 +0000 (21:17 -1000)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (28 commits)
  ACPI:  delete stale reference in kernel-parameters.txt
  ACPI: add missing _OSI strings
  ACPI: remove NID_INVAL
  thermal: make THERMAL_HWMON implementation fully internal
  thermal: split hwmon lookup to a separate function
  thermal: hide CONFIG_THERMAL_HWMON
  ACPI print OSI(Linux) warning only once
  ACPI: DMI workaround for Asus A8N-SLI Premium and Asus A8N-SLI DELUX
  ACPI / Battery: propagate sysfs error in acpi_battery_add()
  ACPI / Battery: avoid acpi_battery_add() use-after-free
  ACPI: introduce "acpi_rsdp=" parameter for kdump
  ACPI: constify ops structs
  ACPI: fix CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS
  ACPI: fix 80 char overflow
  ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()
  ACPI / Battery: Add the check before refresh sysfs in the battery_notify()
  ACPI / Battery: Add the hibernation process in the battery_notify()
  ACPI / Battery: Rename acpi_battery_quirks2 with acpi_battery_quirks
  ACPI / Battery: Change 16-bit signed negative battery current into correct value
  ACPI / Battery: Add the power unit macro
  ...

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Linus Torvalds [Wed, 3 Aug 2011 07:16:11 +0000 (21:16 -1000)]
Merge git://git./linux/kernel/git/cmetcalf/linux-tile

* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  arch/tile/mm/init.c: trivial: use BUG_ON
  arch/tile: remove useless set_fixmap_nocache() macro
  arch/tile: add hypervisor-based character driver for SPI flash ROM
  ioctl-number.txt: add the tile hardwall ioctl range
  tile: use generic-y format for one-line asm-generic headers
  clocksource: tile: convert to use clocksource_register_hz

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
Linus Torvalds [Wed, 3 Aug 2011 07:14:05 +0000 (21:14 -1000)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/btrfs-unstable

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (31 commits)
  Btrfs: don't call writepages from within write_full_page
  Btrfs: Remove unused variable 'last_index' in file.c
  Btrfs: clean up for find_first_extent_bit()
  Btrfs: clean up for wait_extent_bit()
  Btrfs: clean up for insert_state()
  Btrfs: remove unused members from struct extent_state
  Btrfs: clean up code for merging extent maps
  Btrfs: clean up code for extent_map lookup
  Btrfs: clean up search_extent_mapping()
  Btrfs: remove redundant code for dir item lookup
  Btrfs: make acl functions really no-op if acl is not enabled
  Btrfs: remove remaining ref-cache code
  Btrfs: remove a BUG_ON() in btrfs_commit_transaction()
  Btrfs: use wait_event()
  Btrfs: check the nodatasum flag when writing compressed files
  Btrfs: copy string correctly in INO_LOOKUP ioctl
  Btrfs: don't print the leaf if we had an error
  btrfs: make btrfs_set_root_node void
  Btrfs: fix oops while writing data to SSD partitions
  Btrfs: Protect the readonly flag of block group
  ...

Fix up trivial conflicts (due to acl and writeback cleanups) in
 - fs/btrfs/acl.c
 - fs/btrfs/ctree.h
 - fs/btrfs/extent_io.c

12 years agoMerge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Wed, 3 Aug 2011 06:49:57 +0000 (20:49 -1000)]
Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6

* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6:
  MAINTAINERS: Add keyword match for of_match_table to device tree section
  of: constify property name parameters for helper functions
  input: xilinx_ps2: Add missing of_address.h header
  of: address: use resource_size helper

12 years agoMerge branch 'spi/next' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Wed, 3 Aug 2011 06:49:38 +0000 (20:49 -1000)]
Merge branch 'spi/next' of git://git.secretlab.ca/git/linux-2.6

* 'spi/next' of git://git.secretlab.ca/git/linux-2.6:
  spi/pl022: remove function cannot exit

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
Linus Torvalds [Wed, 3 Aug 2011 06:49:21 +0000 (20:49 -1000)]
Merge git://git./linux/kernel/git/agk/linux-2.6-dm

* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (34 commits)
  dm table: set flush capability based on underlying devices
  dm crypt: optionally support discard requests
  dm raid: add md raid1 support
  dm raid: support metadata devices
  dm raid: add write_mostly parameter
  dm raid: add region_size parameter
  dm raid: improve table parameters documentation
  dm ioctl: forbid multiple device specifiers
  dm ioctl: introduce __get_dev_cell
  dm ioctl: fill in device parameters in more ioctls
  dm flakey: add corrupt_bio_byte feature
  dm flakey: add drop_writes
  dm flakey: support feature args
  dm flakey: use dm_target_offset and support discards
  dm table: share target argument parsing functions
  dm snapshot: skip reading origin when overwriting complete chunk
  dm: ignore merge_bvec for snapshots when safe
  dm table: clean dm_get_device and move exports
  dm raid: tidy includes
  dm ioctl: prevent empty message
  ...

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-watchdog
Linus Torvalds [Wed, 3 Aug 2011 06:48:47 +0000 (20:48 -1000)]
Merge git://git./linux/kernel/git/wim/linux-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-watchdog:
  watchdog: Cleanup WATCHDOG_CORE help text
  watchdog: Fix POST failure on ASUS P5N32-E SLI and similar boards
  watchdog: shwdt: fix usage of mod_timer

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Wed, 3 Aug 2011 06:48:22 +0000 (20:48 -1000)]
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: asihpi - Clarify adapter index validity check
  ALSA: asihpi - Don't leak firmware if mem alloc fails
  ALSA: rtctimer.c needs module.h
  ASoC: Fix txx9aclc.c build
  ALSA: hdspm - Add firmware revision 0xcc for RME MADI
  ALSA: hdspm - Fix reported external sample rate on RME MADI and MADIface
  ALSA: hdspm - Provide MADI speed mode selector on RME MADI and MADIface
  ALSA: sound/core/pcm_compat.c: adjust array index

12 years agoInput: ad7879 - fix deficient device disable
Michael Hennerich [Tue, 2 Aug 2011 22:41:37 +0000 (15:41 -0700)]
Input: ad7879 - fix deficient device disable

Input close or device disable should not interact with the exported
gpiolib functionality. However that's the case. __ad7879_disable()
clears the entire AD7879_REG_CTRL2, while it should just power down
the ADC and its reference.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
12 years agoInput: gpio_keys - fix two typos in devicetree documentation
Tobias Klauser [Tue, 2 Aug 2011 22:40:22 +0000 (15:40 -0700)]
Input: gpio_keys - fix two typos in devicetree documentation

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
12 years agoRCUify freeing acls, let check_acl() go ahead in RCU mode if acl is cached
Al Viro [Wed, 3 Aug 2011 01:32:13 +0000 (21:32 -0400)]
RCUify freeing acls, let check_acl() go ahead in RCU mode if acl is cached

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoget rid of boilerplate switches in posix_acl.h
Al Viro [Wed, 3 Aug 2011 04:47:21 +0000 (00:47 -0400)]
get rid of boilerplate switches in posix_acl.h

the only potentially subtle thing here: get_cached_acl()
is never called with the second argument other than
ACL_TYPE_{ACCESS,DEFAULT}.  IOW, that return ERR_PTR(-EINVAL)
in there might as well be BUG().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agosparc: Use popc when possible for ffs/__ffs/ffz.
David S. Miller [Wed, 3 Aug 2011 03:23:34 +0000 (20:23 -0700)]
sparc: Use popc when possible for ffs/__ffs/ffz.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: Set reboot-cmd using reboot data hypervisor call if available.
David S. Miller [Tue, 2 Aug 2011 06:27:17 +0000 (23:27 -0700)]
sparc: Set reboot-cmd using reboot data hypervisor call if available.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: Add some missing hypervisor API groups.
David S. Miller [Tue, 2 Aug 2011 05:45:18 +0000 (22:45 -0700)]
sparc: Add some missing hypervisor API groups.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: Use hweight64() in popc emulation.
David S. Miller [Tue, 2 Aug 2011 02:41:12 +0000 (19:41 -0700)]
sparc: Use hweight64() in popc emulation.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: Use popc if possible for hweight routines.
David S. Miller [Fri, 29 Jul 2011 16:42:07 +0000 (09:42 -0700)]
sparc: Use popc if possible for hweight routines.

Just like powerpc, we code patch at boot time.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: Minor tweaks to Niagara page copy/clear.
David S. Miller [Tue, 2 Aug 2011 01:18:57 +0000 (18:18 -0700)]
sparc: Minor tweaks to Niagara page copy/clear.

Don't use floating point on Niagara2, use the traditional
plain Niagara code instead.

Unroll Niagara loops to 128 bytes for copy, and 256 bytes
for clear.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocifs: demote DFS referral lookup errors to cFYI
Jeff Layton [Tue, 26 Jul 2011 16:20:18 +0000 (12:20 -0400)]
cifs: demote DFS referral lookup errors to cFYI

cifs: demote DFS referral lookup errors to cFYI

Now that we call into this routine on every mount, anyone who doesn't
have the upcall configured will get multiple printks about failed lookups.

Reported-and-Tested-by: Martijn Uffing <mp3project@sarijopen.student.utwente.nl>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoRevert "cifs: advertise the right receive buffer size to the server"
Steve French [Wed, 3 Aug 2011 03:17:43 +0000 (03:17 +0000)]
Revert "cifs: advertise the right receive buffer size to the server"

This reverts commit c4d3396b261473ded6f370edd1e79ba34e089d7e.

Problems discovered with readdir to Samba due to
not accounting for header size properly with this change

12 years agor8169 : MAC address change fix for the 8168e-vl.
françois romieu [Tue, 2 Aug 2011 03:53:43 +0000 (03:53 +0000)]
r8169 : MAC address change fix for the 8168e-vl.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=39252

Hayes suggested that the usual MAC{0, 4} register writes be completed
with writes to extended GigaMAC registers :
- 0xe0 .. 0xe5
- 0xf2 .. 0xf7

Registers 0xf0 and 0xf1 should be set to 0.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotools/power turbostat: fit output into 80 columns on snb-ep
Len Brown [Sun, 31 Jul 2011 22:19:33 +0000 (18:19 -0400)]
tools/power turbostat: fit output into 80 columns on snb-ep

Reduce columns for package number to 1.
If you can afford more than 9 packages,
you can also afford a terminal with more than 80 columns:-)

Also shave a column also off the package C-states

Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoefivars: fix warnings when CONFIG_PSTORE=n
Tony Luck [Tue, 2 Aug 2011 22:08:30 +0000 (15:08 -0700)]
efivars: fix warnings when CONFIG_PSTORE=n

drivers/firmware/efivars.c:161: warning: ‘utf16_strlen’ defined but not used
utf16_strlen() is only used inside CONFIG_PSTORE - make this "static inline"
to shut the compiler up [thanks to hpa for the suggestion].

drivers/firmware/efivars.c:602: warning: initialization from incompatible pointer type
Between v1 and v2 of this patch series we decided to make the "part" number
unsigned - but missed fixing the stub version of efi_pstore_write()

Acked-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Mike Waychison <mikew@google.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
12 years agoMerge branches 'acpica', 'battery', 'boot-irqs', 'bz-24492', 'bz-9528', 'from-akpm...
Len Brown [Tue, 2 Aug 2011 21:22:09 +0000 (17:22 -0400)]
Merge branches 'acpica', 'battery', 'boot-irqs', 'bz-24492', 'bz-9528', 'from-akpm', 'kexec-param' and 'misc' into release

Conflicts:
Documentation/kernel-parameters.txt

Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoACPI: delete stale reference in kernel-parameters.txt
Len Brown [Tue, 2 Aug 2011 21:15:33 +0000 (17:15 -0400)]
ACPI:  delete stale reference in kernel-parameters.txt

Says for acpi=
                        See also Documentation/power/pm.txt, pci=noacpi

but this file does not exist

Reported-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoarch/tile/mm/init.c: trivial: use BUG_ON
Julia Lawall [Tue, 2 Aug 2011 10:35:04 +0000 (12:35 +0200)]
arch/tile/mm/init.c: trivial: use BUG_ON

Use BUG_ON(x) rather than if(x) BUG();

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ identifier x; @@
-if (x) BUG();
+BUG_ON(x);

@@ identifier x; @@
-if (!x) BUG();
+BUG_ON(!x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
12 years agoMerge tag 'v3.0' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
Chris Metcalf [Tue, 2 Aug 2011 20:14:02 +0000 (16:14 -0400)]
Merge tag 'v3.0' of git://git./linux/kernel/git/torvalds/linux-2.6 into for-linus

12 years agoACPI: add missing _OSI strings
Shaohua Li [Thu, 28 Jul 2011 20:48:43 +0000 (13:48 -0700)]
ACPI: add missing _OSI strings

Linux supports some optional features, but it should notify the BIOS about
them via the _OSI method.  Currently Linux doesn't notify any, which might
make such features not work because the BIOS doesn't know about them.

Jarosz has a system which needs this to make ACPI processor aggregator
device work.

Reported-by: "Jarosz, Sebastian" <sebastian.jarosz@intel.com>
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoACPI: remove NID_INVAL
David Rientjes [Thu, 28 Jul 2011 20:48:43 +0000 (13:48 -0700)]
ACPI: remove NID_INVAL

b552a8c56db8 ("ACPI: remove NID_INVAL") removed the left over uses of
NID_INVAL, but didn't actually remove the definition.  Remove it.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agothermal: make THERMAL_HWMON implementation fully internal
Jean Delvare [Thu, 28 Jul 2011 20:48:42 +0000 (13:48 -0700)]
thermal: make THERMAL_HWMON implementation fully internal

THERMAL_HWMON is implemented inside the thermal_sys driver and has no
effect on drivers implementing thermal zones, so they shouldn't see
anything related to it in <linux/thermal.h>.  Making the THERMAL_HWMON
implementation fully internal has two advantages beyond the cleaner
design:

* This avoids rebuilding all thermal drivers if the THERMAL_HWMON
  implementation changes, or if CONFIG_THERMAL_HWMON gets enabled or
  disabled.

* This avoids breaking the thermal kABI in these cases too, which should
  make distributions happy.

The only drawback I can see is slightly higher memory fragmentation, as
the number of kzalloc() calls will increase by one per thermal zone.  But
I doubt it will be a problem in practice, as I've never seen a system with
more than two thermal zones.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rene Herman <rene.herman@gmail.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agothermal: split hwmon lookup to a separate function
Jean Delvare [Thu, 28 Jul 2011 20:48:41 +0000 (13:48 -0700)]
thermal: split hwmon lookup to a separate function

We'll soon need to reuse it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rene Herman <rene.herman@gmail.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agothermal: hide CONFIG_THERMAL_HWMON
Jean Delvare [Thu, 28 Jul 2011 20:48:40 +0000 (13:48 -0700)]
thermal: hide CONFIG_THERMAL_HWMON

It's about time to revert 16d752397301b9 ("thermal: Create
CONFIG_THERMAL_HWMON=n").  Anybody running a kernel >= 2.6.40 would also
be running a recent enough version of lm-sensors.

Actually having CONFIG_THERMAL_HWMON is pretty convenient so instead of
dropping it, we keep it but hide it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rene Herman <rene.herman@gmail.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoiwlagn: 5000 do not support idle mode
Wey-Yi Guy [Tue, 2 Aug 2011 16:08:37 +0000 (09:08 -0700)]
iwlagn: 5000 do not support idle mode

5000 series has issue supporting power save idle mode:

commit 9dc2153315650eae220898668b6aa56a25c130be

iwlwifi: always support idle mode for agn devices

For agn devices, always support idle mode which help power
consumption in idle unassociated state.

the above changes cause 5000 become not stable when power management is "on"

http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2312

Cc: stable@kernel.org #2.6.39, #3.0.0
Reported-by: Devin J Pohly <djpohly+iwl@gmail.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00: fix usage of NULL queue
Stanislaw Gruszka [Tue, 2 Aug 2011 11:29:02 +0000 (13:29 +0200)]
rt2x00: fix usage of NULL queue

We may call rt2x00queue_pause_queue(queue) with queue == NULL. Bug
was introduced by commit 62fe778412b36791b7897cfa139342906fbbf07b
"rt2x00: Fix stuck queue in tx failure case" .

Cc: stable@kernel.org # 3.0+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00: Fix compilation without CONFIG_RT2X00_LIB_CRYPTO
Helmut Schaa [Tue, 2 Aug 2011 09:43:14 +0000 (11:43 +0200)]
rt2x00: Fix compilation without CONFIG_RT2X00_LIB_CRYPTO

This was introduced by commit
77b5621bac4a56b83b9081f48d4e7d1accdde400 (rt2x00: Don't use queue entry
as parameter when creating TX descriptor.)

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: sysfs couldn't find the priv pointer
Emmanuel Grumbach [Mon, 1 Aug 2011 19:46:57 +0000 (12:46 -0700)]
iwlagn: sysfs couldn't find the priv pointer

This bug has been introduced by:
d593411084a56124aa9d80aafa15db8463b2d8f7
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Mon Jul 11 10:48:51 2011 +0300

    iwlagn: simplify the bus architecture

Revert part of the buggy patch: dev_get_drvdata will now return
iwl_priv as it did before the patch.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Tested-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMAINTAINERS: Add keyword match for of_match_table to device tree section
Mark Brown [Tue, 2 Aug 2011 05:13:26 +0000 (14:13 +0900)]
MAINTAINERS: Add keyword match for of_match_table to device tree section

If a patch is working with an of_match_table it's probably adding an OF
binding to a driver in which case the binding ought to be reviewed by the
device tree folks to make sure that things like the device matches are set
up correctly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoof: constify property name parameters for helper functions
Jamie Iles [Tue, 2 Aug 2011 14:45:07 +0000 (15:45 +0100)]
of: constify property name parameters for helper functions

The helper functions for reading u32 integers, u32 arrays and strings
should have the property name as a const pointer.

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agospi/pl022: remove function cannot exit
Linus Walleij [Tue, 2 Aug 2011 09:29:24 +0000 (11:29 +0200)]
spi/pl022: remove function cannot exit

The remove function in the PL022 driver cannot abort the remove
function any way, so restructure the code so as not to make that
assumption. Remove will now proceed no matter whether it can
stop the transfer queue or not.

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agodm table: set flush capability based on underlying devices
Mike Snitzer [Tue, 2 Aug 2011 11:32:08 +0000 (12:32 +0100)]
dm table: set flush capability based on underlying devices

DM has always advertised both REQ_FLUSH and REQ_FUA flush capabilities
regardless of whether or not a given DM device's underlying devices
also advertised a need for them.

Block's flush-merge changes from 2.6.39 have proven to be more costly
for DM devices.  Performance regressions have been reported even when
DM's underlying devices do not advertise that they have a write cache.

Fix the performance regressions by configuring a DM device's flushing
capabilities based on those of the underlying devices' capabilities.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm crypt: optionally support discard requests
Milan Broz [Tue, 2 Aug 2011 11:32:08 +0000 (12:32 +0100)]
dm crypt: optionally support discard requests

Add optional parameter field to dmcrypt table and support
"allow_discards" option.

Discard requests bypass crypt queue processing. Bio is simple remapped
to underlying device.

Note that discard will be never enabled by default because of security
consequences.  It is up to the administrator to enable it for encrypted
devices.

(Note that userspace cryptsetup does not understand new optional
parameters yet.  Support for this will come later.  Until then, you
should use 'dmsetup' to enable and disable this.)

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm raid: add md raid1 support
Jonathan Brassow [Tue, 2 Aug 2011 11:32:07 +0000 (12:32 +0100)]
dm raid: add md raid1 support

Support the MD RAID1 personality through dm-raid.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm raid: support metadata devices
Jonathan Brassow [Tue, 2 Aug 2011 11:32:07 +0000 (12:32 +0100)]
dm raid: support metadata devices

Add the ability to parse and use metadata devices to dm-raid.  Although
not strictly required, without the metadata devices, many features of
RAID are unavailable.  They are used to store a superblock and bitmap.

The role, or position in the array, of each device must be recorded in
its superblock.  This is to help with fault handling, array reshaping,
and sanity checks.  RAID 4/5/6 devices must be loaded in a specific order:
in this way, the 'array_position' field helps validate the correctness
of the mapping when it is loaded.  It can be used during reshaping to
identify which devices are added/removed.  Fault handling is impossible
without this field.  For example, when a device fails it is recorded in
the superblock.  If this is a RAID1 device and the offending device is
removed from the array, there must be a way during subsequent array
assembly to determine that the failed device was the one removed.  This
is done by correlating the 'array_position' field and the bit-field
variable 'failed_devices'.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm raid: add write_mostly parameter
Jonathan Brassow [Tue, 2 Aug 2011 11:32:07 +0000 (12:32 +0100)]
dm raid: add write_mostly parameter

Add the write_mostly parameter to RAID1 dm-raid tables.

This allows the user to set the WriteMostly flag on a RAID1 device that
should normally be avoided for read I/O.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm raid: add region_size parameter
Jonathan Brassow [Tue, 2 Aug 2011 11:32:07 +0000 (12:32 +0100)]
dm raid: add region_size parameter

Allow the user to specify the region_size.

Ensures that the supplied value meets md's constraints, viz. the number of
regions does not exceed 2^21.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm raid: improve table parameters documentation
Jonathan Brassow [Tue, 2 Aug 2011 11:32:06 +0000 (12:32 +0100)]
dm raid: improve table parameters documentation

Add more information about some dm-raid table parameters and clarify how
parameters are printed when 'dmsetup table' is issued.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm ioctl: forbid multiple device specifiers
Mikulas Patocka [Tue, 2 Aug 2011 11:32:06 +0000 (12:32 +0100)]
dm ioctl: forbid multiple device specifiers

Exactly one of name, uuid or device must be specified when referencing
an existing device.  This removes the ambiguity (risking the wrong
device being updated) if two conflicting parameters were specified.
Previously one parameter got used and any others were ignored silently.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm ioctl: introduce __get_dev_cell
Mikulas Patocka [Tue, 2 Aug 2011 11:32:06 +0000 (12:32 +0100)]
dm ioctl: introduce __get_dev_cell

Move logic to find device based on major/minor number to a separate
function __get_dev_cell (similar to __get_uuid_cell and __get_name_cell).
This makes the function __find_device_hash_cell more straightforward.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm ioctl: fill in device parameters in more ioctls
Mikulas Patocka [Tue, 2 Aug 2011 11:32:06 +0000 (12:32 +0100)]
dm ioctl: fill in device parameters in more ioctls

Move parameter filling from find_device to __find_device_hash_cell.

This patch causes ioctls using __find_device_hash_cell
(DM_DEV_REMOVE_CMD, DM_DEV_SUSPEND_CMD - resume, DM_TABLE_CLEAR_CMD)
to return device parameters, bringing them into line with the other
ioctls.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>