profile/common/kernel-common.git
11 years agopowerpc/fsl/defconfig: enable CONFIG_AT803X_PHY
Shengzhou Liu [Tue, 3 Sep 2013 08:28:26 +0000 (16:28 +0800)]
powerpc/fsl/defconfig: enable CONFIG_AT803X_PHY

Enable CONFIG_AT803X_PHY to support AR8030/8033/8035 PHY.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/dts: Correct sdhci quirk for bsc9131
Haijun.Zhang [Mon, 2 Sep 2013 10:37:02 +0000 (18:37 +0800)]
powerpc/dts: Correct sdhci quirk for bsc9131

We use property "sdhci,auto-cmd12" instead of "fsl,sdhci-auto-cmd12"
to distinguish if the sdhc host has quirk SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12.

Signed-off-by: Haijun Zhang <Haijun.Zhang@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/eSDCH: Specify voltage for T4240QDS
Haijun.Zhang [Thu, 29 Aug 2013 03:31:28 +0000 (11:31 +0800)]
powerpc/eSDCH: Specify voltage for T4240QDS

Freescale T4240QDS reference board has extra voltage shifters added
to allow 3.3V operation, so add 3.3v voltage support for T4240QDS.
1.8v and 3.3v is recommand for eMMC and SDHC card.

Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/mpc8xx: Clearer Oops message for Software Emulation Exception
LEROY Christophe [Wed, 28 Aug 2013 14:19:17 +0000 (16:19 +0200)]
powerpc/mpc8xx: Clearer Oops message for Software Emulation Exception

This patch modifies the Oops message in case of Software Emulation Exception.
The existing message is quite confusing because it refers to FPU Emulation
while most often the issue is due to either a non supported instruction
(not necessarily FPU related) or a stale instruction due to HW issues.
The new message tries to be more generic in order to make the user understand
that the Oops is due to something wrong with an instruction, not necessarily
due to an FPU instruction.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc: Set the NOTE type for SPE regset
Suzuki Poulose [Tue, 27 Aug 2013 07:52:14 +0000 (13:22 +0530)]
powerpc: Set the NOTE type for SPE regset

The regset defintion for SPE doesn't have the core_note_type
set, which prevents it from being dumped. Add the note type
NT_PPC_SPE for SPE regset.

Signed-off-by: Suzuki K Poulose <suzuki@in.ibm.com>
Cc: Roland McGrath <roland@hack.frob.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/e500v2: Include Power ISA properties
Lijun Pan [Thu, 24 Oct 2013 21:03:25 +0000 (16:03 -0500)]
powerpc/e500v2: Include Power ISA properties

bsc9131 device tree does not have these properties.

Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/e6500: Include Power ISA properties
Lijun Pan [Thu, 24 Oct 2013 21:11:13 +0000 (16:11 -0500)]
powerpc/e6500: Include Power ISA properties

b4420 and b4860 device trees do not have these properties.

Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/pci: Change the DECLARE_PCI_FIXUP_{HEADER => EARLY} macro of pci quirk
Chunhe Lan [Fri, 2 Aug 2013 08:46:25 +0000 (16:46 +0800)]
powerpc/pci: Change the DECLARE_PCI_FIXUP_{HEADER => EARLY} macro of pci quirk

Freescale platform has class code = 0x0b2000, when it boots. This makes
kernel PCI bus code to setup these devices resulting into the following
notice information when trying to enable them:

pci 0000:00:00.0: ignoring class 0x0b2000 (doesn't match header type 01)

The above information is outputted by judging value of dev->class before
pci_setup_device() function, and the DECLARE_PCI_FIXUP_HEADER quirk runs
after pci_setup_device() function. But the DECLARE_PCI_FIXUP_EARLY quirk
runs before judging value of dev->class and pci_setup_device() function.
So we use the DECLARE_PCI_FIXUP_EARLY macro to fix this issue.

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/dts: fix sRIO error interrupt for b4860
Minghuan Lian [Wed, 31 Jul 2013 02:59:07 +0000 (10:59 +0800)]
powerpc/dts: fix sRIO error interrupt for b4860

For B4 platform, MPIC EISR register is in reversed bitmap order,
instead of "Error interrupt source 0-31. Bit 0 represents SRC0."
the correct ordering is "Error interrupt source 0-31. Bit 0
represents SRC31." This patch is to fix sRIO EISR bit value
of error interrupt in dts node.

Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/booke: clear DBCR0_BT in user_disable_single_step()
James Yang [Fri, 5 Jul 2013 19:49:43 +0000 (14:49 -0500)]
powerpc/booke: clear DBCR0_BT in user_disable_single_step()

BookE version of user_disable_single_step() clears DBCR0_IC for the
instruction completion debug, but did not also clear DBCR0_BT for the
branch taken exception.  This behavior was lost by the 2/2010 patch.

Signed-off-by: James Yang <James.Yang@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc: export debug registers save function for KVM
Bharat Bhushan [Thu, 4 Jul 2013 06:57:44 +0000 (12:27 +0530)]
powerpc: export debug registers save function for KVM

KVM need this function when switching from vcpu to user-space
thread. My subsequent patch will use this function.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc: move debug registers in a structure
Bharat Bhushan [Thu, 4 Jul 2013 06:15:46 +0000 (11:45 +0530)]
powerpc: move debug registers in a structure

This way we can use same data type struct with KVM and
also help in using other debug related function.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Acked-by: Michael Neuling <mikey@neuling.org>
[scottwood@freescale.com: removed obvious debug_reg comment]
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc: remove unnecessary line continuations
Bharat Bhushan [Thu, 4 Jul 2013 06:15:45 +0000 (11:45 +0530)]
powerpc: remove unnecessary line continuations

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/kgdb: use DEFINE_PER_CPU to allocate kgdb's thread_info
Tiejun Chen [Thu, 20 Jun 2013 10:28:29 +0000 (18:28 +0800)]
powerpc/kgdb: use DEFINE_PER_CPU to allocate kgdb's thread_info

Use DEFINE_PER_CPU to allocate thread_info statically instead of kmalloc().
This can avoid introducing more memory check codes.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
[scottwood@freescale.com: wrapped long line]
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc: Emulate sync instruction variants
James Yang [Wed, 3 Jul 2013 21:26:47 +0000 (16:26 -0500)]
powerpc: Emulate sync instruction variants

Reserved fields of the sync instruction have been used for other
instructions (e.g. lwsync).  On processors that do not support variants
of the sync instruction, emulate it by executing a sync to subsume the
effect of the intended instruction.

Signed-off-by: James Yang <James.Yang@freescale.com>
[scottwood@freescale.com: whitespace and subject line fix]
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/fsl-booke: Use common defines for SPE/FP interrupts numbers
Mihai Caraman [Mon, 1 Jul 2013 15:35:31 +0000 (18:35 +0300)]
powerpc/fsl-booke: Use common defines for SPE/FP interrupts numbers

On Book3E some SPE/FP/AltiVec interrupts share the same number. Use
common defines to indentify these numbers.

Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
[scottwood@freescale.com: fixed space-before-tab]
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc/booke64: Use common defines for AltiVec interrupts numbers
Mihai Caraman [Mon, 1 Jul 2013 15:35:30 +0000 (18:35 +0300)]
powerpc/booke64: Use common defines for AltiVec interrupts numbers

On Book3E some SPE/FP/AltiVec interrupts share the same number. Use
common defines to indentify these numbers.

Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agopowerpc: remove dependency on MV64360
Paul Bolle [Wed, 15 May 2013 09:21:01 +0000 (11:21 +0200)]
powerpc: remove dependency on MV64360

The Kconfig entry that allows to "Distribute interrupts on all CPUs by
default" has a (negative) dependency on MV64360. But that Kconfig symbol
was removed in v2.6.27, which means that this dependency has evaluated
to true ever since. It can be removed too.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Scott Wood <scottwood@freescale.com>
11 years agoMerge branch 'for-kvm' into next
Benjamin Herrenschmidt [Fri, 11 Oct 2013 07:23:53 +0000 (18:23 +1100)]
Merge branch 'for-kvm' into next

Topic branch for commits that the KVM tree might want to pull
in separately.

Hand merged a few files due to conflicts with the LE stuff

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Provide for giveup_fpu/altivec to save state in alternate location
Paul Mackerras [Tue, 10 Sep 2013 10:21:10 +0000 (20:21 +1000)]
powerpc: Provide for giveup_fpu/altivec to save state in alternate location

This provides a facility which is intended for use by KVM, where the
contents of the FP/VSX and VMX (Altivec) registers can be saved away
to somewhere other than the thread_struct when kernel code wants to
use floating point or VMX instructions.  This is done by providing a
pointer in the thread_struct to indicate where the state should be
saved to.  The giveup_fpu() and giveup_altivec() functions test these
pointers and save state to the indicated location if they are non-NULL.
Note that the MSR_FP/VEC bits in task->thread.regs->msr are still used
to indicate whether the CPU register state is live, even when an
alternate save location is being used.

This also provides load_fp_state() and load_vr_state() functions, which
load up FP/VSX and VMX state from memory into the CPU registers, and
corresponding store_fp_state() and store_vr_state() functions, which
store FP/VSX and VMX state into memory from the CPU registers.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Put FP/VSX and VR state into structures
Paul Mackerras [Tue, 10 Sep 2013 10:20:42 +0000 (20:20 +1000)]
powerpc: Put FP/VSX and VR state into structures

This creates new 'thread_fp_state' and 'thread_vr_state' structures
to store FP/VSX state (including FPSCR) and Altivec/VSX state
(including VSCR), and uses them in the thread_struct.  In the
thread_fp_state, the FPRs and VSRs are represented as u64 rather
than double, since we rarely perform floating-point computations
on the values, and this will enable the structures to be used
in KVM code as well.  Similarly FPSCR is now a u64 rather than
a structure of two 32-bit values.

This takes the offsets out of the macros such as SAVE_32FPRS,
REST_32FPRS, etc.  This enables the same macros to be used for normal
and transactional state, enabling us to delete the transactional
versions of the macros.   This also removes the unused do_load_up_fpu
and do_load_up_altivec, which were in fact buggy since they didn't
create large enough stack frames to account for the fact that
load_up_fpu and load_up_altivec are not designed to be called from C
and assume that their caller's stack frame is an interrupt frame.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: add real mode support for dma operations on powernv
Alexey Kardashevskiy [Wed, 28 Aug 2013 08:37:43 +0000 (18:37 +1000)]
powerpc: add real mode support for dma operations on powernv

The existing TCE machine calls (tce_build and tce_free) only support
virtual mode as they call __raw_writeq for TCE invalidation what
fails in real mode.

This introduces tce_build_rm and tce_free_rm real mode versions
which do mostly the same but use "Store Doubleword Caching Inhibited
Indexed" instruction for TCE invalidation.

This new feature is going to be utilized by real mode support of VFIO.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Prepare to support kernel handling of IOMMU map/unmap
Alexey Kardashevskiy [Wed, 28 Aug 2013 08:37:42 +0000 (18:37 +1000)]
powerpc: Prepare to support kernel handling of IOMMU map/unmap

The current VFIO-on-POWER implementation supports only user mode
driven mapping, i.e. QEMU is sending requests to map/unmap pages.
However this approach is really slow, so we want to move that to KVM.
Since H_PUT_TCE can be extremely performance sensitive (especially with
network adapters where each packet needs to be mapped/unmapped) we chose
to implement that as a "fast" hypercall directly in "real
mode" (processor still in the guest context but MMU off).

To be able to do that, we need to provide some facilities to
access the struct page count within that real mode environment as things
like the sparsemem vmemmap mappings aren't accessible.

This adds an API function realmode_pfn_to_page() to get page struct when
MMU is off.

This adds to MM a new function put_page_unless_one() which drops a page
if counter is bigger than 1. It is going to be used when MMU is off
(for example, real mode on PPC64) and we want to make sure that page
release will not happen in real mode as it may crash the kernel in
a horrible way.

CONFIG_SPARSEMEM_VMEMMAP and CONFIG_FLATMEM are supported.

Cc: linux-mm@kvack.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agohashtable: add hash_for_each_possible_rcu_notrace()
Alexey Kardashevskiy [Wed, 28 Aug 2013 08:37:39 +0000 (18:37 +1000)]
hashtable: add hash_for_each_possible_rcu_notrace()

This adds hash_for_each_possible_rcu_notrace() which is basically
a notrace clone of hash_for_each_possible_rcu() which cannot be
used in real mode due to its tracing/debugging capability.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/eeh: Reorder output messages
Gavin Shan [Fri, 6 Sep 2013 01:00:05 +0000 (09:00 +0800)]
powerpc/eeh: Reorder output messages

We already had some output messages from EEH core. Occasionally,
we can see the output messages from EEH core before the stack
dump. That's not what we expected. The patch fixes that and shows
the stack dump prior to output messages from EEH core.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/eeh: Output PHB3 diag-data
Gavin Shan [Fri, 6 Sep 2013 01:00:04 +0000 (09:00 +0800)]
powerpc/eeh: Output PHB3 diag-data

The patch adds function ioda_eeh_phb3_phb_diag() to dump PHB3
PHB diag-data. That's called while detecting informative errors
or frozen PE on the specific PHB.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Double size of log blob
Gavin Shan [Fri, 6 Sep 2013 01:00:03 +0000 (09:00 +0800)]
powerpc/powernv: Double size of log blob

Each PHB instance (struct pnv_phb) has its corresponding log blob,
which is used to hold the retrieved error log from firmware. The
current size of that (4096) isn't enough for PHB3 case and the patch
makes that double to 8192.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/eeh: Output error number
Gavin Shan [Fri, 6 Sep 2013 01:00:02 +0000 (09:00 +0800)]
powerpc/eeh: Output error number

The patch prints the error number while failing to retrieve error
log from firmware. It's helpful for debugging.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Support inbound error injection
Gavin Shan [Fri, 6 Sep 2013 01:00:01 +0000 (09:00 +0800)]
powerpc/powernv: Support inbound error injection

For now, we only support outbound error injection. Actually, the
hardware supports injecting inbound errors as well. The patch enables
to inject inbound errors.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Enable EEH for PHB3
Gavin Shan [Fri, 6 Sep 2013 01:00:00 +0000 (09:00 +0800)]
powerpc/powernv: Enable EEH for PHB3

The EEH isn't enabled for PHB3 and the patch intends to enable it.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/scom: Use "devspec" rather than "path" in debugfs entries
Benjamin Herrenschmidt [Thu, 29 Aug 2013 07:25:35 +0000 (17:25 +1000)]
powerpc/scom: Use "devspec" rather than "path" in debugfs entries

This is the traditional name for device-tree path, used in sysfs,
do the same for the XSCOM debugfs files.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/scom: CONFIG_SCOM_DEBUGFS should depend on CONFIG_DEBUG_FS
Benjamin Herrenschmidt [Thu, 29 Aug 2013 06:58:12 +0000 (16:58 +1000)]
powerpc/scom: CONFIG_SCOM_DEBUGFS should depend on CONFIG_DEBUG_FS

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Add scom support under OPALv3
Benjamin Herrenschmidt [Thu, 29 Aug 2013 06:57:33 +0000 (16:57 +1000)]
powerpc/powernv: Add scom support under OPALv3

OPAL v3 provides interfaces to access the chips XSCOM, expose
this via the existing scom infrastructure.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/scom: Create debugfs files using ibm,chip-id if available
Benjamin Herrenschmidt [Thu, 29 Aug 2013 06:56:59 +0000 (16:56 +1000)]
powerpc/scom: Create debugfs files using ibm,chip-id if available

When creating the debugfs scom files, use "ibm,chip-id" as the scom%d
index rather than a simple made up number when possible.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/scom: Add support for "reg" property
Benjamin Herrenschmidt [Thu, 29 Aug 2013 06:56:16 +0000 (16:56 +1000)]
powerpc/scom: Add support for "reg" property

When devices are direct children of a scom controller node, they
should be able to use the normal "reg" property instead of "scom-reg".

In that case, they also use #address-cells rather than #scom-cells
to indicate the size of an entry.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/scom: Change scom_read() and scom_write() to return errors
Benjamin Herrenschmidt [Thu, 29 Aug 2013 06:55:45 +0000 (16:55 +1000)]
powerpc/scom: Change scom_read() and scom_write() to return errors

scom_read() now returns the read value via a pointer argument and
both functions return an int error code

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Enable /dev/port when isa_io_special is set
Benjamin Herrenschmidt [Thu, 29 Aug 2013 06:55:07 +0000 (16:55 +1000)]
powerpc: Enable /dev/port when isa_io_special is set

isa_io_special is set when the platform provides a "special"
implementation of inX/outX via some FW interface for example.

Such a platform doesn't need an ISA bridge on PCI, and so /dev/port
should be made available even if one isn't present.

This makes the LPC bus IOs accessible via /dev/port on PowerNV Power8

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Make ftrace endian-safe.
Eugene Surovegin [Fri, 20 Sep 2013 18:42:21 +0000 (11:42 -0700)]
powerpc: Make ftrace endian-safe.

Signed-off-by: Eugene Surovegin <surovegin@google.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Make kernel module helper endian-safe.
Eugene Surovegin [Fri, 20 Sep 2013 18:42:20 +0000 (11:42 -0700)]
powerpc: Make kernel module helper endian-safe.

Signed-off-by: Eugene Surovegin <surovegin@google.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: prom_init exception when updating core value
Laurent Dufour [Tue, 17 Sep 2013 09:52:48 +0000 (11:52 +0200)]
powerpc: prom_init exception when updating core value

Since the CPU is generating an exception when accessing unaligned word, and
as this exception is not yet handled when running prom_init, data should be
copied from the architecture vector byte per byte.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/booke64: Check napping in performance monitor interrupt
Kevin Hao [Thu, 26 Sep 2013 08:23:56 +0000 (16:23 +0800)]
powerpc/booke64: Check napping in performance monitor interrupt

The performance monitor interrupt is asynchronous, so we should check
if the current processor is in napping status in the handler of this
interrupt.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/kernel: Fix endian issue in rtas_pci
Cedric Le Goater [Mon, 23 Sep 2013 12:17:54 +0000 (14:17 +0200)]
powerpc/kernel: Fix endian issue in rtas_pci

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/pseries: Implement arch_get_random_long() based on H_RANDOM
Michael Ellerman [Fri, 11 Oct 2013 03:07:59 +0000 (14:07 +1100)]
powerpc/pseries: Implement arch_get_random_long() based on H_RANDOM

Add support for the arch_get_random_long() hook based on the H_RANDOM
hypervisor call. We trust the hypervisor to provide us with random data,
ie. we don't whiten it in anyway.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agohwrng: Add a driver for the hwrng found in power7+ systems
Michael Ellerman [Fri, 11 Oct 2013 03:07:58 +0000 (14:07 +1100)]
hwrng: Add a driver for the hwrng found in power7+ systems

Add a driver for the hwrng found in power7+ systems, based on the
existing code for the arch_get_random_long() hook.

We only register a single instance of the driver, not one per device,
because we use the existing per_cpu array of devices in the arch code.
This means we always read from the "closest" device, avoiding inter-chip
memory traffic.

Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Implement arch_get_random_long/int() for powernv
Michael Ellerman [Fri, 11 Oct 2013 03:07:57 +0000 (14:07 +1100)]
powerpc: Implement arch_get_random_long/int() for powernv

Add the plumbing to implement arch_get_random_long/int(). It didn't seem
worth adding an extra ppc_md hook for int, so we reuse the one for long.

Add an implementation for powernv based on the hwrng found in power7+
systems. We whiten the output of the hwrng, and the result passes all
the dieharder tests.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agohwrng: Return errors to upper levels in pseries-rng.c
Michael Ellerman [Wed, 25 Sep 2013 09:24:17 +0000 (19:24 +1000)]
hwrng: Return errors to upper levels in pseries-rng.c

We don't expect to get errors from the hypervisor when reading the rng,
but if we do we should pass the error up to the hwrng driver. Otherwise
the hwrng driver will continue calling us forever.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Added __cmpdi2 for signed 64bit comparision
Bharat Bhushan [Wed, 9 Oct 2013 05:11:17 +0000 (10:41 +0530)]
powerpc: Added __cmpdi2 for signed 64bit comparision

This was missing on powerpc and I am getting compilation error
drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2'
drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2'

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Fix section mismatch warning in free_lppacas
Vladimir Murzin [Sun, 29 Sep 2013 12:41:18 +0000 (14:41 +0200)]
powerpc: Fix section mismatch warning in free_lppacas

While cross-building for PPC64 I've got bunch of

WARNING: arch/powerpc/kernel/built-in.o(.text.unlikely+0x2d2): Section
mismatch in reference from the function .free_lppacas() to the variable
.init.data:lppaca_size The function .free_lppacas() references the variable
__initdata lppaca_size. This is often because .free_lppacas lacks a __initdata
annotation or the annotation of lppaca_size is wrong.

Fix it by using proper annotation for free_lppacas. Additionally, annotate
{allocate,new}_llpcas properly.

Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
Acked-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/ppc64: Remove the unneeded load of ti_flags in resume_kernel
Kevin Hao [Thu, 26 Sep 2013 08:41:34 +0000 (16:41 +0800)]
powerpc/ppc64: Remove the unneeded load of ti_flags in resume_kernel

We already got the value of current_thread_info and ti_flags and store
them into r9 and r4 respectively before jumping to resume_kernel. So
there is no reason to reload them again.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/8xx/tqm8xx: Fix incorrect placement of __initdata tag
Bartlomiej Zolnierkiewicz [Mon, 30 Sep 2013 13:13:55 +0000 (15:13 +0200)]
powerpc/8xx/tqm8xx: Fix incorrect placement of __initdata tag

__initdata tag should be placed between the variable name and equal
sign for the variable to be placed in the intended .init.data section.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/legacy_serial: Fix incorrect placement of __initdata tag
Bartlomiej Zolnierkiewicz [Mon, 30 Sep 2013 13:11:42 +0000 (15:11 +0200)]
powerpc/legacy_serial: Fix incorrect placement of __initdata tag

__initdata tag should be placed between the variable name and equal
sign for the variable to be placed in the intended .init.data section.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/mpic: Disable preemption when calling mpic_processor_id()
Scott Wood [Fri, 27 Sep 2013 00:18:18 +0000 (19:18 -0500)]
powerpc/mpic: Disable preemption when calling mpic_processor_id()

Otherwise, we get a debug traceback due to the use of
smp_processor_id() (or get_paca()) inside hard_smp_processor_id().
mpic_host_map() is just looking for a default CPU, so it doesn't matter
if we migrate after getting the CPU ID.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Work around little endian gcc bug
Anton Blanchard [Mon, 23 Sep 2013 02:05:13 +0000 (12:05 +1000)]
powerpc: Work around little endian gcc bug

Temporarily work around an ICE we are seeing while building
in little endian mode:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57134

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Don't set HAVE_EFFICIENT_UNALIGNED_ACCESS on little endian builds
Anton Blanchard [Mon, 23 Sep 2013 02:05:12 +0000 (12:05 +1000)]
powerpc: Don't set HAVE_EFFICIENT_UNALIGNED_ACCESS on little endian builds

POWER7 takes alignment exceptions on some unaligned addresses, so
disable HAVE_EFFICIENT_UNALIGNED_ACCESS. This fixes an early boot
issue in the printk code.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add ability to build little endian kernels
Ian Munsie [Mon, 23 Sep 2013 02:05:11 +0000 (12:05 +1000)]
powerpc: Add ability to build little endian kernels

This patch allows the kbuild system to successfully compile a kernel
for the little endian PowerPC64 architecture. A subsequent patch
will add the CONFIG_CPU_LITTLE_ENDIAN kernel config option which
must be set to build such a kernel.

If cross compiling, CROSS_COMPILE must point to a suitable toolchain
(compiled for the powerpc64le-linux and powerpcle-linux targets).

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoKVM: PPC: Disable KVM on little endian builds
Anton Blanchard [Mon, 23 Sep 2013 02:05:09 +0000 (12:05 +1000)]
KVM: PPC: Disable KVM on little endian builds

There are a number of KVM issues with little endian builds.
We are working on fixing them, but in the meantime disable
it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agotty/hvc_opal: powerpc: Make OPAL HVC device tree accesses endian safe
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:05:08 +0000 (12:05 +1000)]
tty/hvc_opal: powerpc: Make OPAL HVC device tree accesses endian safe

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/hvsi: Fix endian issues in HVSI driver
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:05:07 +0000 (12:05 +1000)]
powerpc/hvsi: Fix endian issues in HVSI driver

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Fix some PCI sparse errors and one LE bug
Anton Blanchard [Mon, 23 Sep 2013 02:05:06 +0000 (12:05 +1000)]
powerpc/powernv: Fix some PCI sparse errors and one LE bug

pnv_pci_setup_bml_iommu was missing a byteswap of a device
tree property.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: More little endian issues in OPAL RTC driver
Anton Blanchard [Mon, 23 Sep 2013 02:05:05 +0000 (12:05 +1000)]
powerpc/powernv: More little endian issues in OPAL RTC driver

Sparse caught an issue where opal_set_rtc_time was incorrectly
byteswapping. Also fix a number of sparse warnings.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Don't register exception handlers in little endian mode
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:05:04 +0000 (12:05 +1000)]
powerpc/powernv: Don't register exception handlers in little endian mode

The powernv exception handlers are not ready to take exceptions
in little endian mode, so disable them.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Fix OPAL entry and exit in little endian mode
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:05:03 +0000 (12:05 +1000)]
powerpc/powernv: Fix OPAL entry and exit in little endian mode

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Fix endian issues in OPAL console and udbg backend
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:05:02 +0000 (12:05 +1000)]
powerpc/powernv: Fix endian issues in OPAL console and udbg backend

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Fix endian issues in powernv PCI code
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:05:01 +0000 (12:05 +1000)]
powerpc/powernv: Fix endian issues in powernv PCI code

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Make OPAL NVRAM device tree accesses endian safe
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:05:00 +0000 (12:05 +1000)]
powerpc/powernv: Make OPAL NVRAM device tree accesses endian safe

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Fix endian issues in OPAL ICS backend
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:04:59 +0000 (12:04 +1000)]
powerpc/powernv: Fix endian issues in OPAL ICS backend

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Fix endian issues in OPAL RTC driver
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:04:58 +0000 (12:04 +1000)]
powerpc/powernv: Fix endian issues in OPAL RTC driver

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Little endian sparse clean up for arch/powerpc/platforms/powernv/pci-ioda.c
Alistair Popple [Mon, 23 Sep 2013 02:04:57 +0000 (12:04 +1000)]
powerpc: Little endian sparse clean up for arch/powerpc/platforms/powernv/pci-ioda.c

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Little endian fix for arch/powerpc/platforms/powernv/pci-p5ioc2.c
Alistair Popple [Mon, 23 Sep 2013 02:04:56 +0000 (12:04 +1000)]
powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci-p5ioc2.c

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Little endian fix for arch/powerpc/platforms/powernv/pci.c
Alistair Popple [Mon, 23 Sep 2013 02:04:55 +0000 (12:04 +1000)]
powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci.c

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Little endian fixes for platforms/powernv/opal.c
Alistair Popple [Mon, 23 Sep 2013 02:04:54 +0000 (12:04 +1000)]
powerpc: Little endian fixes for platforms/powernv/opal.c

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: uname should return ppc64le/ppcle on little endian builds
Anton Blanchard [Mon, 23 Sep 2013 02:04:53 +0000 (12:04 +1000)]
powerpc: uname should return ppc64le/ppcle on little endian builds

We need to distinguish between big endian and little endian
environments, so fix uname to return the right thing.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Use generic memcpy code in little endian
Anton Blanchard [Mon, 23 Sep 2013 02:04:52 +0000 (12:04 +1000)]
powerpc: Use generic memcpy code in little endian

We need to fix some endian issues in our memcpy code. For now
just enable the generic memcpy routine for little endian builds.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Use generic checksum code in little endian
Anton Blanchard [Mon, 23 Sep 2013 02:04:51 +0000 (12:04 +1000)]
powerpc: Use generic checksum code in little endian

We need to fix some endian issues in our checksum code. For now
just enable the generic checksum routines for little endian builds.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Handle VSX alignment faults in little endian mode
Anton Blanchard [Mon, 23 Sep 2013 02:04:50 +0000 (12:04 +1000)]
powerpc: Handle VSX alignment faults in little endian mode

Things are complicated by the fact that VSX elements are big
endian ordered even in little endian mode. 8 byte loads and
stores also write to the top 8 bytes of the register.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add little endian support to alignment handler
Anton Blanchard [Mon, 23 Sep 2013 02:04:49 +0000 (12:04 +1000)]
powerpc: Add little endian support to alignment handler

Handle most unaligned load and store faults in little
endian mode. Strings, multiples and VSX are not supported.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Alignment handler shouldn't access VSX registers with TS_FPR
Anton Blanchard [Mon, 23 Sep 2013 02:04:48 +0000 (12:04 +1000)]
powerpc: Alignment handler shouldn't access VSX registers with TS_FPR

The TS_FPR macro selects the FPR component of a VSX register (the
high doubleword). emulate_vsx is using this macro to get the
address of the associated VSX register. This happens to work on big
endian, but fails on little endian.

Replace it with an explicit array access.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Remove hard coded FP offsets in alignment handler
Anton Blanchard [Mon, 23 Sep 2013 02:04:47 +0000 (12:04 +1000)]
powerpc: Remove hard coded FP offsets in alignment handler

The alignment handler assumes big endian ordering when selecting
the low word of a 64bit floating point value. Use the existing
union which works in both little and big endian.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Remove open coded byte swap macro in alignment handler
Anton Blanchard [Mon, 23 Sep 2013 02:04:46 +0000 (12:04 +1000)]
powerpc: Remove open coded byte swap macro in alignment handler

Use swab64/32/16 instead of open coding it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Endian safe trampoline
Benjamin Herrenschmidt [Mon, 23 Sep 2013 02:04:45 +0000 (12:04 +1000)]
powerpc: Endian safe trampoline

Create a trampoline that works in either endian and flips to
the expected endian. Use it for primary and secondary thread
entry as well as RTAS and OF call return.

Credit for finding the magic instruction goes to Paul Mackerras

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Include the appropriate endianness header
Ian Munsie [Mon, 23 Sep 2013 02:04:44 +0000 (12:04 +1000)]
powerpc: Include the appropriate endianness header

This patch will have powerpc include the appropriate generic endianness
header depending on what the compiler reports.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Reset MSR_LE on signal entry
Anton Blanchard [Mon, 23 Sep 2013 02:04:43 +0000 (12:04 +1000)]
powerpc: Reset MSR_LE on signal entry

We always take signals in big endian which is wrong. Signals
should be taken in native endian.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Set MSR_LE bit on little endian builds
Anton Blanchard [Mon, 23 Sep 2013 02:04:42 +0000 (12:04 +1000)]
powerpc: Set MSR_LE bit on little endian builds

We need to set MSR_LE in kernel and userspace for little endian builds

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add little endian support for word-at-a-time functions
Anton Blanchard [Mon, 23 Sep 2013 02:04:41 +0000 (12:04 +1000)]
powerpc: Add little endian support for word-at-a-time functions

The powerpc word-at-a-time functions are big endian specific.
Bring in the x86 version in order to support little endian builds.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Support endian agnostic MMIO
Ian Munsie [Mon, 23 Sep 2013 02:04:40 +0000 (12:04 +1000)]
powerpc: Support endian agnostic MMIO

This patch maps the MMIO functions for 32bit PowerPC to their
appropriate instructions depending on CPU endianness.

The macros used to create the corresponding inline functions are also
renamed by this patch. Previously they had BE or LE in their names which
was misleading - they had nothing to do with endianness, but actually
created different instruction forms so their new names reflect the
instruction form they are creating (D-Form and X-Form).

Little endian 64bit PowerPC is not supported, so the lack of mappings
(and corresponding breakage) for that case is intentional to bring the
attention of anyone doing a 64bit little endian port. 64bit big endian
is unaffected.

[ Added 64 bit versions - Anton ]

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Little endian builds double word swap VSX state during context save/restore
Anton Blanchard [Mon, 23 Sep 2013 02:04:39 +0000 (12:04 +1000)]
powerpc: Little endian builds double word swap VSX state during context save/restore

The elements within VSX loads and stores are big endian ordered
regardless of endianness. Our VSX context save/restore code uses
lxvd2x and stxvd2x which is a 2x doubleword operation. This means
the two doublewords will be swapped and we have to perform another
swap to undo it.

We need to do this on save and restore.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: PTRACE_PEEKUSR/PTRACE_POKEUSER of FPR registers in little endian builds
Anton Blanchard [Mon, 23 Sep 2013 02:04:38 +0000 (12:04 +1000)]
powerpc: PTRACE_PEEKUSR/PTRACE_POKEUSER of FPR registers in little endian builds

FPRs overlap the high 64bits of the first 32 VSX registers. The
ptrace FP read/write code assumes big endian ordering and grabs
the lowest 64 bits.

Fix this by using the TS_FPR macro which does the right thing.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Fix offset of FPRs in VSX registers in little endian builds
Anton Blanchard [Mon, 23 Sep 2013 02:04:37 +0000 (12:04 +1000)]
powerpc: Fix offset of FPRs in VSX registers in little endian builds

The FPRs overlap the high doublewords of the first 32 VSX registers.
Fix TS_FPROFFSET and TS_VSRLOWOFFSET so we access the correct fields
in little endian mode.

If VSX is disabled the FPRs are only one doubleword in length so
TS_FPROFFSET needs adjusting in little endian.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Book 3S MMU little endian support
Anton Blanchard [Mon, 23 Sep 2013 02:04:36 +0000 (12:04 +1000)]
powerpc: Book 3S MMU little endian support

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Fix endian issues in VMX copy loops
Anton Blanchard [Mon, 23 Sep 2013 02:04:35 +0000 (12:04 +1000)]
powerpc: Fix endian issues in VMX copy loops

Fix the permute loops for little endian.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/irq: Don't switch to irq stack from softirq stack
Benjamin Herrenschmidt [Mon, 7 Oct 2013 21:08:24 +0000 (08:08 +1100)]
powerpc/irq: Don't switch to irq stack from softirq stack

irq_exit() is now called on the irq stack, which can trigger a switch to
the softirq stack from the irq stack.  If an interrupt happens at that
point, we will not properly detect the re-entrancy and clobber the
original return context on the irq stack.

This fixes it.  The side effect is to prevent all nesting from softirq
stack to irq stack even in the "safe" case but it's simpler that way and
matches what x86_64 does.

Reported-by: Cédric Le Goater <clg@fr.ibm.com>
Tested-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Mon, 7 Oct 2013 16:30:36 +0000 (09:30 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

Pull HID fixes from Jiri Kosina:
 - fix for hidraw reference counting regression, by Manoj Chourasia
 - fix for minor number allocation for uhid, by David Herrmann
 - other small unsorted fixes / device ID additions

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: wiimote: fix FF deadlock
  HID: add Holtek USB ID 04d9:a081 SHARKOON DarkGlider
  HID: hidraw: close underlying device at removal of last reader
  HID: roccat: Fix "cannot create duplicate filename" problems
  HID: uhid: allocate static minor

11 years agoMerge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux...
Linus Torvalds [Mon, 7 Oct 2013 16:30:02 +0000 (09:30 -0700)]
Merge branch 'stable' of git://git./linux/kernel/git/cmetcalf/linux-tile

Pull Tile bugfixes from Chris Metcalf:
 "This fixes some serious issues with PREEMPT support, and a couple of
  smaller corner-case issues fixed in the last couple of weeks"

* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  arch: tile: re-use kbasename() helper
  tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT
  tile: ensure interrupts disabled for preempt_schedule_irq()
  tile: change lock initalization in hardwall
  tile: include: asm: use 'long long' instead of 'u64' for atomic64_t and its related functions

11 years agoHID: wiimote: fix FF deadlock
David Herrmann [Wed, 2 Oct 2013 11:47:28 +0000 (13:47 +0200)]
HID: wiimote: fix FF deadlock

The input core has an internal spinlock that is acquired during event
injection via input_event() and friends but also held during FF callbacks.
That means, there is no way to share a lock between event-injection and FF
handling. Unfortunately, this is what is required for wiimote state
tracking and what we do with state.lock and input->lock.

This deadlock can be triggered when using continuous data reporting and FF
on a wiimote device at the same time. I takes me at least 30m of
stress-testing to trigger it but users reported considerably shorter
times (http://bpaste.net/show/132504/) when using some gaming-console
emulators.

The real problem is that we have two copies of internal state, one in the
wiimote objects and the other in the input device. As the input-lock is
not supposed to be accessed from outside of input-core, we have no other
chance than offloading FF handling into a worker. This actually works
pretty nice and also allows to implictly merge fast rumble changes into a
single request.

Due to the 3-layered workers (rumble+queue+l2cap) this might reduce FF
responsiveness. Initial tests were fine so lets fix the race first and if
it turns out to be too slow we can always handle FF out-of-band and skip
the queue-worker.

Cc: <stable@vger.kernel.org> # 3.11+
Reported-by: Thomas Schneider
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Mon, 7 Oct 2013 08:13:26 +0000 (01:13 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
 "A couple of bux fixes, notable are the regression with ptrace vs
  restarting system calls and the patch for kdump to be able to copy
  from virtual memory"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390: fix system call restart after inferior call
  s390: Allow vmalloc target buffers for copy_from_oldmem()
  s390/sclp: properly detect line mode console
  s390/kprobes: add exrl to list of prohibited opcodes
  s390/3270: fix return value check in tty3270_resize_work()

11 years agoLinux 3.12-rc4 v3.12-rc4
Linus Torvalds [Sun, 6 Oct 2013 21:00:20 +0000 (14:00 -0700)]
Linux 3.12-rc4

11 years agonet: Update the sysctl permissions handler to test effective uid/gid
Eric W. Biederman [Sat, 5 Oct 2013 20:15:30 +0000 (13:15 -0700)]
net: Update the sysctl permissions handler to test effective uid/gid

Modify the code to use current_euid(), and in_egroup_p, as in done
in fs/proc/proc_sysctl.c:test_perm()

Cc: stable@vger.kernel.org
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Linus Torvalds [Sun, 6 Oct 2013 20:38:31 +0000 (13:38 -0700)]
Merge git://git./linux/kernel/git/nab/target-pending

Pull SCSI target fixes from Nicholas Bellinger:
 "Here are the outstanding target fixes queued up for v3.12-rc4 code.

  The highlights include:

   - Make vhost/scsi tag percpu_ida_alloc() use GFP_ATOMIC
   - Allow sess_cmd_map allocation failure fallback to use vzalloc
   - Fix COMPARE_AND_WRITE se_cmd->data_length bug with FILEIO backends
   - Fixes for COMPARE_AND_WRITE callback recursive failure OOPs + non
     zero scsi_status bug
   - Make iscsi-target do acknowledgement tag release from RX context
   - Setup iscsi-target with extra (cmdsn_depth / 2) percpu_ida tags

  Also included is a iscsi-target patch CC'ed for v3.10+ that avoids
  legacy wait_for_task=true release during fast-past StatSN
  acknowledgement, and two other SRP target related patches that address
  long-standing issues that are CC'ed for v3.3+.

  Extra thanks to Thomas Glanzmann for his testing feedback with
  COMPARE_AND_WRITE + EXTENDED_COPY VAAI logic"

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  iscsi-target; Allow an extra tag_num / 2 number of percpu_ida tags
  iscsi-target: Perform release of acknowledged tags from RX context
  iscsi-target: Only perform wait_for_tasks when performing shutdown
  target: Fail on non zero scsi_status in compare_and_write_callback
  target: Fix recursive COMPARE_AND_WRITE callback failure
  target: Reset data_length for COMPARE_AND_WRITE to NoLB * block_size
  ib_srpt: always set response for task management
  target: Fall back to vzalloc upon ->sess_cmd_map kzalloc failure
  vhost/scsi: Use GFP_ATOMIC with percpu_ida_alloc for obtaining tag
  ib_srpt: Destroy cm_id before destroying QP.
  target: Fix xop->dbl assignment in target_xcopy_parse_segdesc_02

11 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Sun, 6 Oct 2013 20:35:15 +0000 (13:35 -0700)]
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dmaengine fixes from Vinod Koul:
 "Here is the slave dmanegine fixes.  We have the fix for deadlock issue
  on imx-dma by Michael and Josh's edma config fix along with author
  change"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: imx-dma: fix callback path in tasklet
  dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet
  dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic
  dma/Kconfig: Make TI_EDMA select TI_PRIV_EDMA
  edma: Update author email address

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
Linus Torvalds [Sat, 5 Oct 2013 19:17:24 +0000 (12:17 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "This is a small collection of fixes, including a regression fix from
  Liu Bo that solves rare crashes with compression on.

  I've merged my for-linus up to 3.12-rc3 because the top commit is only
  meant for 3.12.  The rest of the fixes are also available in my master
  branch on top of my last 3.11 based pull"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: Fix crash due to not allocating integrity data for a bioset
  Btrfs: fix a use-after-free bug in btrfs_dev_replace_finishing
  Btrfs: eliminate races in worker stopping code
  Btrfs: fix crash of compressed writes
  Btrfs: fix transid verify errors when recovering log tree