[PATCH v2 0/2] powerpc/85xx: introduce corenet_generic machine

2013-09-22 Thread Kevin Hao
v2: - Fold the original patch 2 into patch 1. - Update the patch 1 according to Scott and Kumar's comments. - Introduce a new patch to rename the corenet_ds.c to corenet_generic.c. v1: This patch series introduces a common machine to support p2041rdb, p3041ds, p4080ds, p5020ds, p5040ds,

[PATCH v2 1/2] powerpc/85xx: introduce corenet_generic machine

2013-09-22 Thread Kevin Hao
In the current kernel, the board files for p2041rdb, p3041ds, p4080ds, p5020ds, p5040ds, t4240qds and b4qds are almost the same except the machine name. So this introduces a cornet_generic machine to support all these boards to avoid the code duplication. With these changes the file corenet_ds.h

[PATCH v2 2/2] powerpc/85xx: rename the corenet_ds.c to corenet_generic.c

2013-09-22 Thread Kevin Hao
This file is also used by some RDB and QDS boards. So the name seems not so accurate. Rename it to corenet_generic.c. Also update the function names in this file according to the change. Signed-off-by: Kevin Hao haoke...@gmail.com --- A new patch in v2. arch/powerpc/platforms/85xx/Makefile

Re: [PATCH 22/51] DMA-API: amba: get rid of separate dma_mask

2013-09-22 Thread Grant Likely
On Thu, 19 Sep 2013 22:47:01 +0100, Russell King rmk+ker...@arm.linux.org.uk wrote: AMBA Primecell devices always treat streaming and coherent DMA exactly the same, so there's no point in having the masks separated. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk for the

Re: [RESEND PATCH 2/2] ppc: bpf_jit: support MOD operation

2013-09-22 Thread Matt Evans
Hi Vladimir, On 21 Sep 2013, at 17:25, Vladimir Murzin murzi...@gmail.com wrote: commit b6069a9570 (filter: add MOD operation) added generic support for modulus operation in BPF. This patch brings JIT support for PPC64 Signed-off-by: Vladimir Murzin murzi...@gmail.com Acked-by: Matt

Re: [RESEND PATCH 2/2] ppc: bpf_jit: support MOD operation

2013-09-22 Thread Vladimir Murzin
On Mon, Sep 23, 2013 at 01:13:45AM +1000, Matt Evans wrote: Hi Vladimir, On 21 Sep 2013, at 17:25, Vladimir Murzin murzi...@gmail.com wrote: commit b6069a9570 (filter: add MOD operation) added generic support for modulus operation in BPF. This patch brings JIT support for PPC64

Re: [PATCH v2 07/10] of/irq: Propagate errors in of_irq_to_resource_table()

2013-09-22 Thread Rob Herring
On Wed, Sep 18, 2013 at 8:24 AM, Thierry Reding thierry.red...@gmail.com wrote: Now that all helpers return precise error codes, this function can propagate these errors to the caller properly. Signed-off-by: Thierry Reding tred...@nvidia.com --- Changes in v2: - return 0 on success or a

Re: [PATCH v2 04/10] irqdomain: Return errors from irq_create_of_mapping()

2013-09-22 Thread Rob Herring
On Wed, Sep 18, 2013 at 8:24 AM, Thierry Reding thierry.red...@gmail.com wrote: Instead of returning 0 for all errors, allow the precise error code to be propagated. This will be used in subsequent patches to allow further propagation of error codes. The interrupt number corresponding to the

Re: [PATCH v2 02/10] of/irq: Use irq_of_parse_and_map()

2013-09-22 Thread Rob Herring
On Wed, Sep 18, 2013 at 8:24 AM, Thierry Reding thierry.red...@gmail.com wrote: Replace some instances of of_irq_map_one()/irq_create_of_mapping() and of_irq_to_resource() by the simpler equivalent irq_of_parse_and_map(). Signed-off-by: Thierry Reding tred...@nvidia.com Acked-by: Rob Herring

Re: [PATCH v2 01/10] of/irq: Rework of_irq_count()

2013-09-22 Thread Rob Herring
On Wed, Sep 18, 2013 at 8:24 AM, Thierry Reding thierry.red...@gmail.com wrote: The of_irq_to_resource() helper that is used to implement of_irq_count() tries to resolve interrupts and in fact creates a mapping for resolved interrupts. That's pretty heavy lifting for something that claims to

[PATCH 00/39] Second round of 64bit PowerPC little endian patches

2013-09-22 Thread Anton Blanchard
This patchset fixes little endian issues found in various places including the alignment handler, PCI, and ptrace code. It also adds little endian support for KVM guests and PowerNV. Alistair Popple (4): powerpc: Little endian fixes for platforms/powernv/opal.c powerpc: Little endian fix for

[PATCH 01/39] powerpc: Fix endian issues in VMX copy loops

2013-09-22 Thread Anton Blanchard
Fix the permute loops for little endian. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/lib/copyuser_power7.S | 54 + arch/powerpc/lib/memcpy_power7.S | 55 ++ 2 files changed, 63 insertions(+), 46

[PATCH 02/39] powerpc: Book 3S MMU little endian support

2013-09-22 Thread Anton Blanchard
v2: HPTE_LOCK_BIT was wrong in LE, spotted by Paul Mackerras. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/mmu-hash64.h | 4 +-- arch/powerpc/mm/hash_native_64.c | 46 --- arch/powerpc/mm/hash_utils_64.c | 38

[PATCH 03/39] powerpc: Fix offset of FPRs in VSX registers in little endian builds

2013-09-22 Thread Anton Blanchard
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

[PATCH 04/39] powerpc: PTRACE_PEEKUSR/PTRACE_POKEUSER of FPR registers in little endian builds

2013-09-22 Thread Anton Blanchard
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 an...@samba.org --- arch/powerpc/kernel/ptrace.c | 8

[PATCH 05/39] powerpc: Little endian builds double word swap VSX state during context save/restore

2013-09-22 Thread Anton Blanchard
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

[PATCH 06/39] powerpc: Support endian agnostic MMIO

2013-09-22 Thread Anton Blanchard
From: Ian Munsie imun...@au1.ibm.com 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

[PATCH 07/39] powerpc: Add little endian support for word-at-a-time functions

2013-09-22 Thread Anton Blanchard
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 an...@samba.org --- arch/powerpc/include/asm/word-at-a-time.h | 71 +++ 1 file changed, 71 insertions(+)

[PATCH 08/39] powerpc: Set MSR_LE bit on little endian builds

2013-09-22 Thread Anton Blanchard
We need to set MSR_LE in kernel and userspace for little endian builds Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/reg.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index

[PATCH 09/39] powerpc: Reset MSR_LE on signal entry

2013-09-22 Thread Anton Blanchard
We always take signals in big endian which is wrong. Signals should be taken in native endian. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/signal_32.c | 3 ++- arch/powerpc/kernel/signal_64.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH 10/39] powerpc: Include the appropriate endianness header

2013-09-22 Thread Anton Blanchard
From: Ian Munsie imun...@au1.ibm.com This patch will have powerpc include the appropriate generic endianness header depending on what the compiler reports. Signed-off-by: Ian Munsie imun...@au1.ibm.com Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/uapi/asm/byteorder.h

[PATCH 11/39] powerpc: endian safe trampoline

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org 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. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by:

[PATCH 16/39] powerpc: Handle VSX alignment faults in little endian mode

2013-09-22 Thread Anton Blanchard
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 an...@samba.org --- arch/powerpc/kernel/align.c | 41

[PATCH 15/39] powerpc: Add little endian support to alignment handler

2013-09-22 Thread Anton Blanchard
Handle most unaligned load and store faults in little endian mode. Strings, multiples and VSX are not supported. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/align.c | 93 ++--- 1 file changed, 63 insertions(+), 30 deletions(-)

[PATCH 17/39] powerpc: Use generic checksum code in little endian

2013-09-22 Thread Anton Blanchard
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 an...@samba.org --- arch/powerpc/Kconfig| 3 +++ arch/powerpc/include/asm/checksum.h | 5 +

[PATCH 18/39] powerpc: Use generic memcpy code in little endian

2013-09-22 Thread Anton Blanchard
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 an...@samba.org --- arch/powerpc/include/asm/string.h | 4 arch/powerpc/kernel/ppc_ksyms.c | 2 ++ arch/powerpc/lib/Makefile

[PATCH 19/39] powerpc: uname should return ppc64le/ppcle on little endian builds

2013-09-22 Thread Anton Blanchard
We need to distinguish between big endian and little endian environments, so fix uname to return the right thing. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/Makefile | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/Makefile

[PATCH 20/39] powerpc: Little endian fixes for platforms/powernv/opal.c

2013-09-22 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- arch/powerpc/platforms/powernv/opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index

[PATCH 21/39] powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci.c

2013-09-22 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- arch/powerpc/platforms/powernv/pci.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c

[PATCH 23/39] powerpc: Little endian sparse clean up for arch/powerpc/platforms/powernv/pci-ioda.c

2013-09-22 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- arch/powerpc/platforms/powernv/pci-ioda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c

[PATCH 22/39] powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci-p5ioc2.c

2013-09-22 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- arch/powerpc/platforms/powernv/pci-p5ioc2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c

[PATCH 24/39] powerpc/powernv: Fix endian issues in OPAL RTC driver

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/platforms/powernv/opal-rtc.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/platforms/powernv/opal-rtc.c

[PATCH 25/39] powerpc/powernv: Fix endian issues in OPAL ICS backend

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/sysdev/xics/ics-opal.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/sysdev/xics/ics-opal.c

[PATCH 26/39] powerpc/powernv: Make OPAL NVRAM device tree accesses endian safe

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/platforms/powernv/opal-nvram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal-nvram.c

[PATCH 27/39] powerpc/powernv: Fix endian issues in powernv PCI code

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/platforms/powernv/pci-ioda.c | 31 +-- arch/powerpc/platforms/powernv/pci.c | 27 +-- 2 files changed, 30

[PATCH 28/39] powerpc/powernv: Fix endian issues in OPAL console and udbg backend

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/opal.h | 8 arch/powerpc/platforms/powernv/opal.c | 28 2 files changed, 20 insertions(+), 16

[PATCH 30/39] powerpc/powernv: Don't register exception handlers in little endian mode

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org The powernv exception handlers are not ready to take exceptions in little endian mode, so disable them. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/platforms/powernv/opal.c | 2 ++ 1 file changed, 2

[PATCH 29/39] powerpc/powernv: Fix OPAL entry and exit in little endian mode

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/platforms/powernv/opal-wrappers.S | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S

[PATCH 31/39] powerpc/powernv: More little endian issues in OPAL RTC driver

2013-09-22 Thread Anton Blanchard
Sparse caught an issue where opal_set_rtc_time was incorrectly byteswapping. Also fix a number of sparse warnings. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/opal.h | 4 ++-- arch/powerpc/platforms/powernv/opal-rtc.c | 19 ++- 2 files

[PATCH 32/39] powerpc/powernv: Fix some PCI sparse errors and one LE bug

2013-09-22 Thread Anton Blanchard
pnv_pci_setup_bml_iommu was missing a byteswap of a device tree property. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/opal.h | 22 +++--- arch/powerpc/platforms/powernv/opal.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 6

[PATCH 33/39] powerpc/hvsi: Fix endian issues in HVSI driver

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/hvsi.h | 16 drivers/tty/hvc/hvsi_lib.c | 25 - 2 files changed, 20 insertions(+), 21 deletions(-) diff

[PATCH 34/39] tty/hvc_opal: powerpc: Make OPAL HVC device tree accesses endian safe

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- drivers/tty/hvc/hvc_opal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index

[PATCH 35/39] KVM: PPC: Disable KVM on little endian builds

2013-09-22 Thread Anton Blanchard
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 an...@samba.org Cc: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 36/39] powerpc/kvm/book3s_hv: Add little endian guest support

2013-09-22 Thread Anton Blanchard
Add support for the H_SET_MODE hcall so we can select the endianness of our exceptions. We create a guest MSR from scratch when delivering exceptions in a few places and instead of extracing the LPCR[ILE] and inserting it into MSR_LE each time simply create a new variable intr_msr which contains

[PATCH 37/39] powerpc: Add ability to build little endian kernels

2013-09-22 Thread Anton Blanchard
From: Ian Munsie imun...@au1.ibm.com 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,

[PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ

2013-09-22 Thread Chen Gang
NO_IRQ may be defined as '(unsigned int) -1' in some architectures (arm, sh ...), and either may not be defined in some architectures which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc). When irq_of_parse_and_map() fails, it will always return 0, so need check zero instead of NO_IRQ, or

[PATCH] sound/soc/fsl/fsl_ssi.c: let checking none-zero instead of checking NO_IRQ

2013-09-22 Thread Chen Gang
NO_IRQ may be defined as '(unsigned int) -1' in some architectures (arm, sh ...), and either may not be defined in some architectures which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc). When irq_of_parse_and_map() fails, it will always return 0, so need let checking none-zero instead of

[PATCH 5/6 v7] kvm: booke: clear host tlb reference flag on guest tlb invalidation

2013-09-22 Thread Bharat Bhushan
On booke, struct tlbe_ref contains host tlb mapping information (pfn: for guest-pfn to pfn, flags: attribute associated with this mapping) for a guest tlb entry. So when a guest creates a TLB entry then struct tlbe_ref is set to point to valid pfn and set attributes in flags field of the above

[PATCH][v4] powerpc/mpc85xx:Add initial device tree support of T104x

2013-09-22 Thread Prabhakar Kushwaha
The QorIQ T1040/T1042 processor support four integrated 64-bit e5500 PA processor cores with high-performance data path acceleration architecture and network peripheral interfaces required for networking telecommunications. T1042 personality is a reduced personality of T1040 without Integrated

[PATCH 1/2][v4] powerpc/fsl-booke: Add initial T104x_QDS board support

2013-09-22 Thread Prabhakar Kushwaha
Add support for T104x board in board file t104x_qds.c, It is common for both T1040 and T1042 as they share same QDS board. T1040QDS board Overview --- - SERDES Connections, 8 lanes supporting: — PCI Express: supporting Gen 1 and Gen 2; — SGMII — QSGMII

[PATCH 2/2][v4] powerpc/configs: Enable T1040QDS by default in corenet

2013-09-22 Thread Prabhakar Kushwaha
T1040 supports both 32 64 bit kernel. so enable T1040QDS by default in the config files. Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com --- Based upon git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git Branch next Changes for v2: Sending as it is Changes for v3:

[PATCH] powerpc/irq: Run softirqs off the top of the irq stack

2013-09-22 Thread Benjamin Herrenschmidt
Nowadays, irq_exit() calls __do_softirq() pretty much directly instead of calling do_softirq() which switches to the decicated softirq stack. This has lead to observed stack overflows on powerpc since we call irq_enter() and irq_exit() outside of the scope that switches to the irq stack. This