GitHub/mt8127/android_kernel_alcatel_ttab.git
11 years agoMIPS: microMIPS: Optimise 'strlen' core library function.
Steven J. Hill [Mon, 25 Mar 2013 18:41:47 +0000 (13:41 -0500)]
MIPS: microMIPS: Optimise 'strlen' core library function.

Optimise 'strlen' to use microMIPS instructions and/or optimisations
for binary size reduction. When the microMIPS ISA is not being used,
the library function compiles to the original binary code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Optimise 'strncpy' core library function.
Steven J. Hill [Mon, 25 Mar 2013 18:41:18 +0000 (13:41 -0500)]
MIPS: microMIPS: Optimise 'strncpy' core library function.

Optimise 'strncpy' to use microMIPS instructions and/or optimisations
for binary size reduction. When the microMIPS ISA is not being used,
the library function compiles to the original binary code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Optimise 'memset' core library function.
Steven J. Hill [Mon, 25 Mar 2013 18:40:49 +0000 (13:40 -0500)]
MIPS: microMIPS: Optimise 'memset' core library function.

Optimise 'memset' to use microMIPS instructions and/or optimisations
for binary size reduction. When the microMIPS ISA is not being used,
the library function compiles to the original binary code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Add configuration option for microMIPS kernel.
Steven J. Hill [Mon, 25 Mar 2013 18:27:11 +0000 (13:27 -0500)]
MIPS: microMIPS: Add configuration option for microMIPS kernel.

This adds the option to build the Linux kernel using only the
microMIPS ISA. The resulting kernel binary is, at a minimum,
20% smaller than using the MIPS32R2 ISA.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Disable LL/SC and fix linker bug.
Steven J. Hill [Mon, 25 Mar 2013 18:22:59 +0000 (13:22 -0500)]
MIPS: microMIPS: Disable LL/SC and fix linker bug.

Partially revert commit e0c14a260d66ba35935600d6435940a566fe806b
and turn off LL/SC when building a pure microMIPS kernel. This is
a temporary fix until the cmpxchg assembly macro functions are
re-written to not use the HI/LO registers in address calculations.

Also add .insn in selected user access functions which would
otherwise produce ISA mode jump incompatibilities. This is also a
temporary fix.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Add vdso support.
Douglas Leung [Mon, 25 Mar 2013 18:21:11 +0000 (13:21 -0500)]
MIPS: microMIPS: Add vdso support.

Support vdso in microMIPS mode.

Signed-off-by: Douglas Leung <Douglas.Leung@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Add unaligned access support.
Leonid Yegoshin [Mon, 25 Mar 2013 18:18:07 +0000 (13:18 -0500)]
MIPS: microMIPS: Add unaligned access support.

Add logic needed to handle unaligned accesses in microMIPS mode.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
11 years agoMIPS: microMIPS: Support handling of delay slots.
Leonid Yegoshin [Mon, 25 Mar 2013 18:08:40 +0000 (13:08 -0500)]
MIPS: microMIPS: Support handling of delay slots.

Add logic needed to properly calculate exceptions for delay slots
when in microMIPS mode.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Add support for exception handling.
Steven J. Hill [Mon, 25 Mar 2013 17:15:55 +0000 (12:15 -0500)]
MIPS: microMIPS: Add support for exception handling.

All exceptions must be taken in microMIPS mode, never in classic
MIPS mode or the kernel falls apart. A few NOP instructions are
used to maintain the correct alignment of microMIPS versions of
the exception vectors.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Floating point support.
Leonid Yegoshin [Mon, 25 Mar 2013 17:09:02 +0000 (12:09 -0500)]
MIPS: microMIPS: Floating point support.

Add logic needed to do floating point emulation in microMIPS mode.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Steven J. Hill <Steven. Hill@imgtec.com>
11 years agoMIPS: microMIPS: Fix macro naming in micro-assembler.
Steven J. Hill [Mon, 25 Mar 2013 17:03:41 +0000 (12:03 -0500)]
MIPS: microMIPS: Fix macro naming in micro-assembler.

The macros did not properly take into account the ISA that
the kernel was being compiled with. A classic MIPS kernel
will have the standard 'uasm_i_##op' macro functions with
'MM_uasm_i_##op' macro functions for the microMIPS version.
A pure microMIPS kernel will have the standard macros with
'CL_uasm_i_##op' macro functions for the classic version.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Fix incorrect mask for jump immediate.
Steven J. Hill [Mon, 25 Mar 2013 17:07:40 +0000 (12:07 -0500)]
MIPS: microMIPS: Fix incorrect mask for jump immediate.

Jump or branch target addresses have the first bit set. The
original mask did not take this into account and will cause
a field overflow warning for the target address when a jump
immediate instruction is built.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoKVM/MIPS32: Binary patching of select privileged instructions.
Sanjay Lal [Thu, 22 Nov 2012 02:34:16 +0000 (18:34 -0800)]
KVM/MIPS32: Binary patching of select privileged instructions.

Currently, the following instructions are translated:
- CACHE (indexed)
- CACHE (va based): translated to a SYNCI, overkill on D-CACHE operations,
  but still much faster than a trap.
- mfc0/mtc0: the virtual COP0 registers for the guest are implemented as
  2-D array.
  [COP#][SEL] and this is mapped into the guest kernel address space @ VA 0x0.
  mfc0/mtc0 operations are transformed to load/stores.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Do not call vcpu_load when injecting interrupts.
Sanjay Lal [Thu, 22 Nov 2012 02:34:15 +0000 (18:34 -0800)]
KVM/MIPS32: Do not call vcpu_load when injecting interrupts.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoEDAC: Don't give write permission to read-only files
Srivatsa S. Bhat [Tue, 30 Apr 2013 09:47:16 +0000 (15:17 +0530)]
EDAC: Don't give write permission to read-only files

I get the following warning on boot:

------------[ cut here ]------------
WARNING: at drivers/base/core.c:575 device_create_file+0x9a/0xa0()
Hardware name:  -[8737R2A]-
Write permission without 'store'
...
</snip>

Drilling down, this is related to dynamic channel ce_count attribute
files sporting a S_IWUSR mode without a ->store() function. Looking
around, it appears that they aren't supposed to have a ->store()
function. So remove the bogus write permission to get rid of the
warning.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: <stable@vger.kernel.org> # 3.[89]
[ shorten commit message ]
Signed-off-by: Borislav Petkov <bp@suse.de>
11 years agobfin cache: dcplb map: add 16M dcplb map for BF60x
Steven Miao [Fri, 19 Apr 2013 10:22:21 +0000 (18:22 +0800)]
bfin cache: dcplb map: add 16M dcplb map for BF60x

use 16M data cplb map on BF60x to avoid too much dcplb miss overhead
cleanup cplb info

Signed-off-by: Steven Miao <realmz6@gmail.com>
11 years agoKVM: emulator: emulate SALC
Paolo Bonzini [Thu, 9 May 2013 09:32:51 +0000 (11:32 +0200)]
KVM: emulator: emulate SALC

This is an almost-undocumented instruction available in 32-bit mode.
I say "almost" undocumented because AMD documents it in their opcode
maps just to say that it is unavailable in 64-bit mode (sections
"A.2.1 One-Byte Opcodes" and "B.3 Invalid and Reassigned Instructions
in 64-Bit Mode").

It is roughly equivalent to "sbb %al, %al" except it does not
set the flags.  Use fastop to emulate it, but do not use the opcode
directly because it would fail if the host is 64-bit!

Reported-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: stable@vger.kernel.org # 3.9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
11 years agoKVM: emulator: emulate XLAT
Paolo Bonzini [Thu, 9 May 2013 09:32:50 +0000 (11:32 +0200)]
KVM: emulator: emulate XLAT

This is used by SGABIOS, KVM breaks with emulate_invalid_guest_state=1.
It is just a MOV in disguise, with a funny source address.

Reported-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: stable@vger.kernel.org # 3.9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
11 years agoKVM: emulator: emulate AAM
Paolo Bonzini [Thu, 9 May 2013 09:32:49 +0000 (11:32 +0200)]
KVM: emulator: emulate AAM

This is used by SGABIOS, KVM breaks with emulate_invalid_guest_state=1.

AAM needs the source operand to be unsigned; do the same in AAD as well
for consistency, even though it does not affect the result.

Reported-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: stable@vger.kernel.org # 3.9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
11 years agoARC: [mm] refactor the core (i|d)cache line ops loops
Vineet Gupta [Thu, 9 May 2013 08:30:51 +0000 (14:00 +0530)]
ARC: [mm] refactor the core (i|d)cache line ops loops

Nothing semantical
* simplify the alignement code by using & operation only
* rename variables clearly as paddr

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
11 years agomicroblaze: Enable IRQ in arch_cpu_idle
Michal Simek [Thu, 9 May 2013 08:32:20 +0000 (10:32 +0200)]
microblaze: Enable IRQ in arch_cpu_idle

Microblaze requires to enable IRQ in cpu_idle loop.

It should be the part of this patch:
"microblaze: Use generic idle loop"
(sha1: e962bb9e9cf73b8c8893c95903e791dd5ec19fb4)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agoARC: [mm] serious bug in vaddr based icache flush
Vineet Gupta [Thu, 9 May 2013 08:15:12 +0000 (13:45 +0530)]
ARC: [mm] serious bug in vaddr based icache flush

vaddr used to index the cache was clipped from the wrong end, and thus
would potentially fail to flush the correct lines.

The problem was dorment for so long because up until the recent
optimizations it was only used for ptrace break-point only flushes.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
11 years agoxtensa: Switch to asm-generic/linkage.h
Geert Uytterhoeven [Tue, 7 May 2013 09:57:33 +0000 (11:57 +0200)]
xtensa: Switch to asm-generic/linkage.h

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
11 years agoxtensa: fix redboot load address
Chris Zankel [Thu, 9 May 2013 05:44:18 +0000 (22:44 -0700)]
xtensa: fix redboot load address

With the patch to support MMUv3, the base address for the loaded
binary image has changed, and a fix was applied to the U-Boot image.
This fixes the RedBoot image.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: ISS: fix timer_lock usage in rs_open
Max Filippov [Mon, 4 Feb 2013 19:38:13 +0000 (23:38 +0400)]
xtensa: ISS: fix timer_lock usage in rs_open

This fixes the following lockdep splat:

[   66.460000] =================================
[   66.460000] [ INFO: inconsistent lock state ]
[   66.460000] 3.9.0-rc5-00161-ga48dd49 #4 Not tainted
[   66.460000] ---------------------------------
[   66.460000] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
[   66.460000] swapper/1 [HC0[0]:SC1[1]:HE1:SE0] takes:
[   66.460000]  (timer_lock){+.?...}, at: [<d0006cde>] rs_poll+0x12/0xdc
[   66.460000] {SOFTIRQ-ON-W} state was registered at:
[   66.460000]   [<d00421f0>] lock_acquire+0xec/0x13c
[   66.460000]   [<d01ea036>] _raw_spin_lock+0x3a/0x84
[   66.460000]   [<d0006c8c>] rs_open+0x18/0x58
[   66.460000]   [<d0139ea2>] tty_open+0x262/0x3cc
[   66.460000]   [<d00942e0>] chrdev_open+0x8c/0xe0
[   66.460000]   [<d00907b2>] do_dentry_open$isra$16+0x10e/0x190
[   66.460000]   [<d0091141>] finish_open+0x39/0x48
[   66.460000]   [<d009a0b4>] do_last$isra$34+0x6c4/0x824
[   66.460000]   [<d009a27a>] path_openat+0x66/0x310
[   66.460000]   [<d009a53a>] do_filp_open+0x16/0x44
[   66.460000]   [<d0091445>] do_sys_open+0xd5/0x13c
[   66.460000]   [<d00914be>] sys_open+0x12/0x18
[   66.460000]   [<d0413ffc>] kernel_init_freeable+0xe4/0x12c
[   66.460000]   [<d01e2a9c>] kernel_init+0xc/0x9c
[   66.460000]   [<d00044fc>] ret_from_kernel_thread+0x8/0xc
[   66.460000] irq event stamp: 132542
[   66.460000] hardirqs last  enabled at (132542): [<d01ea2ec>] _raw_spin_unlock_irq+0x30/0x44
[   66.460000] hardirqs last disabled at (132541): [<d01ea11e>] _raw_spin_lock_irq+0xe/0x8c
[   66.460000] softirqs last  enabled at (132234): [<d0017d32>] __do_softirq+0x216/0x2a4
[   66.460000] softirqs last disabled at (132539): [<d0018024>] irq_exit+0x38/0x40
[   66.460000]
[   66.460000] other info that might help us debug this:
[   66.460000]  Possible unsafe locking scenario:
[   66.460000]
[   66.460000]        CPU0
[   66.460000]        ----
[   66.460000]   lock(timer_lock);
[   66.460000]   <Interrupt>
[   66.460000]     lock(timer_lock);
[   66.460000]
[   66.460000]  *** DEADLOCK ***
[   66.460000]
[   66.460000] 1 lock held by swapper/1:
[   66.460000]  #0:  (((&serial_timer))){+.-...}, at: [<d001c65c>] call_timer_fn+0x0/0x1f0
[   66.460000]
Stack: d7c2fac0 00000018 00000004 00000001 d7c2faa0 00000004 00000006 d7c2fa90
       9003e87c d7c2fae0 d7c30000 d025a87c 00000001 0000000f 00000000 d7c2fac0
       9004005d d7c2fb10 d7c30000 d7c30338 00000001 00000001 00000000 d7c30338
[   66.460000] Call Trace:
[   66.460000]  [<d01e4f93>] print_usage_bug$part$26+0x1c3/0x1c8
[   66.460000]  [<d003e87c>] mark_lock+0x2b4/0x440
[   66.460000]  [<d004005d>] __lock_acquire+0x54d/0x16c4
[   66.460000]  [<d00421f0>] lock_acquire+0xec/0x13c
[   66.460000]  [<d01ea036>] _raw_spin_lock+0x3a/0x84
[   66.460000]  [<d0006cde>] rs_poll+0x12/0xdc
[   66.460000]  [<d001c71a>] call_timer_fn+0xbe/0x1f0
[   66.460000]  [<d001cd90>] run_timer_softirq+0x198/0x1f4
[   66.460000]  [<d0017c30>] __do_softirq+0x114/0x2a4
[   66.460000]  [<d0018024>] irq_exit+0x38/0x40
[   66.460000]  [<d00046c0>] do_IRQ+0x44/0x48
[   66.460000]  [<d0005c58>] do_interrupt+0x4c/0x54
[   66.460000]  [<d0003c80>] common_exception_return+0x0/0x5c
[   66.460000]  [<d006682c>] free_pcppages_bulk+0x254/0x308
[   66.460000]

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: disable IRQs while IRQ handler is running
Max Filippov [Mon, 25 Mar 2013 22:51:43 +0000 (02:51 +0400)]
xtensa: disable IRQs while IRQ handler is running

IRQ handlers are expected to run with IRQs disabled.
See e.g. http://lwn.net/Articles/380931/ for a longer story.

This was overlooked in the commit
  2d1c645 xtensa: dispatch medium-priority interrupts
Revert to old behavior and simplify interrupt entry and exit code.
Interrupt handler still honours IRQ priority.

do_notify_resume/schedule must be called with interrupts enabled, enable
interrupts if we return from user exception.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: enable lockdep support
Max Filippov [Mon, 15 Apr 2013 05:21:35 +0000 (09:21 +0400)]
xtensa: enable lockdep support

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: fix arch_irqs_disabled_flags implementation
Max Filippov [Sun, 31 Mar 2013 02:34:10 +0000 (06:34 +0400)]
xtensa: fix arch_irqs_disabled_flags implementation

IRQs are disabled when PS.EXCM is set or PS.INTLEVEL is equal to or
higher than LOCKLEVEL.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: add irq flags trace support
Max Filippov [Sun, 31 Mar 2013 02:32:42 +0000 (06:32 +0400)]
xtensa: add irq flags trace support

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: provide custom CALLER_ADDR* implementations
Max Filippov [Sun, 7 Apr 2013 21:29:19 +0000 (01:29 +0400)]
xtensa: provide custom CALLER_ADDR* implementations

Definition of CALLER_ADDR* through __builtin_return_address makes
compiler insert calls to __xtensa_libgcc_window_spill, which in turn
makes fast_syscall_spill_registers syscall that clobbers registers when
called from the kernel mode, leading to invalid opcode exceptions on
return to userspace.

Provide definition for CALLER_ADDR0 as MAKE_PC_FROM_RA(a0, a1) and in
case CONFIG_FRAME_POINTER is enabled extract CALLER_ADDR{1-3} from
stack.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: add stacktrace support
Max Filippov [Mon, 15 Apr 2013 05:20:48 +0000 (09:20 +0400)]
xtensa: add stacktrace support

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: clean up stpill_registers
Max Filippov [Sat, 6 Apr 2013 00:10:13 +0000 (04:10 +0400)]
xtensa: clean up stpill_registers

- remove unused asm parameters;
- fix EXCM bit setting in the PS SR during _spill_registers call.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: don't use a7 in simcalls
Max Filippov [Mon, 15 Apr 2013 04:39:41 +0000 (08:39 +0400)]
xtensa: don't use a7 in simcalls

To support FRAME_POINTER avoid using a7 in __simc (none of the existing
simcalls needs it). Replace calls to __simc with more specific
simc_read, simc_write and simc_lseek calls.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: don't attempt to use unconfigured timers
Max Filippov [Sun, 10 Mar 2013 08:07:14 +0000 (12:07 +0400)]
xtensa: don't attempt to use unconfigured timers

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: provide default platform_pcibios_init implementation
Max Filippov [Sat, 30 Mar 2013 21:08:22 +0000 (01:08 +0400)]
xtensa: provide default platform_pcibios_init implementation

This fixes the following build error:

  arch/xtensa/kernel/built-in.o:(.init.literal+0xe8): undefined reference
to `platform_pcibios_init'
  arch/xtensa/kernel/built-in.o: In function `setup_arch':
  (.init.text+0x20e): undefined reference to `platform_pcibios_init'

and allows platform to omit definition of platform_pcibios_init if it's
empty.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: remove KCORE_ELF again
Paul Bolle [Fri, 22 Mar 2013 00:40:51 +0000 (01:40 +0100)]
xtensa: remove KCORE_ELF again

The Kconfig symbol KCORE_ELF was removed in v2.6.0, but reappeared in two
architectures. It is useless. Remove it again.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: document MMUv3 setup sequence
Max Filippov [Mon, 4 Mar 2013 19:48:14 +0000 (23:48 +0400)]
xtensa: document MMUv3 setup sequence

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: add MMU v3 support
Max Filippov [Mon, 3 Dec 2012 11:01:43 +0000 (15:01 +0400)]
xtensa: add MMU v3 support

MMUv3 comes out of reset with identity vaddr -> paddr mapping in the TLB
way 6:

Way 6 (512 MB)
        Vaddr       Paddr       ASID  Attr RWX Cache
        ----------  ----------  ----  ---- --- -------
        0x00000000  0x00000000  0x01  0x03 RWX Bypass
        0x20000000  0x20000000  0x01  0x03 RWX Bypass
        0x40000000  0x40000000  0x01  0x03 RWX Bypass
        0x60000000  0x60000000  0x01  0x03 RWX Bypass
        0x80000000  0x80000000  0x01  0x03 RWX Bypass
        0xa0000000  0xa0000000  0x01  0x03 RWX Bypass
        0xc0000000  0xc0000000  0x01  0x03 RWX Bypass
        0xe0000000  0xe0000000  0x01  0x03 RWX Bypass

This patch adds remapping code at the reset vector or at the kernel
_start (depending on CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) that
reconfigures MMUv3 as MMUv2:

Way 5 (128 MB)
        Vaddr       Paddr       ASID  Attr RWX Cache
        ----------  ----------  ----  ---- --- -------
        0xd0000000  0x00000000  0x01  0x07 RWX WB
        0xd8000000  0x00000000  0x01  0x03 RWX Bypass
Way 6 (256 MB)
        Vaddr       Paddr       ASID  Attr RWX Cache
        ----------  ----------  ----  ---- --- -------
        0xe0000000  0xf0000000  0x01  0x07 RWX WB
        0xf0000000  0xf0000000  0x01  0x03 RWX Bypass

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: fix ibreakenable register update
Max Filippov [Sun, 3 Mar 2013 23:40:42 +0000 (03:40 +0400)]
xtensa: fix ibreakenable register update

Only set the register when there is at least one ibreak register,
otherwise the build fails:
arch/xtensa/kernel/head.S:105: Error: invalid register 'ibreakenable'
for 'wsr' instruction
arch/xtensa/platforms/iss/setup.c:67: Error: invalid register
'ibreakenable' for 'wsr' instruction

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: fix oprofile building as module
Max Filippov [Mon, 25 Feb 2013 15:01:33 +0000 (19:01 +0400)]
xtensa: fix oprofile building as module

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agomicroblaze: Fix uaccess_ok macro
Michal Simek [Thu, 28 Mar 2013 15:42:44 +0000 (16:42 +0100)]
microblaze: Fix uaccess_ok macro

Fix access_ok macro no to permit
case where user will try to access
the last address space which is equal
to segment address.

Example:
segment addr = 0xbfff ffff
address = 0xbfff fff0
size = 0x10

Current wrong implementation
0xbfff ffff >= (0xbfff fff0 | 0x10 | (0xbfff fff0 + 0x10))
0xbfff ffff >= (0xbfff fff0        | 0xc000 0000)
0xbfff ffff >= 0xf000 0000
return 0 which is access failed even the combination is valid.
because get_fs().seq returns the last valid address.

This patch fix this problem.

Size equals to zero is valid access.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agomicroblaze: Add support for new cpu versions and target architecture
Michal Simek [Wed, 19 Dec 2012 09:52:19 +0000 (10:52 +0100)]
microblaze: Add support for new cpu versions and target architecture

Update PVR values based on reference manual.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agomicroblaze: Do not select OPT_LIB_ASM by default
Michal Simek [Fri, 3 May 2013 07:29:28 +0000 (09:29 +0200)]
microblaze: Do not select OPT_LIB_ASM by default

This option is valid only for BE systems.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agomicroblaze: Fix initrd support
Michal Simek [Thu, 2 May 2013 13:53:51 +0000 (15:53 +0200)]
microblaze: Fix initrd support

Initrd/ramdisk support has been never validated.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agomicroblaze: Do not use r6 in head.S
Michal Simek [Thu, 2 May 2013 10:28:31 +0000 (12:28 +0200)]
microblaze: Do not use r6 in head.S

r6 stores pointer to ramdisk and shouldn't
be used before it is passed to machine_early_init.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agomicroblaze: pci: Remove duplicated header
Michal Simek [Wed, 1 May 2013 13:33:43 +0000 (15:33 +0200)]
microblaze: pci: Remove duplicated header

Remove duplicated header.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agomicroblaze: Set the default irq_domain
Dan Christensen [Sun, 17 Mar 2013 09:48:56 +0000 (04:48 -0500)]
microblaze: Set the default irq_domain

Register the irq_domain created during initialization as the default so
that device drivers can pass NULL to irq_create_mapping and get a
virtual irq to pass to request_irq.

Signed-off-by: Dan Christensen <opello@opello.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agomicroblaze: pci: Remove duplicated include from pci-common.c
Wei Yongjun [Mon, 11 Mar 2013 14:13:30 +0000 (22:13 +0800)]
microblaze: pci: Remove duplicated include from pci-common.c

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
11 years agowatchdog: Fix race condition in registration code
Guenter Roeck [Sat, 6 Apr 2013 04:22:43 +0000 (21:22 -0700)]
watchdog: Fix race condition in registration code

A race condition exists when registering the first watchdog device.
Sequence of events:

- watchdog_register_device calls watchdog_dev_register
- watchdog_dev_register creates the watchdog misc device by calling
  misc_register.
  At that time, the matching character device (/dev/watchdog0) does not yet
  exist, and old_wdd is not set either.
- Userspace gets an event and opens /dev/watchdog
- watchdog_open is called and sets wdd = old_wdd, which is still NULL,
  and tries to dereference it. This causes the kernel to panic.

Seen with systemd trying to open /dev/watchdog immediately after
it was created.

Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
11 years agowatchdog: Convert to devm_ioremap_resource()
Sachin Kamat [Mon, 4 Mar 2013 05:06:41 +0000 (10:36 +0530)]
watchdog: Convert to devm_ioremap_resource()

Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Gabor Juhos <juhosg@openwrt.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
11 years agoKVM: VMX: fix halt emulation while emulating invalid guest sate
Gleb Natapov [Wed, 8 May 2013 15:38:44 +0000 (18:38 +0300)]
KVM: VMX: fix halt emulation while emulating invalid guest sate

The invalid guest state emulation loop does not check halt_request
which causes 100% cpu loop while guest is in halt and in invalid
state, but more serious issue is that this leaves halt_request set, so
random instruction emulated by vm86 #GP exit can be interpreted
as halt which causes guest hang. Fix both problems by handling
halt_request in emulation loop.

Reported-by: Tomas Papan <tomas.papan@gmail.com>
Tested-by: Tomas Papan <tomas.papan@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
CC: stable@vger.kernel.org
Signed-off-by: Gleb Natapov <gleb@redhat.com>
11 years agoblackfin: smp: fix smp build after drop asm/system.h
Steven Miao [Wed, 8 May 2013 10:06:59 +0000 (18:06 +0800)]
blackfin: smp: fix smp build after drop asm/system.h

Signed-off-by: Steven Miao <realmz6@gmail.com>
11 years agoblackfin: fix bootup core clock and system clock display
James Cosin [Tue, 24 Jul 2012 01:54:35 +0000 (09:54 +0800)]
blackfin: fix bootup core clock and system clock display

From: James Cosin <jkosin@intcomgrp.com>

fixes the number of digits to 6 after the decimal point to regain the
significant 0s in the frequency after the decimal point.

Signed-off-by: Steven Miao <realmz6@gmail.com>
11 years agoARM: dts: Configure and fix the McSPI pins for 4430sdp
Tony Lindgren [Wed, 8 May 2013 23:13:14 +0000 (16:13 -0700)]
ARM: dts: Configure and fix the McSPI pins for 4430sdp

The bootloader configures the pins, but has pull bits
set without pull enable bits. While this is harmless,
and won't do anything, it seems to cause confusion at
least for me every time looking at the pin configuration.
Fix it for DT based boot.

Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: dts: AM33XX: Add GPMC node
Philip Avinash [Thu, 2 May 2013 09:44:03 +0000 (15:14 +0530)]
ARM: dts: AM33XX: Add GPMC node

Add GPMC data node to AM33XX device tree file.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: dts: OMAP4460: Fix CPU OPP voltages
Nishanth Menon [Fri, 26 Apr 2013 17:39:33 +0000 (12:39 -0500)]
ARM: dts: OMAP4460: Fix CPU OPP voltages

commit d16fb25 (ARM: dts: OMAP4460: Add CPU OPP table)
introduced wrong OPP voltages per OPP by mistake. Sync the OPP
tables with existing OMAP4460 OPP data in
arch/arm/mach-omap2/opp4xxx_data.c

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: dts: OMAP36xx: Fix CPU OPP voltages
Nishanth Menon [Fri, 26 Apr 2013 17:39:32 +0000 (12:39 -0500)]
ARM: dts: OMAP36xx: Fix CPU OPP voltages

commit 3027e26 (ARM: dts: OMAP36xx: Add CPU OPP table)
introduced wrong OPP voltages per OPP by mistake. Sync the OPP
tables with existing OMAP36xx OPP data in
arch/arm/mach-omap2/opp3xxx_data.c

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: OMAP4+: omap2plus_defconfig: Enable audio via TWL6040 as module
Peter Ujfalusi [Wed, 8 May 2013 23:48:02 +0000 (16:48 -0700)]
ARM: OMAP4+: omap2plus_defconfig: Enable audio via TWL6040 as module

Boards supported upstream all use TWL6040 as audio codec, enable the common
ASoC machine driver by default for them.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: OMAP2: AM33XX: id: Add support for new AM335x PG2.1 Si
Vaibhav Hiremath [Wed, 8 May 2013 23:48:02 +0000 (16:48 -0700)]
ARM: OMAP2: AM33XX: id: Add support for new AM335x PG2.1 Si

Add support for chip id detection of AM335x PG2.1 Silicon.

Currently omap3xxx_check_revision() detects PG1.0 and PG2.0 only,
this patch extends it by adding PG2.1 Si support.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoomap: mux: add AM/DM37x gpios
Christoph Fritz [Wed, 8 May 2013 23:48:02 +0000 (16:48 -0700)]
omap: mux: add AM/DM37x gpios

This patch adds GPIO pins found on AM/DM37x.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoMerge branch 'omap-gpmc-fixes-for-v3.10' of git://github.com/jonhunter/linux into...
Tony Lindgren [Thu, 9 May 2013 00:06:39 +0000 (17:06 -0700)]
Merge branch 'omap-gpmc-fixes-for-v3.10' of git://github.com/jonhunter/linux into fixes

11 years agoAdd support for fan button on Ideapad Z580
Maxim Mikityanskiy [Wed, 20 Mar 2013 10:34:17 +0000 (12:34 +0200)]
Add support for fan button on Ideapad Z580

The patch adds support for fan control button on Ideapad Z580. This is
the same button as on Z570, but it raises different bit in
VPCCMD_R_SPECIAL_BUTTONS. Also add message to dmesg when unknown button
press detected, it will help adding support for new special buttons.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Tested-by: Ivan Vojtko <nekroman.sk@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agopvpanic: pvpanic device driver
Hu Tao [Wed, 8 May 2013 03:15:32 +0000 (11:15 +0800)]
pvpanic: pvpanic device driver

pvpanic device is a qemu simulated device through which guest panic
event is sent to host.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agoasus-nb-wmi: set wapf=4 for ASUSTeK COMPUTER INC. X75A
AceLan Kao [Thu, 25 Apr 2013 07:11:07 +0000 (15:11 +0800)]
asus-nb-wmi: set wapf=4 for ASUSTeK COMPUTER INC. X75A

BugLink: http://bugs.launchpad.net/bugs/1172151
Need to set wapf to 4 for ASUSTeK COMPUTER INC. X75A, so that
user can toggle wifi function through function key correctly.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agodrivers: platform: x86: Use PTR_RET function
Alexandru Gheorghiu [Tue, 19 Mar 2013 01:01:34 +0000 (03:01 +0200)]
drivers: platform: x86: Use PTR_RET function

Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agosony-laptop: SVS151290S kbd backlight and gfx switch support
Arthur Wirski [Sun, 17 Mar 2013 19:21:35 +0000 (20:21 +0100)]
sony-laptop: SVS151290S kbd backlight and gfx switch support

SVS151290S series uses handle 0x0163 for keyboard backlight and 0x015B for the graphics switch.

Signed-off-by: Arthur Wirski <awirski@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agohp-wmi: add more definitions for new event_id's
Alex Hung [Fri, 15 Mar 2013 09:18:22 +0000 (17:18 +0800)]
hp-wmi: add more definitions for new event_id's

New HP laptops start generating new events, and hp-wmi prints unknown
event_ids for them. This patch also removes these messages

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agodell-laptop: Fix krealloc() misuse in parse_da_table()
David Woodhouse [Thu, 14 Mar 2013 13:33:15 +0000 (13:33 +0000)]
dell-laptop: Fix krealloc() misuse in parse_da_table()

If krealloc() returns NULL, it *doesn't* free the original. So any code
of the form 'foo = krealloc(foo, …);' is almost certainly a bug.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agohp_accel: Ignore the error from lis3lv02d_poweron() at resume
Shuah Khan [Sat, 9 Mar 2013 18:39:22 +0000 (11:39 -0700)]
hp_accel: Ignore the error from lis3lv02d_poweron() at resume

The error in lis3lv02_poweron() is harmless in the resume path, so
we should ignore it. It is inline with the other usages of lis3lv02_poweron()
and matches the 3.0 code for this routine. This patch is in suse git and
might have missed making it into the mainline.
opensuse - commit id: 66ccdac87c322cf7af12bddba8c805af640b1cff

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
CC: stable@vger.kernel.org 3.8, 3.4, 3.5, 3.2
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agodell: add new dell WMI format for the AIO machines
AceLan Kao [Fri, 8 Mar 2013 07:44:30 +0000 (15:44 +0800)]
dell: add new dell WMI format for the AIO machines

There is a new DELL WMI spec. with new WMI event format.
I'm working on the AIO machines, but I think the new format will apply to
all the Dell's machines, not only for AIO, which will be released later
this year.

The new format of the WMI buffer is shown as below
word 0 - the number of words following in the WMI buffer(not including
        this word.
word 1 - the event type
0x0000 - A hot key is pressed or an event occurred
0x000F - A sequence of hot keys are pressed
word 2 and on - the event data

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
11 years agoARM: OMAP1: DMA: fix error handling in omap1_system_dma_init()
Wei Yongjun [Wed, 8 May 2013 23:48:02 +0000 (16:48 -0700)]
ARM: OMAP1: DMA: fix error handling in omap1_system_dma_init()

Add the missing iounmap() before return from omap1_system_dma_init()
in the error handling case.
Also removed platform_device_del() on add resources error case which
cause dup device delete.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: OMAP2+: omap_device: use late_initcall_sync
Kevin Hilman [Wed, 8 May 2013 23:48:01 +0000 (16:48 -0700)]
ARM: OMAP2+: omap_device: use late_initcall_sync

If DEBUG_LL and earlyprintk are enabled, and omap-serial.c is compiled
as a module, the kernel boot hangs early as the clocks for serial port
are cut while earlyprintk still uses the port.

The problem is a race between the late_initcall for omap_device (which
idles devices that have no drivers) and the late_initcall in
kernel/printk.c which turns off the earlyconsole.   Any printks
that happen between this omap_device late initcall and the earlyconsole
late initcall will crash when accessing the UART.

The fix is to ensure the omap_device initcall happens after the
earlyconsole initcall.

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: OMAP: RX-51: change probe order of touchscreen and panel SPI devices
Aaro Koskinen [Wed, 8 May 2013 23:48:00 +0000 (16:48 -0700)]
ARM: OMAP: RX-51: change probe order of touchscreen and panel SPI devices

Commit 9fdca9df (spi: omap2-mcspi: convert to module_platform_driver)
broke the SPI display/panel driver probe on RX-51/N900. The exact cause is
not fully understood, but it seems to be related to the probe order. SPI
communication to the panel driver (spi1.2) fails unless the touchscreen
(spi1.0) has been probed/initialized before. When the omap2-mcspi driver
was converted to a platform driver, it resulted in that the devices are
probed immediately after the board registers them in the order they are
listed in the board file.

Fix the issue by moving the touchscreen before the panel in the SPI
device list.

The patch fixes the following failure:

[    1.260955] acx565akm spi1.2: invalid display ID
[    1.265899] panel-acx565akm display0: acx_panel_probe panel detect error
[    1.273071] omapdss CORE error: driver probe failed: -19

Tested-by: Sebastian Reichel <sre@debian.org>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: Joni Lapilainen <joni.lapilainen@gmail.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: stable@vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: OMAP3: Beagle: Fix USB Host on beagle xM Ax/Bx
Roger Quadros [Wed, 8 May 2013 23:48:00 +0000 (16:48 -0700)]
ARM: OMAP3: Beagle: Fix USB Host on beagle xM Ax/Bx

On Beagle xM Rev. Ax/Bx, the USB power enable GPIO logic is
reversed when compared to other revisions i.e. it is
active high instead of active low.

Use the beagle_config.usb_pwr_level flag correctly so that
the power regulator can be configured at runtime.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoMerge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Wed, 8 May 2013 22:29:48 +0000 (15:29 -0700)]
Merge tag 'rdma-for-linus' of git://git./linux/kernel/git/roland/infiniband

Pull InfiniBand/RDMA changes from Roland Dreier:
 - XRC transport fixes
 - Fix DHCP on IPoIB
 - mlx4 preparations for flow steering
 - iSER fixes
 - miscellaneous other fixes

* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (23 commits)
  IB/iser: Add support for iser CM REQ additional info
  IB/iser: Return error to upper layers on EAGAIN registration failures
  IB/iser: Move informational messages from error to info level
  IB/iser: Add module version
  mlx4_core: Expose a few helpers to fill DMFS HW strucutures
  mlx4_core: Directly expose fields of DMFS HW rule control segment
  mlx4_core: Change a few DMFS fields names to match firmare spec
  mlx4: Match DMFS promiscuous field names to firmware spec
  mlx4_core: Move DMFS HW structs to common header file
  IB/mlx4: Set link type for RAW PACKET QPs in the QP context
  IB/mlx4: Disable VLAN stripping for RAW PACKET QPs
  mlx4_core: Reduce warning message for SRQ_LIMIT event to debug level
  RDMA/iwcm: Don't touch cmid after dropping reference
  IB/qib: Correct qib_verbs_register_sysfs() error handling
  IB/ipath: Correct ipath_verbs_register_sysfs() error handling
  RDMA/cxgb4: Fix SQ allocation when on-chip SQ is disabled
  SRPT: Fix odd use of WARN_ON()
  IPoIB: Fix ipoib_hard_header() return value
  RDMA: Rename random32() to prandom_u32()
  RDMA/cxgb3: Fix uninitialized variable
  ...

11 years agoMerge tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas...
Linus Torvalds [Wed, 8 May 2013 22:15:27 +0000 (15:15 -0700)]
Merge tag 'arm64-for-linus' of git://git./linux/kernel/git/cmarinas/linux-aarch64

Pull arm64 update from Catalin Marinas:

 - Since drivers/irqchip/irq-gic.c no longer has dependencies on arm32
   specifics (the 'gic' branch merged), it can be enabled on arm64.

 - Enable arm64 support for poweroff/restart (for code under
   drivers/power/reset/).

 - Fixes (dts file, exception handling, bitops)

* tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
  arm64: Treat the bitops index argument as an 'int'
  arm64: Ignore the 'write' ESR flag on cache maintenance faults
  arm64: dts: fix #address-cells for foundation-v8
  arm64: vexpress: Add support for poweroff/restart
  arm64: Enable support for the ARM GIC interrupt controller

11 years agoMerge tag 'f2fs-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk...
Linus Torvalds [Wed, 8 May 2013 22:11:48 +0000 (15:11 -0700)]
Merge tag 'f2fs-for-v3.10' of git://git./linux/kernel/git/jaegeuk/f2fs

Pull f2fs updates from Jaegeuk Kim:
 "This patch-set includes the following major enhancement patches.
   - introduce a new gloabl lock scheme
   - add tracepoints on several major functions
   - fix the overall cleaning process focused on victim selection
   - apply the block plugging to merge IOs as much as possible
   - enhance management of free nids and its list
   - enhance the readahead mode for node pages
   - address several cretical deadlock conditions
   - reduce lock_page calls

  The other minor bug fixes and enhancements are as follows.
   - calculation mistakes: overflow
   - bio types: READ, READA, and READ_SYNC
   - fix the recovery flow, data races, and null pointer errors"

* tag 'f2fs-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (68 commits)
  f2fs: cover free_nid management with spin_lock
  f2fs: optimize scan_nat_page()
  f2fs: code cleanup for scan_nat_page() and build_free_nids()
  f2fs: bugfix for alloc_nid_failed()
  f2fs: recover when journal contains deleted files
  f2fs: continue to mount after failing recovery
  f2fs: avoid deadlock during evict after f2fs_gc
  f2fs: modify the number of issued pages to merge IOs
  f2fs: remove useless #include <linux/proc_fs.h> as we're now using sysfs as debug entry.
  f2fs: fix inconsistent using of NM_WOUT_THRESHOLD
  f2fs: check truncation of mapping after lock_page
  f2fs: enhance alloc_nid and build_free_nids flows
  f2fs: add a tracepoint on f2fs_new_inode
  f2fs: check nid == 0 in add_free_nid
  f2fs: add REQ_META about metadata requests for submit
  f2fs: give a chance to merge IOs by IO scheduler
  f2fs: avoid frequent background GC
  f2fs: add tracepoints to debug checkpoint request
  f2fs: add tracepoints for write page operations
  f2fs: add tracepoints to debug the block allocation
  ...

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux...
Linus Torvalds [Wed, 8 May 2013 22:08:59 +0000 (15:08 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/rkuo/linux-hexagon-kernel

Pull Hexagon fixes from Richard Kuo:
 "A bug fix and a Kconfig cleanup"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel:
  HEXAGON: Remove non existent reference to GENERIC_KERNEL_EXECVE & GENERIC_KERNEL_THREAD
  Hexagon: fix register used to call do_work_pending

11 years agoARM: dts: OMAP4: Fix ethernet IRQ for OMAP4 boards
Jon Hunter [Wed, 10 Apr 2013 17:31:07 +0000 (12:31 -0500)]
ARM: dts: OMAP4: Fix ethernet IRQ for OMAP4 boards

Commit ff5c9059 (ARM: dts: OMAP3+: Correct gpio #interrupts-cells
property) updated the number of interrupt cells required for configuring
gpios as interrupts for other devices (such as ethernet controllers).
This update allowed the interrupt type (edge, level, etc) to be
configured via device-tree (as described in the
Documentation/devicetree/bindings/gpio/gpio-omap.txt).

This broke ethernet support on the OMAP4 SDP board that defines a gpio
as the ethernet IRQ because the interrupt type (level, edge, etc) was
not getting configured correctly. This board use the ks8851 ethernet
chip which has an active low interrupt. Fix this by defining the gpio
interrupt as active-low in the device-tree binding.

Please note that the OMAP4-VAR-SOM also uses the same ethernet
controller and it is expected it will have the same problem. So the
same fix is also applied to this board.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agomm/slab: Fix crash during slab init
Chris Mason [Wed, 8 May 2013 19:56:28 +0000 (15:56 -0400)]
mm/slab: Fix crash during slab init

Commit 8a965b3baa89 ("mm, slab_common: Fix bootstrap creation of kmalloc
caches") introduced a regression that caused us to crash early during
boot.  The commit was introducing ordering of slab creation, making sure
two odd-sized slabs were created after specific powers of two sizes.

But, if any of the power of two slabs were created earlier during boot,
slabs at index 1 or 2 might not get created at all.  This patch makes
sure none of the slabs get skipped.

Tony Lindgren bisected this down to the offending commit, which really
helped because bisect kept bringing me to almost but not quite this one.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Tested-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoNFS4.1 Fix data server connection race
Andy Adamson [Wed, 8 May 2013 20:21:18 +0000 (16:21 -0400)]
NFS4.1 Fix data server connection race

Unlike meta data server mounts which support multiple mount points to
the same server via struct nfs_server, data servers support a single connection.

Concurrent calls to setup the data server connection can race where the first
call allocates the nfs_client struct, and before the cache struct nfs_client
pointer can be set, a second call also tries to setup the connection, finds the
already allocated nfs_client, bumps the reference count, re-initializes the
session,etc. This results in a hanging data server session after umount.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
11 years agoMerge branches 'cxgb4', 'ipoib', 'iser', 'misc', 'mlx4', 'qib' and 'srp' into for...
Roland Dreier [Wed, 8 May 2013 21:12:37 +0000 (14:12 -0700)]
Merge branches 'cxgb4', 'ipoib', 'iser', 'misc', 'mlx4', 'qib' and 'srp' into for-next

11 years agoif_cablemodem.h: Add parenthesis around ioctl macros
Josh Boyer [Wed, 8 May 2013 09:45:47 +0000 (09:45 +0000)]
if_cablemodem.h: Add parenthesis around ioctl macros

Protect the SIOCGCM* ioctl macros with parenthesis.

Reported-by: Paul Wouters <pwouters@redhat.com>
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agogso: Handle Trans-Ether-Bridging protocol in skb_network_protocol()
Pravin B Shelar [Tue, 7 May 2013 20:41:07 +0000 (20:41 +0000)]
gso: Handle Trans-Ether-Bridging protocol in skb_network_protocol()

Rather than having logic to calculate inner protocol in every
tunnel gso handler move it to gso code. This simplifies code.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Cong Wang <amwang@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: fec: fix kernel oops when plug/unplug cable many times
Frank Li [Tue, 7 May 2013 14:08:44 +0000 (14:08 +0000)]
net: fec: fix kernel oops when plug/unplug cable many times

reproduce steps
 1. flood ping from other machine
  ping -f -s 41000 IP
 2. run below script
    while [ 1 ]; do ethtool -s eth0 autoneg off;
    sleep 3;ethtool -s eth0 autoneg on; sleep 4; done;

You can see oops in one hour.

The reason is fec_restart clear BD but NAPI may use it.
The solution is disable NAPI and stop xmit when reset BD.
disable NAPI may sleep, so fec_restart can't be call in
atomic context.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobfin_mac: fix error return code in bfin_mac_probe()
Wei Yongjun [Tue, 7 May 2013 02:23:38 +0000 (02:23 +0000)]
bfin_mac: fix error return code in bfin_mac_probe()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosfc: fix return value check in efx_ptp_probe_channel()
Wei Yongjun [Tue, 7 May 2013 02:19:25 +0000 (02:19 +0000)]
sfc: fix return value check in efx_ptp_probe_channel()

In case of error, the function ptp_clock_register() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/spider_net: fix error return code in spider_net_open()
Wei Yongjun [Tue, 7 May 2013 02:16:00 +0000 (02:16 +0000)]
net/spider_net: fix error return code in spider_net_open()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/irda: fix error return code in bfin_sir_open()
Wei Yongjun [Tue, 7 May 2013 02:14:33 +0000 (02:14 +0000)]
net/irda: fix error return code in bfin_sir_open()

Fix to return -ENOMEM in the irlap_open() error handling case instead
of 0(overwrite to 0 by bfin_sir_startup()), as done elsewhere in this
function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: of_mdio: fix behavior on missing phy device
Sebastian Hesselbarth [Mon, 6 May 2013 23:49:31 +0000 (23:49 +0000)]
net: of_mdio: fix behavior on missing phy device

of_mdiobus_register creates a phy_device even if get_phy_device failed
to create it previously. This causes indefinite polling on non-existent
PHYs. This fix makes of_mdio_register rely on get_phy_device to
properly create the device or fail otherwise.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosierra_net: keep status interrupt URB active
Dan Williams [Mon, 6 May 2013 11:34:56 +0000 (11:34 +0000)]
sierra_net: keep status interrupt URB active

The driver and firmware sync up through SYNC messages, and the
firmware's affirmative reply to these SYNC messages appears to be the
"Reset" indication received via the status interrupt endpoint.  Thus the
driver needs the status interrupt endpoint always active so that the
Reset indication can be received even if the netdev is closed, which is
the case right after device insertion.

If the Reset indication is not received by the driver, it continues
sending SYNC messages to the firmware, which crashes about 10 seconds
later and the device stops responding.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agousbnet: allow status interrupt URB to always be active
Dan Williams [Mon, 6 May 2013 11:29:23 +0000 (11:29 +0000)]
usbnet: allow status interrupt URB to always be active

Some drivers (sierra_net) need the status interrupt URB
active even when the device is closed, because they receive
custom indications from firmware.  Add functions to refcount
the status interrupt URB submit/kill operation so that
sub-drivers and the generic driver don't fight over whether
the status interrupt URB is active or not.

A sub-driver can call usbnet_status_start() at any time, but
the URB is only submitted the first time the function is
called.  Likewise, when the sub-driver is done with the URB,
it calls usbnet_status_stop() but the URB is only killed when
all users have stopped it.  The URB is still killed and
re-submitted for suspend/resume, as before, with the same
refcount it had at suspend.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqmi_wwan/cdc_ether: add device IDs for Dell 5804 (Novatel E371) WWAN card
Dan Williams [Mon, 6 May 2013 11:17:37 +0000 (11:17 +0000)]
qmi_wwan/cdc_ether: add device IDs for Dell 5804 (Novatel E371) WWAN card

A rebranded Novatel E371 for AT&T's LTE bands.  qmi_wwan should drive this
device, while cdc_ether should ignore it.  Even though the USB descriptors
are plain CDC-ETHER that USB interface is a QMI interface.

Cc: <stable@vger.kernel.org>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: disable TX in be_close()
Sathya Perla [Wed, 8 May 2013 02:05:50 +0000 (02:05 +0000)]
be2net: disable TX in be_close()

be_close() followed by be_clear() is called as a part of cleanup in the
EEH/AER flow.  This patch stops TX in be_close() before cleaning/freeing
up the TX queues in be_clear(). This prevents be_xmit() from being called
while TX queues no longer exist.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: fix EQ from getting full while cleaning RX CQ
Sathya Perla [Wed, 8 May 2013 02:05:49 +0000 (02:05 +0000)]
be2net: fix EQ from getting full while cleaning RX CQ

While cleaning RX queues, the CQ DB may be rung several times (with rearm)
while waiting for the flush compl. Each CQ-notify with rearm can result in
an event. The EQ may get full resulting in a HW error.

Fix this by not re-arming the CQ while notifying a valid completion.
Also, there's no need to wait for 1ms after destroying RXQ, as the code in
be_rx_cq_clean() waits for the flush compl to arrive.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: fix payload_len value for GET_MAC_LIST cmd req
Sathya Perla [Wed, 8 May 2013 02:05:48 +0000 (02:05 +0000)]
be2net: fix payload_len value for GET_MAC_LIST cmd req

The buffer size for a FW cmd request must be big enough to fit the response,
else the cmd fails. For GET_MAC_LIST cmd, though the memory allocated for
the cmd is big enough to fit the response, the payload_len value in the
WRB hdr is being set to the request length only.
Fix this for GET_MAC_LIST cmd.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: provision VF resources before enabling SR-IOV
Sathya Perla [Wed, 8 May 2013 02:05:47 +0000 (02:05 +0000)]
be2net: provision VF resources before enabling SR-IOV

When the PF driver calls pci_enable_sriov(), the VFs may be probed
inline before the call returns. So, the resources required for all VFs
must be provisioned by the PF driver *before* calling pci_enable_sriov();
else, VF probe will fail.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'for-3.10/drivers' of git://git.kernel.dk/linux-block
Linus Torvalds [Wed, 8 May 2013 18:51:05 +0000 (11:51 -0700)]
Merge branch 'for-3.10/drivers' of git://git.kernel.dk/linux-block

Pull block driver updates from Jens Axboe:
 "It might look big in volume, but when categorized, not a lot of
  drivers are touched.  The pull request contains:

   - mtip32xx fixes from Micron.

   - A slew of drbd updates, this time in a nicer series.

   - bcache, a flash/ssd caching framework from Kent.

   - Fixes for cciss"

* 'for-3.10/drivers' of git://git.kernel.dk/linux-block: (66 commits)
  bcache: Use bd_link_disk_holder()
  bcache: Allocator cleanup/fixes
  cciss: bug fix to prevent cciss from loading in kdump crash kernel
  cciss: add cciss_allow_hpsa module parameter
  drivers/block/mg_disk.c: add CONFIG_PM_SLEEP to suspend/resume functions
  mtip32xx: Workaround for unaligned writes
  bcache: Make sure blocksize isn't smaller than device blocksize
  bcache: Fix merge_bvec_fn usage for when it modifies the bvm
  bcache: Correctly check against BIO_MAX_PAGES
  bcache: Hack around stuff that clones up to bi_max_vecs
  bcache: Set ra_pages based on backing device's ra_pages
  bcache: Take data offset from the bdev superblock.
  mtip32xx: mtip32xx: Disable TRIM support
  mtip32xx: fix a smatch warning
  bcache: Disable broken btree fuzz tester
  bcache: Fix a format string overflow
  bcache: Fix a minor memory leak on device teardown
  bcache: Documentation updates
  bcache: Use WARN_ONCE() instead of __WARN()
  bcache: Add missing #include <linux/prefetch.h>
  ...

11 years agortc: rtc-tile: add missing platform_device_unregister() when module exit
Wei Yongjun [Sun, 5 May 2013 05:07:49 +0000 (01:07 -0400)]
rtc: rtc-tile: add missing platform_device_unregister() when module exit

We have registered platform device when module init, and
need unregister it when module exit.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
11 years agopstore/ram: fix error return code in ramoops_probe()
Wei Yongjun [Tue, 7 May 2013 11:39:20 +0000 (19:39 +0800)]
pstore/ram: fix error return code in ramoops_probe()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>