platform/adaptation/renesas_rcar/renesas_kernel.git
11 years agoMerge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Thu, 9 May 2013 16:46:45 +0000 (09:46 -0700)]
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dmaengine updates from Vinod Koul:
 "This time we have dmatest improvements from Andy along with dw_dmac
  fixes.  He has also done support for acpi for dmanegine.

  Also we have bunch of fixes going in DT support for dmanegine for
  various folks.  Then Haswell and other ioat changes from Dave and
  SUDMAC support from Shimoda."

* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (53 commits)
  dma: tegra: implement suspend/resume callbacks
  dma:of: Use a mutex to protect the of_dma_list
  dma: of: Fix of_node reference leak
  dmaengine: sirf: move driver init from module_init to subsys_initcall
  sudmac: add support for SUDMAC
  dma: sh: add Kconfig
  at_hdmac: move to generic DMA binding
  ioatdma: ioat3_alloc_sed can be static
  ioatdma: Adding write back descriptor error status support for ioatdma 3.3
  ioatdma: S1200 platforms ioatdma channel 2 and 3 falsely advertise RAID cap
  ioatdma: Adding support for 16 src PQ ops and super extended descriptors
  ioatdma: Removing hw bug workaround for CB3.x .2 and earlier
  dw_dmac: add ACPI support
  dmaengine: call acpi_dma_request_slave_channel as well
  dma: acpi-dma: introduce ACPI DMA helpers
  dma: of: Remove unnecessary list_empty check
  DMA: OF: Check properties value before running be32_to_cpup() on it
  DMA: of: Constant names
  ioatdma: skip silicon bug workaround for pq_align for cb3.3
  ioatdma: Removing PQ val disable for cb3.3
  ...

11 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Thu, 9 May 2013 16:40:49 +0000 (09:40 -0700)]
Merge branch 'next' of git://git./linux/kernel/git/rzhang/linux

Pull thermal management update from Zhang Rui:
 "The most important one is to build thermal core and governor and cpu
  cooling code into one module.  This fixes a regression that thermal
  core does not work if it is built as module, since 3.7.  I'll backport
  them to stable kernel once those changes are in upstream.

  The largest batch is the thermal kernel-doc & coding style
  updates/cleanups from Eduardo.

  Highlights:

   - build all thermal framework code into one module to fix a
     regression that thermal does not work if it is built as module.

   - Marvell Armada 370/XP thermal sensor driver

   - thermal core/cpu cooling kernel-doc & coding style updates and
     cleanups.

   - Add Eduardo Valentin as thermal sub-maintainer, both in mailing
     list and patchwork.  He will help me on arm thermal drivers."

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (68 commits)
  thermal: db8500_cpufreq_cooling: remove usage of IS_ERR_OR_NULL()
  thermal: thermal_core: remove usage of IS_ERR_OR_NULL
  thermal: cpu_cooling: improve line breaking
  thermal: cpu_cooling: alignment improvements
  thermal: cpu_cooling: remove checkpatch.pl warning
  thermal: cpu_cooling: remove trailing blank line
  thermal: cpu_cooling: align on open parenthesis
  thermal: cpu_cooling: standardize comment style
  thermal: cpu_cooling: standardize end of function
  thermal: cpu_cooling: remove trailing white spaces
  Thermal: update documentation for thermal_zone_device_register
  thermal: update kernel-doc for thermal_zone_device_register
  thermal: update kernel-doc for create_trip_attrs
  thermal: update kernel-doc for thermal_cooling_device_register
  thermal: update kernel-doc for thermal_zone_unbind_cooling_device
  thermal: update kernel-doc for thermal_zone_bind_cooling_device
  thermal: use EXPORT_SYMBOL_GPL
  thermal: rename notify_thermal_framework to thermal_notify_framework
  thermal: update driver license
  thermal: use strlcpy instead of strcpy
  ...

11 years agoARC: [mm] Aliasing VIPT dcache support 4/4
Vineet Gupta [Thu, 9 May 2013 13:50:43 +0000 (19:20 +0530)]
ARC: [mm] Aliasing VIPT dcache support 4/4

Enforce congruency of userspace shared mappings

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
11 years agoARC: [mm] Aliasing VIPT dcache support 3/4
Vineet Gupta [Thu, 9 May 2013 16:25:27 +0000 (21:55 +0530)]
ARC: [mm] Aliasing VIPT dcache support 3/4

Fix the one zillion warnings

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
11 years agoARC: [mm] Aliasing VIPT dcache support 2/4
Vineet Gupta [Thu, 9 May 2013 16:24:51 +0000 (21:54 +0530)]
ARC: [mm] Aliasing VIPT dcache support 2/4

This is the meat of the series which prevents any dcache alias creation
by always keeping the U and K mapping of a page congruent.
If a mapping already exists, and other tries to access the page, prev
one is flushed to physical page (wback+inv)

Essentially flush_dcache_page()/copy_user_highpage() create K-mapping
of a page, but try to defer flushing, unless U-mapping exist.
When page is actually mapped to userspace, update_mmu_cache() flushes
the K-mapping (in certain cases this can be optimised out)

Additonally flush_cache_mm(), flush_cache_range(), flush_cache_page()
handle the puring of stale userspace mappings on exit/munmap...

flush_anon_page() handles the existing U-mapping for anon page before
kernel reads it via the GUP path.

Note that while not complete, this is enough to boot a simple
dynamically linked Busybox based rootfs

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
11 years agoARC: [mm] Aliasing VIPT dcache support 1/4
Vineet Gupta [Thu, 9 May 2013 09:40:18 +0000 (15:10 +0530)]
ARC: [mm] Aliasing VIPT dcache support 1/4

This preps the low level dcache flush helpers to take vaddr argument in
addition to the existing paddr to properly flush the VIPT dcache

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
11 years agoARM: dts: don't assume boards are using twl4030 for omap3
Jason Cooper [Thu, 9 May 2013 16:06:57 +0000 (09:06 -0700)]
ARM: dts: don't assume boards are using twl4030 for omap3

If a board isn't using twl4030, then dtc will complain about the missing
phandle (which is in twl4030.dtsi).  Move the phy declaration to the dts
files.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoARM: OMAP2+: Remove bogus IS_ERR_OR_NULL checking from id.c
Tony Lindgren [Thu, 9 May 2013 15:27:25 +0000 (08:27 -0700)]
ARM: OMAP2+: Remove bogus IS_ERR_OR_NULL checking from id.c

Commit 6770b211 (ARM: OMAP2+: Export SoC information to userspace)
had some broken return value handling as noted by Russell King:

+       soc_dev = soc_device_register(soc_dev_attr);
+       if (IS_ERR_OR_NULL(soc_dev)) {
+               kfree(soc_dev_attr);
+               return;
+       }
+
+       parent = soc_device_to_device(soc_dev);
+       if (!IS_ERR_OR_NULL(parent))
+               device_create_file(parent, &omap_soc_attr);

This is nonsense.  For the first, IS_ERR() is sufficient.  For the second,
tell me what error checking is required in the return value of this
function:

struct device *soc_device_to_device(struct soc_device *soc_dev)
{
        return &soc_dev->dev;
}

when you've already determined that the passed soc_dev is a valid pointer.
If you read the comments against the prototype:

/**
 * soc_device_to_device - helper function to fetch struct device
 * @soc: Previously registered SoC device container
 */
struct device *soc_device_to_device(struct soc_device *soc);

if "soc" is valid, it means the "previously registered SoC device container"
must have succeeded and that can only happen if the struct device has been
registered.  Ergo, there will always be a valid struct device pointer for
any registered SoC device container.  Therefore, if soc_device_register()
succeeds, then the return value from soc_device_to_device() will always be
valid and no error checking of it is required.

Simples.  The rule as ever applies here: get to know the APIs your using
and don't fumble around in the dark hoping that you'll get this stuff
right.

Fix it as noted by Russell.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
11 years agoMerge branch 'mti-next' of git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill into...
Ralf Baechle [Thu, 9 May 2013 15:57:30 +0000 (17:57 +0200)]
Merge branch 'mti-next' of git://git.linux-mips.org/sjhill/linux-sjhill into mips-for-linux-next

11 years agoMerge branch 'next/kvm' into mips-for-linux-next
Ralf Baechle [Thu, 9 May 2013 15:56:40 +0000 (17:56 +0200)]
Merge branch 'next/kvm' into mips-for-linux-next

11 years agoMIPS: Add new GIC clockevent driver.
Raghu Gandham [Wed, 10 Apr 2013 21:30:12 +0000 (16:30 -0500)]
MIPS: Add new GIC clockevent driver.

Add new clockevent driver that uses the counter present on the MIPS
Global Interrupt Controller.

Signed-off-by: Raghu Gandham <Raghu.Gandham@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Formatting clean-ups for clocksources.
Steven J. Hill [Wed, 10 Apr 2013 21:29:13 +0000 (16:29 -0500)]
MIPS: Formatting clean-ups for clocksources.

Various whitespace and #ifdef removals for GIC and R4K clocksources.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Refactor GIC clocksource code.
Steven J. Hill [Wed, 10 Apr 2013 21:28:36 +0000 (16:28 -0500)]
MIPS: Refactor GIC clocksource code.

Reorganize some of the GIC clocksource driver code. Below is a list of
the various changes.

  * No longer select CSRC_GIC by default for Malta platform.
  * Limit choice for either the GIC or R4K clocksource, not both.
  * Change location in Makefile.
  * Created new 'gic_read_count' function in common 'irq-gic.c' file.
  * Change 'git_hpt_read' function in 'csrc-gic.c' to use new function.
  * Surround GIC specific code in Malta platform code with #ifdef's.
  * Only initialize the GIC clocksource if it was selected. Original
    code called it unconditionally if a GIC was found.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Move 'gic_frequency' to common location.
Steven J. Hill [Wed, 10 Apr 2013 21:27:50 +0000 (16:27 -0500)]
MIPS: Move 'gic_frequency' to common location.

Move the global variable 'gic_frequency' to be defined in the file
'arch/mips/kernel/irq-gic.c' instead of defining it individually
for each platform making use of the GIC. Also change the type to
be an unsigned integer instead of signed.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Move 'gic_present' to common location.
Steven J. Hill [Wed, 10 Apr 2013 21:27:04 +0000 (16:27 -0500)]
MIPS: Move 'gic_present' to common location.

Move the global variable 'gic_present' to be defined in the file
'arch/mips/kernel/irq-gic.c' instead of defining it individually
for each platform making use of the GIC. Also change the type to
be an unsigned integer instead of signed.

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

Add logic needed to handle unaligned accesses in MIPS16e mode.

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

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

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: MIPS16e: Add instruction formats.
Steven J. Hill [Mon, 25 Mar 2013 18:44:04 +0000 (13:44 -0500)]
MIPS: MIPS16e: Add instruction formats.

Add structures for all the MIPS16e instructions. Also add the
enumerations for all the bit fields for opcodes, functions, etc.

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

Optimise 'strnlen' 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 '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>