Re: [PATCH 1/2] powerpc/math-emu: move the flush FPU state function into do_mathemu

2013-07-14 Thread Kevin Hao
On Thu, Jul 11, 2013 at 05:34:45PM -0700, Matt Helsley wrote: On Thu, Jul 11, 2013 at 08:21:54PM +0800, Kevin Hao wrote: By doing this we can make sure that the FPU state is only flushed to the thread struct when it is really needed. Signed-off-by: Kevin Hao haoke...@gmail.com ---

Re: [PATCH v2 1/2] powerpc/math-emu: move the flush FPU state function into do_mathemu

2013-07-14 Thread Kevin Hao
On Fri, Jul 12, 2013 at 06:37:13PM +1000, Benjamin Herrenschmidt wrote: On Fri, 2013-07-12 at 13:36 +0800, Kevin Hao wrote: + /* +* If we support a HW FPU, we need to ensure the FP state +* if flushed into the thread_struct before attempting +* emulation +

[PATCH v3 0/2] powerpc/math-emu: two patches for the emulation of the FPU unimplemented instructions

2013-07-14 Thread Kevin Hao
v3: Fix the typo in the comments of patch 1. v2: Tweak the patch 2 as suggested by Benjamin and Scott. v1: These two patches are for the emulation of the FPU unimplemented instructions. The first is just a bit optimization for the FPU state flush. The second is requested by Scott. Kevin Hao

[PATCH v3 1/2] powerpc/math-emu: move the flush FPU state function into do_mathemu

2013-07-14 Thread Kevin Hao
By doing this we can make sure that the FPU state is only flushed to the thread struct when it is really needed. Signed-off-by: Kevin Hao haoke...@gmail.com --- v3: Fix the typo in the comments. arch/powerpc/kernel/traps.c | 9 - arch/powerpc/math-emu/math.c | 9 + 2 files

[PATCH v3 2/2] powerpc: introduce function emulate_math()

2013-07-14 Thread Kevin Hao
There are two invocations of do_mathemu() in traps.c. And the codes in these two places are almost the same. Introduce a locale function to eliminate the duplication. With this change we can also make sure that in program_check_exception() the PPC_WARN_EMULATED is invoked for the correctly

Re: [PATCH RFC 5/8] dma: mpc512x: use symbolic specifiers for DMA channels

2013-07-14 Thread Arnd Bergmann
On Saturday 13 July 2013, Gerhard Sittig wrote: [ MPC8308 knowledge required, see below ] On Sat, Jul 13, 2013 at 09:17 +0200, Arnd Bergmann wrote: On Friday 12 July 2013, Gerhard Sittig wrote: +++ b/include/dt-bindings/dma/mpc512x-dma.h @@ -0,0 +1,21 @@ +/* + * This header

[PATCH 0/4] powerpc: several cleanup patches for the FPU

2013-07-14 Thread Kevin Hao
All these patches passed the build test for the following configurations: ppc40x_defconfig ppc64e_defconfig ppc64_defconfig mpc85xx_defconfig mpc85xx_smp_defconfig corenet32_smp_defconfig corenet64_smp_defconfig ppc44x_defconfig

[PATCH 1/4] powerpc: remove the unused function disable_kernel_fp()

2013-07-14 Thread Kevin Hao
The only using of function disable_kernel_fp() was already dropped in the commit 5daf9071 (powerpc: merge align.c). Signed-off-by: Kevin Hao haoke...@gmail.com --- arch/powerpc/include/asm/switch_to.h | 1 - arch/powerpc/kernel/misc_64.S| 13 - 2 files changed, 14

[PATCH 2/4] powerpc: remove the redundant flush_fp_to_thread() in setup_sigcontext()

2013-07-14 Thread Kevin Hao
In commit c6e6771b(powerpc: Introduce VSX thread_struct and CONFIG_VSX) we add a invocation of flush_fp_to_thread() before copying the FPR or VSR to users. But we already invoke the flush_fp_to_thread() in this function. So remove one of them. Signed-off-by: Kevin Hao haoke...@gmail.com ---

[PATCH 4/4] powerpc: remove the empty giveup_fpu() function on 32bit kernel

2013-07-14 Thread Kevin Hao
Instead of implementing an empty giveup_fpu() function for each 32bit processor type, replace them with an unique empty inline function. Signed-off-by: Kevin Hao haoke...@gmail.com --- arch/powerpc/include/asm/switch_to.h | 3 ++- arch/powerpc/kernel/head_40x.S | 8

[PATCH 3/4] powerpc: make flush_fp_to_thread() nop when CONFIG_PPC_FPU is disabled

2013-07-14 Thread Kevin Hao
In the current kernel, the function flush_fp_to_thread() is not dependent on CONFIG_PPC_FPU. So most invocations of this function is not wrapped by CONFIG_PPC_FPU. Even through we don't really save the FPRs to the thread struct if CONFIG_PPC_FPU is not enabled, but there does have some runtime

Re: [PATCH RFC 5/8] dma: mpc512x: use symbolic specifiers for DMA channels

2013-07-14 Thread Lars-Peter Clausen
On 07/14/2013 10:50 AM, Arnd Bergmann wrote: On Saturday 13 July 2013, Gerhard Sittig wrote: [ MPC8308 knowledge required, see below ] On Sat, Jul 13, 2013 at 09:17 +0200, Arnd Bergmann wrote: On Friday 12 July 2013, Gerhard Sittig wrote: +++ b/include/dt-bindings/dma/mpc512x-dma.h @@ -0,0

Re: [PATCH RFC 1/8] powerpc: mpc512x_dma: add support for data transfers between memory and i/o memory

2013-07-14 Thread Lars-Peter Clausen
On 07/12/2013 05:26 PM, Gerhard Sittig wrote: [...] ] + if (mchan-tcd_nunits) + tcd-nbytes = mchan-tcd_nunits * 4; + else + tcd-nbytes = 64; Just wondering where does the magic 64 come from?

Re: [PATCH RFC 5/8] dma: mpc512x: use symbolic specifiers for DMA channels

2013-07-14 Thread Gerhard Sittig
On Sun, Jul 14, 2013 at 10:50 +0200, Arnd Bergmann wrote: On Saturday 13 July 2013, Gerhard Sittig wrote: [ ... ] Thank you for the feedback. OK, so not adding the dt-bindings header leads to no change in the DTS nodes, which in turn collapses 5/8 into something local to the

Re: [PATCH RFC 1/8] powerpc: mpc512x_dma: add support for data transfers between memory and i/o memory

2013-07-14 Thread Gerhard Sittig
On Sun, Jul 14, 2013 at 12:05 +0200, Lars-Peter Clausen wrote: On 07/12/2013 05:26 PM, Gerhard Sittig wrote: [...] ] + if (mchan-tcd_nunits) + tcd-nbytes = mchan-tcd_nunits * 4; + else + tcd-nbytes = 64; Just wondering where

[PATCH] powerpc/pseries: drop select HOTPLUG

2013-07-14 Thread Paul Bolle
The Kconfig symbol HOTPLUG was removed with commit 40b313608a (Finally eradicate CONFIG_HOTPLUG). But there's still one select statement for that symbol. It seems that select statement was added after the patch to remove CONFIG_HOTPLUG was submitted. Anyhow, it is useless and can be dropped.

[PATCH RFC v2 0/5] MPC512x DMA slave s/g support, OF DMA lookup

2013-07-14 Thread Gerhard Sittig
this series - introduces slave s/g support (that's support for DMA transfers which involve peripherals in contrast to mem-to-mem transfers) - adds device tree based lookup support for DMA channels - combines floating patches and related feedback which already covered several aspects of what

[PATCH RFC v2 1/5] dma: mpc512x: re-order mpc8308 specific instructions

2013-07-14 Thread Gerhard Sittig
it's rather unexpected to have the MPC8308 specific code in the 'else' branch so distant from the is MPC8308? check concentrate the test and the specific code for MPC8308 in the 'if' branch and handle MPC512x in the 'else' branch; use a symbolic channel count which in combination with the

[PATCH RFC v2 2/5] dma: mpc512x: add support for peripheral transfers

2013-07-14 Thread Gerhard Sittig
From: Alexander Popov a13xp0p0...@gmail.com introduce support for slave s/g transfer preparation and the associated device control callback in the MPC512x DMA controller driver, which adds support for data transfers between memory and peripheral I/O to the previously supported mem-to-mem

[PATCH RFC v2 3/5] dma: of: Add common xlate function for matching by channel id

2013-07-14 Thread Gerhard Sittig
From: Lars-Peter Clausen l...@metafoo.de This patch adds a new common OF dma xlate callback function which will match a channel by it's id. The binding expects one integer argument which it will use to lookup the channel by the id. Unlike of_dma_simple_xlate this function is able to handle a

[PATCH RFC v2 5/5] HACK mmc: mxcmmc: enable clocks for the MPC512x

2013-07-14 Thread Gerhard Sittig
QD HACK to enable SD card support without correct COMMON_CLK support, best viewed with 'git diff -w -b', NOT acceptable for mainline (NAKed) Signed-off-by: Gerhard Sittig g...@denx.de --- drivers/mmc/host/mxcmmc.c | 41 +++-- 1 file changed, 27

[PATCH RFC v2 4/5] dma: mpc512x: register for device tree channel lookup

2013-07-14 Thread Gerhard Sittig
register the controller for device tree based lookup of DMA channels (non-fatal for backwards compatibility with older device trees), provide the '#dma-cells' property in the shared mpc5121.dtsi file, and introduce a bindings document for the MPC512x DMA controller Signed-off-by: Gerhard Sittig

Re: [PATCH] powerpc/pseries: drop select HOTPLUG

2013-07-14 Thread Benjamin Herrenschmidt
On Sun, 2013-07-14 at 13:02 +0200, Paul Bolle wrote: The Kconfig symbol HOTPLUG was removed with commit 40b313608a (Finally eradicate CONFIG_HOTPLUG). But there's still one select statement for that symbol. It seems that select statement was added after the patch to remove CONFIG_HOTPLUG was

Re: ABI defined register usage within function calls

2013-07-14 Thread Benjamin Herrenschmidt
On Fri, 2013-07-12 at 04:38 -0700, JiveTalkin wrote: Moderator..can you change the subject of this to Understanding register usage as per ABI rules for functions ?? Additionally, doesn't anyone have anything to say about this? We don't modify subjects after the fact. As to why nobody

Re: visible memory seems wrong in kexec crash dump kernel

2013-07-14 Thread Chris Friesen
On 07/13/2013 11:26 PM, Benjamin Herrenschmidt wrote: On Sun, 2013-07-14 at 14:36 +1000, Michael Ellerman wrote: Is this expected behaviour? It seems to be the same in current git versions of kexec-tools. On my system I see /proc/device-tree/memory. If I modify add_usable_mem_property() to

Re: visible memory seems wrong in kexec crash dump kernel

2013-07-14 Thread Benjamin Herrenschmidt
On Sun, 2013-07-14 at 17:08 -0600, Chris Friesen wrote: So for memory starting at 0 it should be memory@0 There are a fair number of dts files in the kernel tree that don't specify an address for the memory node. If the kernel accepts it without an address, it seems logical that kexec

[v1][PATCH 1/1] powerpc: to access local paca after hard irq disabled

2013-07-14 Thread Tiejun Chen
We can access paca directly after hard interrupt disabled, and this can avoid accessing wrong paca when using get_paca() in preempt case. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- arch/powerpc/include/asm/hw_irq.h |7 --- 1 file changed, 4 insertions(+), 3 deletions(-)

[PATCH 1/8] powerpc: Better split CONFIG_PPC_INDIRECT_PIO and CONFIG_PPC_INDIRECT_MMIO

2013-07-14 Thread Benjamin Herrenschmidt
Remove the generic PPC_INDIRECT_IO and ensure we only add overhead to the right accessors. IE. If only CONFIG_PPC_INDIRECT_PIO is set, we don't add overhead to all MMIO accessors. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/io.h| 25

[PATCH 3/8] powerpc/powernv: Add helper to get ibm,chip-id of a node

2013-07-14 Thread Benjamin Herrenschmidt
This includes walking the parent nodes if necessary. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/prom.h | 2 ++ arch/powerpc/kernel/prom.c | 26 ++ 2 files changed, 28 insertions(+) diff --git

[PATCH 2/8] powerpc/powernv: Update opal.h to add new LPC and XSCOM functions

2013-07-14 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/opal.h| 23 +++ arch/powerpc/platforms/powernv/opal-wrappers.S | 4 2 files changed, 27 insertions(+) diff --git a/arch/powerpc/include/asm/opal.h

[PATCH 4/8] powerpc/powernv: Add PIO accessors for Power8 LPC bus

2013-07-14 Thread Benjamin Herrenschmidt
This uses the hooks provided by CONFIG_PPC_INDIRECT_PIO to implement a set of hooks for IO port access to use the LPC bus via OPAL calls for the first 64K of IO space Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/io.h | 8 ++

[PATCH 5/8] powerpc: Cleanup udbg_16550 and add support for LPC PIO-only UARTs

2013-07-14 Thread Benjamin Herrenschmidt
The udbg_16550 code, which we use for our early consoles and debug backends was fairly messy. Especially for the debug consoles, it would re-implement the high level getc/putc/poll functions for each access method. It also had code to configure the UART but only for the straight MMIO method. This

[PATCH 6/8] powerpc: Check status property before adding legacy ISA serial ports

2013-07-14 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/kernel/legacy_serial.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 5cf11b0..6f2a15c 100644 ---

[PATCH 7/8] powerpc/powernv: Don't crash if there are no OPAL consoles

2013-07-14 Thread Benjamin Herrenschmidt
Some machines might provide the console via a different mechanism such as direct access to a UART from Linux, in which case OPAL might not expose any console. In that case, the code would cause a NULL dereference. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org ---

[PATCH 8/8] powerpc/powernv: Enable detection of legacy UARTs

2013-07-14 Thread Benjamin Herrenschmidt
Legacy UARTs can exist on PowerNV, memory-mapped ones on PCI or IO based ones on the LPC bus. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/platforms/powernv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/Kconfig

[PATCH] module: ppc64 module CRC relocation fix causes perf issues

2013-07-14 Thread Anton Blanchard
Module CRCs are implemented as absolute symbols that get resolved by a linker script. We build an intermediate .o that contains an unresolved symbol for each CRC. genksysms parses this .o, calculates the CRCs and writes a linker script that resolves the symbols to the calculated CRC.

Re: [PATCH] module: ppc64 module CRC relocation fix causes perf issues

2013-07-14 Thread Rusty Russell
Anton Blanchard an...@samba.org writes: Module CRCs are implemented as absolute symbols that get resolved by a linker script. We build an intermediate .o that contains an unresolved symbol for each CRC. genksysms parses this .o, calculates the CRCs and writes a linker script that resolves the