LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] [v2] watchdog: booke_wdt: clean up status messages
From: Kumar Gala @ 2011-03-15 15:42 UTC (permalink / raw)
  To: Timur Tabi; +Cc: wim, linux-watchdog, linuxppc-dev
In-Reply-To: <1297208386-15010-1-git-send-email-timur@freescale.com>


On Feb 8, 2011, at 5:39 PM, Timur Tabi wrote:

> Improve the status messages that are displayed during some operations =
of the
> PowerPC watchdog timer driver.  When the watchdog is enabled, the =
timeout is
> displayed as a number of seconds, instead of an obscure "period".  The =
"period"
> is the position of a bit in a 64-bit timer register.  The higher the =
value,
> the quicker the watchdog timeout occurs.  Some people chose a high =
"period"
> value for the timer and get confused as to why the board resets within =
a
> few seconds.
>=20
> Messages displayed during open and close are now debug messages, so =
that they
> don't clutter the console by default.  Finally, printk() is replaced =
with the
> pr_xxx() equivalent.
>=20
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> drivers/watchdog/booke_wdt.c |   19 +++++++++----------
> 1 files changed, 9 insertions(+), 10 deletions(-)

applied

- k=

^ permalink raw reply

* Re: [PATCH 2/2] dts: Update sata controller compatible for p1022ds board
From: Kumar Gala @ 2011-03-15 15:39 UTC (permalink / raw)
  To: Xulei; +Cc: linux-ide, linuxppc-dev, jgarzik
In-Reply-To: <1295428050-21934-2-git-send-email-B33228@freescale.com>


On Jan 19, 2011, at 3:07 AM, Xulei wrote:

> Update p1022 sata compatible to "fsl,p1022-sata", "fsl,pq-sata-v2".
> p1022ds sata controller is v2 version comparing previous FSL sata
> controller, for example, mpc8536.
> 
> Signed-off-by: Lei Xu <B33228@freescale.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> ---
> arch/powerpc/boot/dts/p1022ds.dts |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)

applied

- k

^ permalink raw reply

* Re: [PATCH] powerpc/mpc8xxx_gpio: simplify searching for 'fsl, qoriq-gpio' compatiable
From: Kumar Gala @ 2011-03-15 15:32 UTC (permalink / raw)
  To: Anatolij Gustschin; +Cc: linuxppc-dev
In-Reply-To: <1294501876-9331-1-git-send-email-agust@denx.de>


On Jan 8, 2011, at 9:51 AM, Anatolij Gustschin wrote:

> Commit da3ed89e7ce272ebcc918487e2a28736ca0dd6bb added
> 'fsl,qoriq-gpio' compatiable searching in the old way
> using for_each_compatible_node(). But the driver have
> previously been changed to use a struct of_device_id
> compatible list passed to for_each_matching_node().
> 
> Add 'fsl,qoriq-gpio' compatiable to the existing
> compatible list instead of adding another
> for_each_compatible_node() loop.
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
> arch/powerpc/sysdev/mpc8xxx_gpio.c |    4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)

applied

- k

^ permalink raw reply

* Re: [PATCH] ppc, 8xx: remove obsolete mgsuvd board
From: Kumar Gala @ 2011-03-15 15:11 UTC (permalink / raw)
  To: Holger Brunck; +Cc: Heiko Schocher, linuxppc-dev
In-Reply-To: <4D2EEBEF.2010005@keymile.com>


On Jan 13, 2011, at 6:11 AM, Holger Brunck wrote:

> The MPC852 based mgsuvd board from Keymile was initially ported,
> but later on not developed further. This patch removes the respective
> files to decrease merging conflicts and unneeded maintenance.
>=20
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher<hs@denx.de>
> Cc: Vitaly Bordug <vitb@kernel.crashing.org>
> Cc: Marcelo Tosatti <marcelo@kvack.org>
> ---
> arch/powerpc/boot/dts/mgsuvd.dts      |  163 =
---------------------------------
> arch/powerpc/configs/mgsuvd_defconfig |   81 ----------------
> arch/powerpc/platforms/8xx/Kconfig    |    6 -
> arch/powerpc/platforms/8xx/Makefile   |    1 -
> arch/powerpc/platforms/8xx/mgsuvd.c   |   92 ------------------
> 5 files changed, 0 insertions(+), 343 deletions(-)
> delete mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
> delete mode 100644 arch/powerpc/configs/mgsuvd_defconfig
> delete mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c

applied

- k=

^ permalink raw reply

* Re: [PATCH] e500: Erratum cpu a005 workaround
From: Kumar Gala @ 2011-03-15 15:07 UTC (permalink / raw)
  To: Liu Yu; +Cc: B11780, linuxppc-dev
In-Reply-To: <1295935333-13045-1-git-send-email-yu.liu@freescale.com>


On Jan 25, 2011, at 12:02 AM, Liu Yu wrote:

> This errata can occur if a single-precision floating-point, =
double-precision
> floating-point or vector floating-point instruction on a mispredicted =
branch
> path signals one of the floating-point data interrupts which are =
enabled by the
> SPEFSCR (FINVE, FDBZE, FUNFE or FOVFE bits).  This interrupt must be =
recorded
> in a one-cycle window when the misprediction is resolved.  If this =
extremely
> rare event should occur, the result could be:
>=20
> The SPE Data Exception from the mispredicted path may be reported
> erroneously if a single-precision floating-point, double-precision
> floating-point or vector floating-point instruction is the second =
instruction
> on the correct branch path.
>=20
> According to errata description, some efp instructions
> which are not supposed to trigger SPE exceptions
> can trigger the exceptions in this case.
> However, as we haven't emulated these instructions here,
> a signal will send to userspace, and userspace application would exit.
>=20
> This patch re-issue the efp instruction that we haven't emulated,
> so that hardware can properly execute it again if this case happen.
>=20
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> This is an erratum workaround patch.
> It would be better if the patch can go into 2.6.38.
>=20
> arch/powerpc/include/asm/reg.h   |    2 +
> arch/powerpc/math-emu/math_efp.c |   53 =
+++++++++++++++++++++++++++++++++++++-
> 2 files changed, 54 insertions(+), 1 deletions(-)

applied

- k=

^ permalink raw reply

* Re: [PATCH] ppc, 82xx: rename and update mgcoge board support
From: Kumar Gala @ 2011-03-15 15:07 UTC (permalink / raw)
  To: Holger Brunck; +Cc: Heiko Schocher, linuxppc-dev
In-Reply-To: <1299757965-10235-1-git-send-email-holger.brunck@keymile.com>


On Mar 10, 2011, at 5:52 AM, Holger Brunck wrote:

> The mgcoge board from keymile is now base for some other
> similar boards. Therefore the board specific name mgcoge
> was renamed to a generic name km82xx. Additionally some
> enhancements were made:
> 	- rework partition table in dts file
> 	- add cpm2_pio_c gpio controller in dts file
> 	- update defconfig
> 	- add pin description for SCC1
> 	- add pin description and configuration for USB
>=20
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Kumar Gala <galak@kernel.crashing.org>
> CC: Heiko Schocher <hs@denx.de>
>=20
> ---
> arch/powerpc/boot/dts/mgcoge.dts                   |   47 =
++++++++-------
> arch/powerpc/configs/mgcoge_defconfig              |    9 +---
> arch/powerpc/platforms/82xx/Makefile               |    2 +-
> arch/powerpc/platforms/82xx/{mgcoge.c =3D> km82xx.c} |   62 =
++++++++++++++------
> 4 files changed, 72 insertions(+), 48 deletions(-)
> rename arch/powerpc/platforms/82xx/{mgcoge.c =3D> km82xx.c} (69%)

applied

- k=

^ permalink raw reply

* Re: [PATCH] ppc, 83xx: rename and update kmeter1
From: Kumar Gala @ 2011-03-15 15:07 UTC (permalink / raw)
  To: Holger Brunck; +Cc: Heiko Schocher, linuxppc-dev
In-Reply-To: <1299826964-3846-1-git-send-email-holger.brunck@keymile.com>


On Mar 11, 2011, at 1:02 AM, Holger Brunck wrote:

> Beside the MPC 8360 based board kmeter1 other km83xx boards
> from keymile will follow. Therefore the board specific naming
> kmeter1 for functions and files were replaced with km83xx.
> Additionally some updates were made:
>    - update defconfig for 2.6.38
>    - rework flash partitioning in dts file
>    - add gpio controller for qe_pio_c in dts
>=20
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Kumar Gala <galak@kernel.crashing.org>
> CC: Heiko Schocher <hs@denx.de>
> ---
> arch/powerpc/boot/dts/kmeter1.dts                  |   69 =
+++++++++++---------
> arch/powerpc/configs/83xx/kmeter1_defconfig        |    7 +--
> arch/powerpc/platforms/83xx/Makefile               |    2 +-
> .../powerpc/platforms/83xx/{kmeter1.c =3D> km83xx.c} |   46 =
+++++++++----
> 4 files changed, 71 insertions(+), 53 deletions(-)
> rename arch/powerpc/platforms/83xx/{kmeter1.c =3D> km83xx.c} (80%)

applied

- k=

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: Fix writing to spin table 'cpu-release-addr' on ppc64e
From: Kumar Gala @ 2011-03-15 14:21 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1299359119-7176-1-git-send-email-galak@kernel.crashing.org>


On Mar 5, 2011, at 3:05 PM, Kumar Gala wrote:

> From: Kumar Gala <kumar.gala@freescale.com>
> 
> If the spin table is located in the linear mapping (which can happen if
> we have 4G or more of memory) we need to access the spin table via a
> cacheable coherent mapping like we do on ppc32 (and do explicit cache
> flush).
> 
> See the following commit for the ppc32 version of this issue:
> 
> commit d1d47ec6e62ab08d2ebb925fd9203abfad3adfbf
> Author: Peter Tyser <ptyser@xes-inc.com>
> Date:   Fri Dec 18 16:50:37 2009 -0600
> 
>    powerpc/85xx: Fix SMP when "cpu-release-addr" is in lowmem
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/platforms/85xx/smp.c |    6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)

applied

- k

^ permalink raw reply

* Re: Please pull 'next' branch of 4xx tree
From: Josh Boyer @ 2011-03-15 13:19 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev
In-Reply-To: <20110215145445.GA2847@zod.rchland.ibm.com>

On Tue, Feb 15, 2011 at 09:54:45AM -0500, Josh Boyer wrote:
>Hi Ben,
>
>Please pull the 'next' branch of the 4xx tree.  These commits have been
>sitting there for a while and I wanted to get them into your branch
>before tackling the latest round of 476 stuff from Shaggy.

Ben, I don't see any of these in your -next branch.  Did you ever pull
this?

josh

>The following changes since commit 5d7d8072edc11080a7cf6cc37c9f4e61ca1e93c9:
>
>  powerpc/pseries: Fix build of topology stuff without CONFIG_NUMA (2011-01-12 10:56:29 +1100)
>
>are available in the git repository at:
>  ssh://master.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git next
>
>Dave Kleikamp (2):
>      powerpc/476: define specific cpu table entry DD2 core
>      powerpc/476: Workaround for PLB6 hang
>
>Rupjyoti Sarmah (1):
>      powerpc/44x: PHY fixup for USB on canyonlands board
>
>Tirumala Marri (1):
>      powerpc/44x: Add USB DWC DTS entry to Canyonlands board
>
> arch/powerpc/boot/dts/canyonlands.dts      |   24 +++++
> arch/powerpc/include/asm/cputable.h        |    3 +-
> arch/powerpc/kernel/cputable.c             |   22 ++++-
> arch/powerpc/mm/tlb_nohash_low.S           |   35 +++++++
> arch/powerpc/platforms/44x/44x.h           |    4 +
> arch/powerpc/platforms/44x/Kconfig         |    1 -
> arch/powerpc/platforms/44x/Makefile        |    1 +
> arch/powerpc/platforms/44x/canyonlands.c   |  134 ++++++++++++++++++++++++++++
> arch/powerpc/platforms/44x/ppc44x_simple.c |    1 -
> 9 files changed, 218 insertions(+), 7 deletions(-)
> create mode 100644 arch/powerpc/platforms/44x/canyonlands.c
>
>_______________________________________________
>Linuxppc-dev mailing list
>Linuxppc-dev@lists.ozlabs.org
>https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH v3 1/6] powerpc: Move udbg_early_init() after early_init_devtree()
From: Josh Boyer @ 2011-03-15 13:05 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: linuxppc-dev
In-Reply-To: <1297292893-30241-2-git-send-email-shaggy@linux.vnet.ibm.com>

On Wed, Feb 09, 2011 at 05:08:08PM -0600, Dave Kleikamp wrote:
>so that it can use information from the device tree.
>
>Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
>Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
>Cc: linuxppc-dev@lists.ozlabs.org
>---

Ben, you want this patch dropped, right?

josh

> arch/powerpc/kernel/setup_32.c |    6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
>index 1d2fbc9..d1ca976 100644
>--- a/arch/powerpc/kernel/setup_32.c
>+++ b/arch/powerpc/kernel/setup_32.c
>@@ -120,12 +120,12 @@ notrace void __init machine_init(unsigned long dt_ptr)
> {
> 	lockdep_init();
>
>-	/* Enable early debugging if any specified (see udbg.h) */
>-	udbg_early_init();
>-
> 	/* Do some early initialization based on the flat device tree */
> 	early_init_devtree(__va(dt_ptr));
>
>+	/* Enable early debugging if any specified (see udbg.h) */
>+	udbg_early_init();
>+
> 	probe_machine();
>
> 	setup_kdump_trampoline();
>-- 
>1.7.3.4
>

^ permalink raw reply

* Re: [PATCH 1/2] kdump: Allow shrinking of kdump region to be overridden
From: Américo Wang @ 2011-03-15  7:52 UTC (permalink / raw)
  To: mahesh
  Cc: kexec, linux-kernel, linuxppc-dev, Eric W. Biederman, akpm,
	Anton Blanchard
In-Reply-To: <20110314181315.GA16075@in.ibm.com>

On Tue, Mar 15, 2011 at 2:13 AM, Mahesh J Salgaonkar
<mahesh@linux.vnet.ibm.com> wrote:
>
> During free we do free all of them including RMO region. But since the rtas
> region is always on top of RMO, crashkernel memory overlaps rtas region and
> we endup freeing that even, which is causing the crash.
>

Okay, but with this patch applied, we will just ignore rtas region, right?
Thus, when I echo 0 to free all the 128M crashkernel memory, the final
result will be 32M left, which means crash_size will still show 32M.
This looks odd.

How about skipping the 32M as a whole? I mean once the region being freed
has overlap with this rtas region, skip the whole rtas region, and let
crash_size
show 0?

Thanks.

^ permalink raw reply

* Re: [PATCH 3/4 v5] video, sm501: add OF binding to support SM501
From: Heiko Schocher @ 2011-03-15  7:26 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: linux-fbdev, devicetree-discuss, Samuel Ortiz, Vincent Sanders,
	linux-kernel, Ben Dooks, Randy Dunlap, Paul Mundt, Wolfgang Denk
In-Reply-To: <1296026490-14665-1-git-send-email-hs@denx.de>

Hello

Heiko Schocher wrote:
> - add binding to OF, compatible name "smi,sm501"
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> cc: linux-fbdev@vger.kernel.org
> cc: devicetree-discuss@ozlabs.org
> cc: Ben Dooks <ben@simtec.co.uk>
> cc: Vincent Sanders <vince@simtec.co.uk>
> cc: Samuel Ortiz <sameo@linux.intel.com>
> cc: linux-kernel@vger.kernel.org
> cc: Randy Dunlap <rdunlap@xenotime.net>
> cc: Paul Mundt <lethal@linux-sh.org>
> 
> ---
> - changes since v1:
>   add Ben Dooks, Vincent Sanders and Samuel Ortiz to cc, as suggested from
>   Paul Mundt.
> - changes since v2:
>   add comments from Randy Dunlap:
>   - move parameter documentation to Documentation/fb/sm501.txt
> - changes since v3:
>   - rebased against v2.6.38-rc2
>   - split in 3 patches
>     - of support patch
>       - get rid of "#if defined(CONFIG_PPC_MPC52xx)" usage
>         hide this in DTS, as Paul suggested.
>     - i/o routine patch
>     - edid support patch
> - changes since v4
>   replace remaining CONFIG_PPC_MPC52xx with CONFIG_OF, as
>   it is no longer MPC52xx only.
> - changes since v5
>   free edid_data after its usage, as it is no longer needed,
>   suggested from Paul Mundt. Also fall back to default if
>   kmemdup(edid_data) fails.
> 
> ./scripts/checkpatch.pl 0003-video-sm501-add-OF-binding-to-support-SM501.patch
> total: 0 errors, 0 warnings, 132 lines checked
> 
> 0003-video-sm501-add-OF-binding-to-support-SM501.patch has no obvious style problems and is ready for submission.
> 
>  Documentation/powerpc/dts-bindings/sm501.txt |   34 +++++++++++++++++++++
>  drivers/mfd/sm501.c                          |    9 +++++-
>  drivers/video/sm501fb.c                      |   42 ++++++++++++++++++++++++--
>  3 files changed, 81 insertions(+), 4 deletions(-)
>  create mode 100644 Documentation/powerpc/dts-bindings/sm501.txt

This patchset is pending know for a while. I got Acked by from

Samuel Ortiz for the mfd part, see here:

http://www.spinics.net/lists/linux-fbdev/msg02550.html
http://linux.derkeiler.com/Mailing-Lists/Kernel/2011-01/msg11798.html

and for the DTS part from Benjamin Herrenschmidt:

http://lists.ozlabs.org/pipermail/linuxppc-dev/2011-February/088279.html

Are there some more issues?

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply

* inconsistent order of notify_die and kgdb/debugger between powerpc and x86
From: Fredrick Prashanth John Berchmans @ 2011-03-15  2:41 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <AANLkTik5OR4qtgyzkqZ=ove5QBzLOjapiZi_3b6Byrsf@mail.gmail.com>

I see in x86, the die chain notifiers are called first
before going to debugger but in powerpc its the
other way round.
Any reason for this inconsistency?
Because, I wanted to take some action before falling
to debugger in powerpc. Is there any cleaner way to do this which would work
irrespective of the architecture?

Thanks,
Fredrick

^ permalink raw reply

* [PATCH] crypto: caam - standardize device tree naming convention to utilize '-vX.Y'
From: Kim Phillips @ 2011-03-14 22:42 UTC (permalink / raw)
  To: Herbert Xu, devicetree-discuss, linux-crypto, linuxppc-dev
  Cc: Steve Cornelius, Kumar Gala

Help clarify that the number trailing in compatible nomenclature
is the version number of the device, i.e., change:

"fsl,p4080-sec4.0", "fsl,sec4.0";

to:

"fsl,p4080-sec-v4.0", "fsl,sec-v4.0";

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Kumar Gala <kumar.gala@freescale.com>
Cc: Steve Cornelius <sec@pobox.com>
---
 .../devicetree/bindings/crypto/fsl-sec4.txt        |   68 ++++++++++----------
 arch/powerpc/boot/dts/p4080ds.dts                  |   41 ++++++------
 drivers/crypto/caam/caamalg.c                      |    4 +-
 drivers/crypto/caam/ctrl.c                         |    6 +-
 4 files changed, 60 insertions(+), 59 deletions(-)

diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
index fce16a8..568aa3c 100644
--- a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
+++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
@@ -53,7 +53,7 @@ PROPERTIES
    - compatible
       Usage: required
       Value type: <string>
-      Definition: Must include "fsl,p4080-sec4.0","fsl,sec-4.0"
+      Definition: Must include "fsl,p4080-sec-v4.0","fsl,sec-v4.0"
 
    - #address-cells
        Usage: required
@@ -72,7 +72,7 @@ PROPERTIES
       Usage: required
       Value type: <prop-encoded-array>
       Definition: A standard property.  Specifies the physical
-          address and length of the SEC4.0 configuration registers.
+          address and length of the SEC4 configuration registers.
           registers
 
    - ranges
@@ -105,7 +105,7 @@ PROPERTIES
 
 EXAMPLE
 	crypto@300000 {
-		compatible = "fsl,p4080-sec4.0", "fsl,sec4.0";
+		compatible = "fsl,p4080-sec-v4.0", "fsl,sec-v4.0";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		reg = <0x300000 0x10000>;
@@ -127,7 +127,7 @@ P4080 Job Ring (JR) Node
   - compatible
       Usage: required
       Value type: <string>
-      Definition: Must include "fsl,p4080-sec4.0-job-ring","fsl,sec4.0-job-ring"
+      Definition: Must include "fsl,p4080-sec-v4.0-job-ring","fsl,sec-v4.0-job-ring"
 
   - reg
       Usage: required
@@ -163,8 +163,8 @@ P4080 Job Ring (JR) Node
 
 EXAMPLE
 	jr@1000 {
-		compatible = "fsl,p4080-sec4.0-job-ring",
-			     "fsl,sec4.0-job-ring";
+		compatible = "fsl,p4080-sec-v4.0-job-ring",
+			     "fsl,sec-v4.0-job-ring";
 		reg = <0x1000 0x1000>;
 		fsl,liodn = <0x081>;
 		interrupt-parent = <&mpic>;
@@ -186,7 +186,7 @@ P4080 Run Time Integrity Check (RTIC) Node
   - compatible
       Usage: required
       Value type: <string>
-      Definition: Must include "fsl,p4080-sec4.0-rtic","fsl,sec4.0-rtic".
+      Definition: Must include "fsl,p4080-sec-v4.0-rtic","fsl,sec-v4.0-rtic".
 
    - #address-cells
        Usage: required
@@ -219,8 +219,8 @@ P4080 Run Time Integrity Check (RTIC) Node
 
 EXAMPLE
 	rtic@6000 {
-		compatible = "fsl,p4080-sec4.0-rtic",
-			     "fsl,sec4.0-rtic";
+		compatible = "fsl,p4080-sec-v4.0-rtic",
+			     "fsl,sec-v4.0-rtic";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		reg = <0x6000 0x100>;
@@ -238,7 +238,7 @@ P4080 Run Time Integrity Check (RTIC) Memory Node
   - compatible
       Usage: required
       Value type: <string>
-      Definition: Must include "fsl,p4080-sec4.0-rtic-memory","fsl,sec4.0-rtic-memory".
+      Definition: Must include "fsl,p4080-sec-v4.0-rtic-memory","fsl,sec-v4.0-rtic-memory".
 
   - reg
       Usage: required
@@ -270,8 +270,8 @@ P4080 Run Time Integrity Check (RTIC) Memory Node
 
 EXAMPLE
 	rtic-a@0 {
-		compatible = "fsl,p4080-sec4.0-rtic-memory",
-			     "fsl,sec4.0-rtic-memory";
+		compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+			     "fsl,sec-v4.0-rtic-memory";
 		reg = <0x00 0x20 0x100 0x80>;
 		fsl,liodn   = <0x03c>;
 		fsl,rtic-region  = <0x12345678 0x12345678 0x12345678>;
@@ -288,7 +288,7 @@ P4080 Secure Non-Volatile Storage (SNVS) Node
   - compatible
       Usage: required
       Value type: <string>
-      Definition: Must include "fsl,p4080-sec4.0-mon", "fsl,sec4.0-mon".
+      Definition: Must include "fsl,p4080-sec-v4.0-mon", "fsl,sec-v4.0-mon".
 
   - reg
       Usage: required
@@ -315,7 +315,7 @@ P4080 Secure Non-Volatile Storage (SNVS) Node
 
 EXAMPLE
 	sec_mon@314000 {
-		compatible = "fsl,p4080-sec4.0-mon", "fsl,sec4.0-mon";
+		compatible = "fsl,p4080-sec-v4.0-mon", "fsl,sec-v4.0-mon";
 		reg = <0x314000 0x1000>;
 		interrupt-parent = <&mpic>;
 		interrupts = <93 2>;
@@ -325,7 +325,7 @@ EXAMPLE
 FULL EXAMPLE
 
 	crypto: crypto@300000 {
-		compatible = "fsl,p4080-sec4.0", "fsl,sec4.0";
+		compatible = "fsl,p4080-sec-v4.0", "fsl,sec-v4.0";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		reg = <0x300000 0x10000>;
@@ -334,73 +334,73 @@ FULL EXAMPLE
 		interrupts = <92 2>;
 
 		sec_jr0: jr@1000 {
-			compatible = "fsl,p4080-sec4.0-job-ring",
-				     "fsl,sec4.0-job-ring";
+			compatible = "fsl,p4080-sec-v4.0-job-ring",
+				     "fsl,sec-v4.0-job-ring";
 			reg = <0x1000 0x1000>;
 			interrupt-parent = <&mpic>;
 			interrupts = <88 2>;
 		};
 
 		sec_jr1: jr@2000 {
-			compatible = "fsl,p4080-sec4.0-job-ring",
-				     "fsl,sec4.0-job-ring";
+			compatible = "fsl,p4080-sec-v4.0-job-ring",
+				     "fsl,sec-v4.0-job-ring";
 			reg = <0x2000 0x1000>;
 			interrupt-parent = <&mpic>;
 			interrupts = <89 2>;
 		};
 
 		sec_jr2: jr@3000 {
-			compatible = "fsl,p4080-sec4.0-job-ring",
-				     "fsl,sec4.0-job-ring";
+			compatible = "fsl,p4080-sec-v4.0-job-ring",
+				     "fsl,sec-v4.0-job-ring";
 			reg = <0x3000 0x1000>;
 			interrupt-parent = <&mpic>;
 			interrupts = <90 2>;
 		};
 
 		sec_jr3: jr@4000 {
-			compatible = "fsl,p4080-sec4.0-job-ring",
-				     "fsl,sec4.0-job-ring";
+			compatible = "fsl,p4080-sec-v4.0-job-ring",
+				     "fsl,sec-v4.0-job-ring";
 			reg = <0x4000 0x1000>;
 			interrupt-parent = <&mpic>;
 			interrupts = <91 2>;
 		};
 
 		rtic@6000 {
-			compatible = "fsl,p4080-sec4.0-rtic",
-				     "fsl,sec4.0-rtic";
+			compatible = "fsl,p4080-sec-v4.0-rtic",
+				     "fsl,sec-v4.0-rtic";
 			#address-cells = <1>;
 			#size-cells = <1>;
 			reg = <0x6000 0x100>;
 			ranges = <0x0 0x6100 0xe00>;
 
 			rtic_a: rtic-a@0 {
-				compatible = "fsl,p4080-sec4.0-rtic-memory",
-					     "fsl,sec4.0-rtic-memory";
+				compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+					     "fsl,sec-v4.0-rtic-memory";
 				reg = <0x00 0x20 0x100 0x80>;
 			};
 
 			rtic_b: rtic-b@20 {
-				compatible = "fsl,p4080-sec4.0-rtic-memory",
-					     "fsl,sec4.0-rtic-memory";
+				compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+					     "fsl,sec-v4.0-rtic-memory";
 				reg = <0x20 0x20 0x200 0x80>;
 			};
 
 			rtic_c: rtic-c@40 {
-				compatible = "fsl,p4080-sec4.0-rtic-memory",
-					     "fsl,sec4.0-rtic-memory";
+				compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+					     "fsl,sec-v4.0-rtic-memory";
 				reg = <0x40 0x20 0x300 0x80>;
 			};
 
 			rtic_d: rtic-d@60 {
-				compatible = "fsl,p4080-sec4.0-rtic-memory",
-					     "fsl,sec4.0-rtic-memory";
+				compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+					     "fsl,sec-v4.0-rtic-memory";
 				reg = <0x60 0x20 0x500 0x80>;
 			};
 		};
 	};
 
 	sec_mon: sec_mon@314000 {
-		compatible = "fsl,p4080-sec4.0-mon", "fsl,sec4.0-mon";
+		compatible = "fsl,p4080-sec-v4.0-mon", "fsl,sec-v4.0-mon";
 		reg = <0x314000 0x1000>;
 		interrupt-parent = <&mpic>;
 		interrupts = <93 2>;
diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
index c78e801..0430d24 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -423,7 +423,7 @@
 		};
 
 		crypto: crypto@300000 {
-			compatible = "fsl,p4080-sec4.0", "fsl,sec4.0";
+			compatible = "fsl,p4080-sec-v4.0", "fsl,sec-v4.0";
 			#address-cells = <1>;
 			#size-cells = <1>;
 			reg = <0x300000 0x10000>;
@@ -432,73 +432,74 @@
 			interrupts = <92 2>;
 
 			sec_jr0: jr@1000 {
-				compatible = "fsl,p4080-sec4.0-job-ring",
-					     "fsl,sec4.0-job-ring";
+				compatible = "fsl,p4080-sec-v4.0-job-ring",
+					     "fsl,sec-v4.0-job-ring";
 				reg = <0x1000 0x1000>;
 				interrupt-parent = <&mpic>;
 				interrupts = <88 2>;
 			};
 
 			sec_jr1: jr@2000 {
-				compatible = "fsl,p4080-sec4.0-job-ring",
-					     "fsl,sec4.0-job-ring";
+				compatible = "fsl,p4080-sec-v4.0-job-ring",
+					     "fsl,sec-v4.0-job-ring";
 				reg = <0x2000 0x1000>;
 				interrupt-parent = <&mpic>;
 				interrupts = <89 2>;
 			};
 
 			sec_jr2: jr@3000 {
-				compatible = "fsl,p4080-sec4.0-job-ring",
-					     "fsl,sec4.0-job-ring";
+				compatible = "fsl,p4080-sec-v4.0-job-ring",
+					     "fsl,sec-v4.0-job-ring";
 				reg = <0x3000 0x1000>;
 				interrupt-parent = <&mpic>;
 				interrupts = <90 2>;
 			};
 
 			sec_jr3: jr@4000 {
-				compatible = "fsl,p4080-sec4.0-job-ring",
-					     "fsl,sec4.0-job-ring";
+				compatible = "fsl,p4080-sec-v4.0-job-ring",
+					     "fsl,sec-v4.0-job-ring";
 				reg = <0x4000 0x1000>;
 				interrupt-parent = <&mpic>;
 				interrupts = <91 2>;
 			};
 
 			rtic@6000 {
-				compatible = "fsl,p4080-sec4.0-rtic",
-					     "fsl,sec4.0-rtic";
+				compatible = "fsl,p4080-sec-v4.0-rtic",
+					     "fsl,sec-v4.0-rtic";
 				#address-cells = <1>;
 				#size-cells = <1>;
 				reg = <0x6000 0x100>;
 				ranges = <0x0 0x6100 0xe00>;
 
 				rtic_a: rtic-a@0 {
-					compatible = "fsl,p4080-sec4.0-rtic-memory",
-						     "fsl,sec4.0-rtic-memory";
+					compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+						     "fsl,sec-v4.0-rtic-memory";
 					reg = <0x00 0x20 0x100 0x80>;
 				};
 
 				rtic_b: rtic-b@20 {
-					compatible = "fsl,p4080-sec4.0-rtic-memory",
-						     "fsl,sec4.0-rtic-memory";
+					compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+						     "fsl,sec-v4.0-rtic-memory";
 					reg = <0x20 0x20 0x200 0x80>;
 				};
 
 				rtic_c: rtic-c@40 {
-					compatible = "fsl,p4080-sec4.0-rtic-memory",
-						     "fsl,sec4.0-rtic-memory";
+					compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+						     "fsl,sec-v4.0-rtic-memory";
 					reg = <0x40 0x20 0x300 0x80>;
 				};
 
 				rtic_d: rtic-d@60 {
-					compatible = "fsl,p4080-sec4.0-rtic-memory",
-						     "fsl,sec4.0-rtic-memory";
+					compatible = "fsl,p4080-sec-v4.0-rtic-memory",
+						     "fsl,sec-v4.0-rtic-memory";
 					reg = <0x60 0x20 0x500 0x80>;
 				};
 			};
 		};
 
 		sec_mon: sec_mon@314000 {
-			compatible = "fsl,p4080-sec4.0-mon", "fsl,sec4.0-mon";
+			compatible = "fsl,p4080-sec-v4.0-mon",
+				     "fsl,sec-v4.0-mon";
 			reg = <0x314000 0x1000>;
 			interrupt-parent = <&mpic>;
 			interrupts = <93 2>;
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index d7fe3d3..1403434 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -1020,7 +1020,7 @@ static void __exit caam_algapi_exit(void)
 	struct caam_crypto_alg *t_alg, *n;
 	int i, err;
 
-	dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
+	dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
 	if (!dev_node)
 		return;
 
@@ -1094,7 +1094,7 @@ static int __init caam_algapi_init(void)
 	struct caam_drv_private *priv;
 	int i = 0, err = 0;
 
-	dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
+	dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
 	if (!dev_node)
 		return -ENODEV;
 
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index aa22161..59aae4e 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -108,7 +108,7 @@ static int caam_probe(struct platform_device *pdev,
 	 * for all, then go probe each one.
 	 */
 	rspec = 0;
-	for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring")
+	for_each_compatible_node(np, NULL, "fsl,sec-v4.0-job-ring")
 		rspec++;
 	ctrlpriv->jrdev = kzalloc(sizeof(struct device *) * rspec, GFP_KERNEL);
 	if (ctrlpriv->jrdev == NULL) {
@@ -118,7 +118,7 @@ static int caam_probe(struct platform_device *pdev,
 
 	ring = 0;
 	ctrlpriv->total_jobrs = 0;
-	for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring") {
+	for_each_compatible_node(np, NULL, "fsl,sec-v4.0-job-ring") {
 		caam_jr_probe(pdev, np, ring);
 		ctrlpriv->total_jobrs++;
 		ring++;
@@ -236,7 +236,7 @@ static int caam_probe(struct platform_device *pdev,
 
 static struct of_device_id caam_match[] = {
 	{
-		.compatible = "fsl,sec4.0",
+		.compatible = "fsl,sec-v4.0",
 	},
 	{},
 };
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 1/1] powerpc: Add page coalescing support
From: Brian King @ 2011-03-14 21:50 UTC (permalink / raw)
  To: benh; +Cc: brking, linuxppc-dev


Adds support for page coalescing, which is a feature on IBM Power servers
which allows for coalescing identical pages between logical partitions.
Hint text pages as coalesce candidates, since they are the most likely
pages to be able to be coalesced between partitions. This patch also
exports some page coalescing statistics available from firmware via
lparcfg.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---

 arch/powerpc/include/asm/firmware.h         |    3 +-
 arch/powerpc/include/asm/hvcall.h           |   12 ++++++++
 arch/powerpc/include/asm/pSeries_reconfig.h |    6 ++++
 arch/powerpc/kernel/lparcfg.c               |   40 ++++++++++++++++++++++++++++
 arch/powerpc/kernel/prom_init.c             |    4 ++
 arch/powerpc/kernel/rtas.c                  |    2 +
 arch/powerpc/platforms/pseries/lpar.c       |    2 +
 arch/powerpc/platforms/pseries/setup.c      |   11 +++++++
 8 files changed, 78 insertions(+), 2 deletions(-)

diff -puN arch/powerpc/include/asm/hvcall.h~powerpc_coalesce arch/powerpc/include/asm/hvcall.h
--- linux-2.6/arch/powerpc/include/asm/hvcall.h~powerpc_coalesce	2011-03-14 15:45:12.000000000 -0500
+++ linux-2.6-bjking1/arch/powerpc/include/asm/hvcall.h	2011-03-14 15:45:12.000000000 -0500
@@ -102,6 +102,7 @@
 #define H_ANDCOND		(1UL<<(63-33))
 #define H_ICACHE_INVALIDATE	(1UL<<(63-40))	/* icbi, etc.  (ignored for IO pages) */
 #define H_ICACHE_SYNCHRONIZE	(1UL<<(63-41))	/* dcbst, icbi, etc (ignored for IO pages */
+#define H_COALESCE_CAND	(1UL<<(63-42))	/* page is a good candidate for coalescing */
 #define H_ZERO_PAGE		(1UL<<(63-48))	/* zero the page before mapping (ignored for IO pages) */
 #define H_COPY_PAGE		(1UL<<(63-49))
 #define H_N			(1UL<<(63-61))
@@ -234,6 +235,7 @@
 #define H_GET_MPP		0x2D4
 #define H_HOME_NODE_ASSOCIATIVITY 0x2EC
 #define H_BEST_ENERGY		0x2F4
+#define H_GET_MPP_X		0x314
 #define MAX_HCALL_OPCODE	H_BEST_ENERGY
 
 #ifndef __ASSEMBLY__
@@ -312,6 +314,16 @@ struct hvcall_mpp_data {
 
 int h_get_mpp(struct hvcall_mpp_data *);
 
+struct hvcall_mpp_x_data {
+	unsigned long coalesced_bytes;
+	unsigned long pool_coalesced_bytes;
+	unsigned long pool_purr_cycles;
+	unsigned long pool_spurr_cycles;
+	unsigned long reserved[3];
+};
+
+int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data);
+
 #ifdef CONFIG_PPC_PSERIES
 extern int CMO_PrPSP;
 extern int CMO_SecPSP;
diff -puN arch/powerpc/platforms/pseries/setup.c~powerpc_coalesce arch/powerpc/platforms/pseries/setup.c
--- linux-2.6/arch/powerpc/platforms/pseries/setup.c~powerpc_coalesce	2011-03-14 15:45:12.000000000 -0500
+++ linux-2.6-bjking1/arch/powerpc/platforms/pseries/setup.c	2011-03-14 15:45:12.000000000 -0500
@@ -392,6 +392,16 @@ static int pseries_set_xdabr(unsigned lo
 #define CMO_CHARACTERISTICS_TOKEN 44
 #define CMO_MAXLENGTH 1026
 
+void pSeries_coalesce_init(void)
+{
+	struct hvcall_mpp_x_data mpp_x_data;
+
+	if (firmware_has_feature(FW_FEATURE_CMO) && !h_get_mpp_x(&mpp_x_data))
+		powerpc_firmware_features |= FW_FEATURE_XCMO;
+	else
+		powerpc_firmware_features &= ~FW_FEATURE_XCMO;
+}
+
 /**
  * fw_cmo_feature_init - FW_FEATURE_CMO is not stored in ibm,hypertas-functions,
  * handle that here. (Stolen from parse_system_parameter_string)
@@ -461,6 +471,7 @@ void pSeries_cmo_feature_init(void)
 		pr_debug("CMO enabled, PrPSP=%d, SecPSP=%d\n", CMO_PrPSP,
 		         CMO_SecPSP);
 		powerpc_firmware_features |= FW_FEATURE_CMO;
+		pSeries_coalesce_init();
 	} else
 		pr_debug("CMO not enabled, PrPSP=%d, SecPSP=%d\n", CMO_PrPSP,
 		         CMO_SecPSP);
diff -puN arch/powerpc/kernel/prom_init.c~powerpc_coalesce arch/powerpc/kernel/prom_init.c
--- linux-2.6/arch/powerpc/kernel/prom_init.c~powerpc_coalesce	2011-03-14 15:45:12.000000000 -0500
+++ linux-2.6-bjking1/arch/powerpc/kernel/prom_init.c	2011-03-14 15:45:12.000000000 -0500
@@ -676,8 +676,10 @@ static void __init early_cmdline_parse(v
 #endif /* CONFIG_PCI_MSI */
 #ifdef CONFIG_PPC_SMLPAR
 #define OV5_CMO			0x80	/* Cooperative Memory Overcommitment */
+#define OV5_XCMO			0x40	/* Page Coalescing */
 #else
 #define OV5_CMO			0x00
+#define OV5_XCMO			0x00
 #endif
 #define OV5_TYPE1_AFFINITY	0x80	/* Type 1 NUMA affinity */
 
@@ -732,7 +734,7 @@ static unsigned char ibm_architecture_ve
 	OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY |
 	OV5_DONATE_DEDICATE_CPU | OV5_MSI,
 	0,
-	OV5_CMO,
+	OV5_CMO | OV5_XCMO,
 	OV5_TYPE1_AFFINITY,
 	0,
 	0,
diff -puN arch/powerpc/kernel/lparcfg.c~powerpc_coalesce arch/powerpc/kernel/lparcfg.c
--- linux-2.6/arch/powerpc/kernel/lparcfg.c~powerpc_coalesce	2011-03-14 15:45:12.000000000 -0500
+++ linux-2.6-bjking1/arch/powerpc/kernel/lparcfg.c	2011-03-14 15:45:12.000000000 -0500
@@ -161,6 +161,21 @@ int h_get_mpp(struct hvcall_mpp_data *mp
 }
 EXPORT_SYMBOL(h_get_mpp);
 
+int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data)
+{
+	int rc;
+	unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = { 0 };
+
+	rc = plpar_hcall9(H_GET_MPP_X, retbuf);
+
+	mpp_x_data->coalesced_bytes = retbuf[0];
+	mpp_x_data->pool_coalesced_bytes = retbuf[1];
+	mpp_x_data->pool_purr_cycles = retbuf[2];
+	mpp_x_data->pool_spurr_cycles = retbuf[3];
+
+	return rc;
+}
+
 struct hvcall_ppp_data {
 	u64	entitlement;
 	u64	unallocated_entitlement;
@@ -345,6 +360,30 @@ static void parse_mpp_data(struct seq_fi
 	seq_printf(m, "backing_memory=%ld bytes\n", mpp_data.backing_mem);
 }
 
+/**
+ * parse_mpp_x_data
+ * Parse out data returned from h_get_mpp_x
+ */
+static void parse_mpp_x_data(struct seq_file *m)
+{
+	struct hvcall_mpp_x_data mpp_x_data;
+
+	if (!firmware_has_feature(FW_FEATURE_XCMO))
+		return;
+	if (h_get_mpp_x(&mpp_x_data))
+		return;
+
+	seq_printf(m, "coalesced_bytes=%ld\n", mpp_x_data.coalesced_bytes);
+
+	if (mpp_x_data.pool_coalesced_bytes)
+		seq_printf(m, "pool_coalesced_bytes=%ld\n",
+			   mpp_x_data.pool_coalesced_bytes);
+	if (mpp_x_data.pool_purr_cycles)
+		seq_printf(m, "coalesce_pool_purr=%ld\n", mpp_x_data.pool_purr_cycles);
+	if (mpp_x_data.pool_spurr_cycles)
+		seq_printf(m, "coalesce_pool_spurr=%ld\n", mpp_x_data.pool_spurr_cycles);
+}
+
 #define SPLPAR_CHARACTERISTICS_TOKEN 20
 #define SPLPAR_MAXLENGTH 1026*(sizeof(char))
 
@@ -520,6 +559,7 @@ static int pseries_lparcfg_data(struct s
 		parse_system_parameter_string(m);
 		parse_ppp_data(m);
 		parse_mpp_data(m);
+		parse_mpp_x_data(m);
 		pseries_cmo_data(m);
 		splpar_dispatch_data(m);
 
diff -puN arch/powerpc/include/asm/firmware.h~powerpc_coalesce arch/powerpc/include/asm/firmware.h
--- linux-2.6/arch/powerpc/include/asm/firmware.h~powerpc_coalesce	2011-03-14 15:45:12.000000000 -0500
+++ linux-2.6-bjking1/arch/powerpc/include/asm/firmware.h	2011-03-14 15:45:12.000000000 -0500
@@ -47,6 +47,7 @@
 #define FW_FEATURE_BEAT		ASM_CONST(0x0000000001000000)
 #define FW_FEATURE_CMO		ASM_CONST(0x0000000002000000)
 #define FW_FEATURE_VPHN		ASM_CONST(0x0000000004000000)
+#define FW_FEATURE_XCMO		ASM_CONST(0x0000000008000000)
 
 #ifndef __ASSEMBLY__
 
@@ -60,7 +61,7 @@ enum {
 		FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
 		FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR |
 		FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
-		FW_FEATURE_CMO | FW_FEATURE_VPHN,
+		FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO,
 	FW_FEATURE_PSERIES_ALWAYS = 0,
 	FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
 	FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
diff -puN arch/powerpc/platforms/pseries/lpar.c~powerpc_coalesce arch/powerpc/platforms/pseries/lpar.c
--- linux-2.6/arch/powerpc/platforms/pseries/lpar.c~powerpc_coalesce	2011-03-14 15:45:12.000000000 -0500
+++ linux-2.6-bjking1/arch/powerpc/platforms/pseries/lpar.c	2011-03-14 15:45:12.000000000 -0500
@@ -329,6 +329,8 @@ static long pSeries_lpar_hpte_insert(uns
 	/* Make pHyp happy */
 	if ((rflags & _PAGE_NO_CACHE) & !(rflags & _PAGE_WRITETHRU))
 		hpte_r &= ~_PAGE_COHERENT;
+	if (firmware_has_feature(FW_FEATURE_XCMO) && !(hpte_r & HPTE_R_N))
+		flags |= H_COALESCE_CAND;
 
 	lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot);
 	if (unlikely(lpar_rc == H_PTEG_FULL)) {
diff -puN arch/powerpc/include/asm/pSeries_reconfig.h~powerpc_coalesce arch/powerpc/include/asm/pSeries_reconfig.h
--- linux-2.6/arch/powerpc/include/asm/pSeries_reconfig.h~powerpc_coalesce	2011-03-14 15:45:12.000000000 -0500
+++ linux-2.6-bjking1/arch/powerpc/include/asm/pSeries_reconfig.h	2011-03-14 15:45:12.000000000 -0500
@@ -14,6 +14,12 @@
 #define PSERIES_DRCONF_MEM_ADD		0x0003
 #define PSERIES_DRCONF_MEM_REMOVE	0x0004
 
+#ifdef CONFIG_PPC_SMLPAR
+extern void pSeries_coalesce_init(void);
+#else
+static inline void pSeries_coalesce_init(void) { }
+#endif
+
 #ifdef CONFIG_PPC_PSERIES
 extern int pSeries_reconfig_notifier_register(struct notifier_block *);
 extern void pSeries_reconfig_notifier_unregister(struct notifier_block *);
diff -puN arch/powerpc/kernel/rtas.c~powerpc_coalesce arch/powerpc/kernel/rtas.c
--- linux-2.6/arch/powerpc/kernel/rtas.c~powerpc_coalesce	2011-03-14 15:45:12.000000000 -0500
+++ linux-2.6-bjking1/arch/powerpc/kernel/rtas.c	2011-03-14 15:45:12.000000000 -0500
@@ -42,6 +42,7 @@
 #include <asm/time.h>
 #include <asm/mmu.h>
 #include <asm/topology.h>
+#include <asm/pSeries_reconfig.h>
 
 struct rtas_t rtas = {
 	.lock = __ARCH_SPIN_LOCK_UNLOCKED
@@ -731,6 +732,7 @@ static int __rtas_suspend_last_cpu(struc
 
 	atomic_set(&data->error, rc);
 	start_topology_update();
+	pSeries_coalesce_init();
 
 	if (wake_when_done) {
 		atomic_set(&data->done, 1);
_

^ permalink raw reply

* Re: linux-next: build failure after merge of the final tree (powerpc tree related)
From: Lennert Buytenhek @ 2011-03-14 21:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Stephen Rothwell, linux-kernel, linux-next, Paul Mackerras,
	Thomas Gleixner, linuxppc-dev
In-Reply-To: <1300135074.22236.788.camel@pasglop>

On Tue, Mar 15, 2011 at 07:37:54AM +1100, Benjamin Herrenschmidt wrote:

> > Hi all,
> > 
> > After merging the final tree, today's linux-next build (powerpc
> > allyesconfig) failed like this:
> > 
> > drivers/gpio/langwell_gpio.c: In function 'lnw_irq_handler':
> > drivers/gpio/langwell_gpio.c:210: error: 'struct irq_desc' has no member named 'chip'
> > drivers/gpio/langwell_gpio.c:211: error: 'struct irq_desc' has no member named 'chip'
> > 
> > Caused by commit 17b9f9e2653a ("powerpc: Enable
> > GENERIC_HARDIRQS_NO_DEPRECATED") enabling
> > CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED for powerpc without previously
> > fixing up the above driver.
> > 
> > I have reverted that commit for today.
> 
> Except that the above driver has nothing to do with powerpc, it's some
> Intel Moorestown stuff...

I sent this this morning:

	http://marc.info/?l=linux-kernel&m=130009963219374&w=2

^ permalink raw reply

* Re: linux-next: build failure after merge of the final tree (powerpc tree related)
From: Thomas Gleixner @ 2011-03-14 21:17 UTC (permalink / raw)
  To: David Miller
  Cc: Stephen Rothwell, Feng Tang, buytenh, LKML, linux-next,
	Paul Mackerras, Ingo Molnar, linuxppc-dev, Andrew Morton,
	Alan Cox
In-Reply-To: <20110314.135116.112600339.davem@davemloft.net>

On Mon, 14 Mar 2011, David Miller wrote:

> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Date: Tue, 15 Mar 2011 07:37:54 +1100
> 
> > On Mon, 2011-03-14 at 20:38 +1100, Stephen Rothwell wrote:
> >> Hi all,
> >> 
> >> After merging the final tree, today's linux-next build (powerpc
> >> allyesconfig) failed like this:
> >> 
> >> drivers/gpio/langwell_gpio.c: In function 'lnw_irq_handler':
> >> drivers/gpio/langwell_gpio.c:210: error: 'struct irq_desc' has no member named 'chip'
> >> drivers/gpio/langwell_gpio.c:211: error: 'struct irq_desc' has no member named 'chip'
> >> 
> >> Caused by commit 17b9f9e2653a ("powerpc: Enable
> >> GENERIC_HARDIRQS_NO_DEPRECATED") enabling
> >> CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED for powerpc without previously
> >> fixing up the above driver.
> >> 
> >> I have reverted that commit for today.
> > 
> > Except that the above driver has nothing to do with powerpc, it's some
> > Intel Moorestown stuff...
> > 
> > It should be fixed regardless I suppose, CC'ing Thomas.
> 
> I've had to make fixes to this driver in sparc64 allmodconfig builds
> too :-)

Sigh. Yes, this wants to depend on x86 in the first place.

But this is the second instance of blindly and mindlessly changing eoi
to irq_eoi w/o looking at the reason for this change.

Those patches should have been rejected based on their changelog in
the first place:

    Latest kernel has many changes in IRQ subsystem and its interfaces, like
    adding "irq_eoi" for struct irq_chip, this patch is a follow up change
    for that.

When noone beats me to fix that mess, I'll do it tomorrow morning.

Thanks,

	tglx

^ permalink raw reply

* Re: [PATCH] cxgb4: use pgprot_writecombine() on powerpc
From: Steve Wise @ 2011-03-14 20:51 UTC (permalink / raw)
  To: Nishanth Aravamudan; +Cc: linuxppc-dev, Anton Blanchard
In-Reply-To: <1300134971-16752-1-git-send-email-nacc@us.ibm.com>

On 03/14/2011 03:36 PM, Nishanth Aravamudan wrote:
> Commit fe3cc0d99de6a9bf99b6c279a8afb5833888c1f7 ("powerpc: Add
> pgprot_writecombine") in benh's tree exposes the pgprot_writecombine()
> API to drivers on powerpc. cxgb4 has an open-coded version of the same,
> so use the common API now that it's available.
>
> Signed-off-by: Nishanth Aravamudan<nacc@us.ibm.com>
> Cc: Steve Wise<swise@opengridcomputing.com>
> Cc: Anton Blanchard<anton@samba.org>
>
> ---
>
> Given that this depends on a patch in Ben's tree, should this go in via
> the powerpc tree? Presuming Steve acks it, of course.
>
>   drivers/infiniband/hw/cxgb4/t4.h |    5 +----
>   1 files changed, 1 insertions(+), 4 deletions(-)
>

Acked-by: Steve Wise <swise@opengridcomputing.com>

I suppose it should go into the same tree with the commit that adds this function.


Steve.

^ permalink raw reply

* Re: linux-next: build failure after merge of the final tree (powerpc tree related)
From: David Miller @ 2011-03-14 20:51 UTC (permalink / raw)
  To: benh; +Cc: sfr, buytenh, linux-kernel, linux-next, paulus, tglx,
	linuxppc-dev
In-Reply-To: <1300135074.22236.788.camel@pasglop>

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Tue, 15 Mar 2011 07:37:54 +1100

> On Mon, 2011-03-14 at 20:38 +1100, Stephen Rothwell wrote:
>> Hi all,
>> 
>> After merging the final tree, today's linux-next build (powerpc
>> allyesconfig) failed like this:
>> 
>> drivers/gpio/langwell_gpio.c: In function 'lnw_irq_handler':
>> drivers/gpio/langwell_gpio.c:210: error: 'struct irq_desc' has no member named 'chip'
>> drivers/gpio/langwell_gpio.c:211: error: 'struct irq_desc' has no member named 'chip'
>> 
>> Caused by commit 17b9f9e2653a ("powerpc: Enable
>> GENERIC_HARDIRQS_NO_DEPRECATED") enabling
>> CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED for powerpc without previously
>> fixing up the above driver.
>> 
>> I have reverted that commit for today.
> 
> Except that the above driver has nothing to do with powerpc, it's some
> Intel Moorestown stuff...
> 
> It should be fixed regardless I suppose, CC'ing Thomas.

I've had to make fixes to this driver in sparc64 allmodconfig builds
too :-)

^ permalink raw reply

* Re: linux-next: build failure after merge of the final tree (powerpc tree related)
From: Benjamin Herrenschmidt @ 2011-03-14 20:37 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Lennert Buytenhek, linux-kernel, linux-next, Paul Mackerras,
	Thomas Gleixner, linuxppc-dev
In-Reply-To: <20110314203827.4b61818e.sfr@canb.auug.org.au>

On Mon, 2011-03-14 at 20:38 +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> drivers/gpio/langwell_gpio.c: In function 'lnw_irq_handler':
> drivers/gpio/langwell_gpio.c:210: error: 'struct irq_desc' has no member named 'chip'
> drivers/gpio/langwell_gpio.c:211: error: 'struct irq_desc' has no member named 'chip'
> 
> Caused by commit 17b9f9e2653a ("powerpc: Enable
> GENERIC_HARDIRQS_NO_DEPRECATED") enabling
> CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED for powerpc without previously
> fixing up the above driver.
> 
> I have reverted that commit for today.

Except that the above driver has nothing to do with powerpc, it's some
Intel Moorestown stuff...

It should be fixed regardless I suppose, CC'ing Thomas.

Cheers,
Ben.

^ permalink raw reply

* [PATCH] cxgb4: use pgprot_writecombine() on powerpc
From: Nishanth Aravamudan @ 2011-03-14 20:36 UTC (permalink / raw)
  To: benh; +Cc: Steve Wise, linuxppc-dev, Anton Blanchard

Commit fe3cc0d99de6a9bf99b6c279a8afb5833888c1f7 ("powerpc: Add
pgprot_writecombine") in benh's tree exposes the pgprot_writecombine()
API to drivers on powerpc. cxgb4 has an open-coded version of the same,
so use the common API now that it's available.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: Steve Wise <swise@opengridcomputing.com>
Cc: Anton Blanchard <anton@samba.org>

---

Given that this depends on a patch in Ben's tree, should this go in via
the powerpc tree? Presuming Steve acks it, of course.

 drivers/infiniband/hw/cxgb4/t4.h |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/t4.h b/drivers/infiniband/hw/cxgb4/t4.h
index 7000442..2fce083 100644
--- a/drivers/infiniband/hw/cxgb4/t4.h
+++ b/drivers/infiniband/hw/cxgb4/t4.h
@@ -269,11 +269,8 @@ struct t4_swsqe {
 
 static inline pgprot_t t4_pgprot_wc(pgprot_t prot)
 {
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(CONFIG_PPC64)
 	return pgprot_writecombine(prot);
-#elif defined(CONFIG_PPC64)
-	return __pgprot((pgprot_val(prot) | _PAGE_NO_CACHE) &
-			~(pgprot_t)_PAGE_GUARDED);
 #else
 	return pgprot_noncached(prot);
 #endif
-- 
1.7.1

^ permalink raw reply related

* [PATCH v3 3/3] powerpc: Add IO event interrupt support
From: Tseng-Hui (Frank) Lin @ 2011-03-14 20:29 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tsenglin


This patch adds support for handling IO Event interrupts which come
through at the /event-sources/ibm,io-events device tree node.

The interrupts come through ibm,io-events device tree node are generated
by the firmware to report IO events. The firmware uses the same interrupt
to report multiple types of events for multiple devices. Each device may
have its own event handler. This patch implements a plateform interrupt
handler that is triggered by the IO event interrupts come through
ibm,io-events device tree node, pull in the IO events from RTAS and call
device event handlers registered in the notifier list.

Device event handlers are expected to use atomic_notifier_chain_register()
and atomic_notifier_chain_unregister() to register/unregister their
event handler in pseries_ioei_notifier_list list with IO event interrupt.
Device event handlers are responsible to identify if the event belongs
to the device event handler. The device event handle should return NOTIFY_OK
after the event is handled if the event belongs to the device event handler,
or NOTIFY_DONE otherwise.

Change log from V2:
- Re-implement interrupt call list with atomic notifier.

platforms/pseries/io_event_irq.c:
- Move IO Event data copy to ioei_interrupt(). Rename ioei_get_event()
  to ioei_find_event().
- Remove unused ioei_call_handlers(), pseries_ioei_register_handler(),
  pseries_ioei_unregister_handler() as the functions are replaced by
  notifier.

Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Signed-off-by: Tseng-Hui (Frank) Lin <tsenglin@us.ibm.com>
---
 arch/powerpc/include/asm/io_event_irq.h       |   54 +++++++
 arch/powerpc/platforms/pseries/Kconfig        |   19 ++
 arch/powerpc/platforms/pseries/Makefile       |    1 +
 arch/powerpc/platforms/pseries/io_event_irq.c |  207 +++++++++++++++++++++++++
 4 files changed, 281 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/io_event_irq.h b/arch/powerpc/include/asm/io_event_irq.h
new file mode 100644
index 0000000..cbaef02
--- /dev/null
+++ b/arch/powerpc/include/asm/io_event_irq.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2010, 2011 Mark Nelson and Tseng-Hui (Frank) Lin, IBM Corporation
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _ASM_POWERPC_IO_EVENT_IRQ_H
+#define _ASM_POWERPC_IO_EVENT_IRQ_H
+
+#include <linux/types.h>
+#include <linux/notifier.h>
+
+#define PSERIES_IOEI_RPC_MAX_LEN 216
+
+#define PSERIES_IOEI_TYPE_ERR_DETECTED		0x01
+#define PSERIES_IOEI_TYPE_ERR_RECOVERED		0x02
+#define PSERIES_IOEI_TYPE_EVENT			0x03
+#define PSERIES_IOEI_TYPE_RPC_PASS_THRU		0x04
+
+#define PSERIES_IOEI_SUBTYPE_NOT_APP		0x00
+#define PSERIES_IOEI_SUBTYPE_REBALANCE_REQ	0x01
+#define PSERIES_IOEI_SUBTYPE_NODE_ONLINE	0x03
+#define PSERIES_IOEI_SUBTYPE_NODE_OFFLINE	0x04
+#define PSERIES_IOEI_SUBTYPE_DUMP_SIZE_CHANGE	0x05
+#define PSERIES_IOEI_SUBTYPE_TORRENT_IRV_UPDATE	0x06
+#define PSERIES_IOEI_SUBTYPE_TORRENT_HFI_CFGED	0x07
+
+#define PSERIES_IOEI_SCOPE_NOT_APP		0x00
+#define PSERIES_IOEI_SCOPE_RIO_HUB		0x36
+#define PSERIES_IOEI_SCOPE_RIO_BRIDGE		0x37
+#define PSERIES_IOEI_SCOPE_PHB			0x38
+#define PSERIES_IOEI_SCOPE_EADS_GLOBAL		0x39
+#define PSERIES_IOEI_SCOPE_EADS_SLOT		0x3A
+#define PSERIES_IOEI_SCOPE_TORRENT_HUB		0x3B
+#define PSERIES_IOEI_SCOPE_SERVICE_PROC		0x51
+
+/* Platform Event Log Format, Version 6, data portition of IO event section */
+struct pseries_io_event_sect_data {
+	uint8_t event_type;		/* 0x00 IO-Event Type		*/
+	uint8_t rpc_data_len;		/* 0x01 RPC data length		*/
+	uint8_t scope;			/* 0x02 Error/Event Scope	*/
+	uint8_t event_subtype;		/* 0x03 I/O-Event Sub-Type	*/
+	uint32_t drc_index;		/* 0x04 DRC Index		*/
+	uint8_t rpc_data[PSERIES_IOEI_RPC_MAX_LEN];
+					/* 0x08 RPC Data (0-216 bytes,	*/
+					/* padded to 4 bytes alignment)	*/
+};
+
+extern struct atomic_notifier_head pseries_ioei_notifier_list;
+
+#endif /* _ASM_POWERPC_IO_EVENT_IRQ_H */
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 5b3da4b..d44af70 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -52,6 +52,25 @@ 	bool
	depends on PPC_PSERIES && RTAS_ERROR_LOGGING
	default n

+config IO_EVENT_IRQ
+	bool "IO Event Interrupt support"
+	depends on PPC_PSERIES
+	select PSERIES_EVENT_LOG
+	default y
+	help
+	  Select this option, if you want to enable support for IO Event
+	  interrupts. IO event interrupt is a mechanism provided by RTAS
+	  to return information about hardware error and non-error events
+	  which may need OS attention. RTAS returns events for multiple
+	  event types and scopes. Device drivers can register their handlers
+	  to receive events.
+
+	  This option will only enable the IO event platform code. You
+	  will still need to enable or compile the actual drivers
+	  that use this infrastruture to handle IO event interrupts.
+
+	  Say Y if you are unsure.
+
 config LPARCFG
 	bool "LPAR Configuration Data"
 	depends on PPC_PSERIES || PPC_ISERIES
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index fc52378..5070a45 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_PHYP_DUMP)		+= phyp_dump.o
 obj-$(CONFIG_CMM)		+= cmm.o
 obj-$(CONFIG_DTL)		+= dtl.o
 obj-$(CONFIG_PSERIES_EVENT_LOG)	+= pseries_event_log.o
+obj-$(CONFIG_IO_EVENT_IRQ)	+= io_event_irq.o
 
 ifeq ($(CONFIG_PPC_PSERIES),y)
 obj-$(CONFIG_SUSPEND)		+= suspend.o
diff --git a/arch/powerpc/platforms/pseries/io_event_irq.c b/arch/powerpc/platforms/pseries/io_event_irq.c
new file mode 100644
index 0000000..7d963b5
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/io_event_irq.c
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2010 2011 Mark Nelson and Tseng-Hui (Frank) Lin, IBM Corporation
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/errno.h>
+#include <linux/spinlock.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/of.h>
+#include <linux/list.h>
+#include <linux/notifier.h>
+
+#include <asm/machdep.h>
+#include <asm/rtas.h>
+#include <asm/irq.h>
+#include <asm/io_event_irq.h>
+
+#include "pseries.h"
+#include "pseries_event_log.h"
+
+/*
+ * IO event interrupt is a mechanism provided by RTAS to return
+ * information about hardware error and non-error events. Device
+ * drivers can register their event handlers to receive events.
+ * Device drivers are expected to use atomic_notifier_chain_register()
+ * and atomic_notifier_chain_unregister() to register and unregister
+ * their event handlers. Since multiple IO event types and scopes
+ * share an IO event interrupt, the event handlers are called one
+ * by one until the IO event is claimed by one of the handlers.
+ * The event handlers are expected to return NOTIFY_OK if the
+ * event is handled by the event handler or NOTIFY_DONE if the
+ * event does not belong to the handler.
+ *
+ * Usage:
+ *
+ * Notifier function:
+ * #include <asm/io_event_irq.h>
+ * int event_handler(struct notifier_block *nb, unsigned long val, void *data) {
+ * 	p = (struct pseries_io_event_sect_data *) data;
+ * 	if (! is_my_event(p->scope, p->event_type)) return NOTIFY_DONE;
+ * 		:
+ * 		:
+ * 	return NOTIFY_OK;
+ * }
+ * struct notifier_block event_nb = {
+ * 	.notifier_call = event_handler;
+ * }
+ *
+ * Registration:
+ * atomic_notifier_chain_register(&pseries_ioei_notifier_list, &event_nb);
+ *
+ * Unregistration:
+ * atomic_notifier_chain_unregister(&pseries_ioei_notifier_list, &event_nb);
+ */
+
+ATOMIC_NOTIFIER_HEAD(pseries_ioei_notifier_list);
+EXPORT_SYMBOL_GPL(pseries_ioei_notifier_list);
+
+static int ioei_supported = 0;
+
+static int ioei_check_exception_token;
+
+/*
+ * Find the data portion of an IO Event section from event log.
+ * Return:
+ * 	pointer to a valid IO event section data. NULL if not found.
+ */
+static struct pseries_io_event_sect_data *
+		ioei_find_event(struct rtas_error_log *rtas_elog)
+{
+	struct pseries_io_event_sect_data *event_p;
+
+	/* We should only ever get called for io-event interrupts, but if
+	 * we do get called for another type then something went wrong so
+	 * make some noise about it.
+	 * RTAS_TYPE_IO only exists in extended event log version 6 or later.
+	 * No need to check event log version.
+	 */
+	if (unlikely(rtas_elog->type != RTAS_TYPE_IO)) {
+		pr_warning("io_event_irq: We got called with an event type "
+			   "of %d rather than %d!\n",
+			   rtas_elog->type, RTAS_TYPE_IO);
+		WARN_ON(1);
+		return NULL;
+	}
+
+	event_p = pseries_elog_find_sect_data(
+			(struct rtas_ext_event_log_v6 *) &rtas_elog->buffer,
+			rtas_elog->extended_log_length,
+			PSERIES_ELOG_SECT_ID_IO_EVENT);
+	if (unlikely(!event_p)) {
+		pr_warning("io_event_irq: RTAS extended event log does not "
+			   "contain an IO Event section. Could be a bug in "
+			   "system firmware!\n");
+		WARN_ON(1);
+		return NULL;
+	}
+	return event_p;
+}
+
+/*
+ * PAPR:
+ * - check-exception returns the first found error or event and clear that
+ *   error or event so it is reported once.
+ * - Each interrupt returns one event. If a plateform chooses to report
+ *   multiple events through a single interrupt, it must ensure that the
+ *   interrupt remains asserted until check-exception has been used to
+ *   process all out-standing events for that interrupt.
+ *
+ * Implementation notes:
+ * - Events must be processed in the order they are returned. Hence,
+ *   sequential in nature.
+ * - The owner of an event is determined by combinations of scope,
+ *   event type, and sub-type. There is no easy way to pre-sort clients
+ *   by scope or event type alone. For example, Torrent ISR route change
+ *   event is reported with scope 0x00 (Not Applicatable) rather than
+ *   0x3B (Torrent-hub). It is better to let the clients to identify
+ *   who owns the the event.
+ */
+
+static irqreturn_t ioei_interrupt(int irq, void *dev_id)
+{
+	struct pseries_io_event_sect_data *ioei_buf, *event_p;
+	int rtas_status, notifier_status;
+
+	ioei_buf = kmalloc(sizeof(struct pseries_io_event_sect_data),
+			     GFP_KERNEL);
+	/* Do not check kmalloc() return code here. We need to call	*/
+	/* rtas_call() to release interrupt even if kmalloc() failed.	*/
+	do {
+		spin_lock(&rtas_data_buf_lock);
+		rtas_status = rtas_call(ioei_check_exception_token, 6, 1, NULL,
+					RTAS_VECTOR_EXTERNAL_INTERRUPT,
+					virq_to_hw(irq),
+					RTAS_IO_EVENTS, 1 /* Time Critical */,
+					__pa(&rtas_data_buf),
+					RTAS_DATA_BUF_SIZE);
+		if (rtas_status == 0)
+			event_p = ioei_find_event((struct rtas_error_log *)
+						  &rtas_data_buf);
+		else
+			event_p = NULL;
+		if (event_p) {
+			if (ioei_buf)
+				memcpy(ioei_buf, event_p,
+				       pseries_elog_sect_data_len(event_p));
+			else
+				pr_warning("io_event_irq: No memory to copy "
+					   "IO event. Event type=%d, scope=%d. "
+					   "Interrupt lost!\n",
+					   event_p->event_type, event_p->scope);
+		}
+		spin_unlock(&rtas_data_buf_lock);
+		if (event_p) {
+			notifier_status = atomic_notifier_call_chain(
+						&pseries_ioei_notifier_list,
+						0, ioei_buf);
+			if (notifier_status == NOTIFY_DONE)
+				pr_warning("io_event_irq: No one claims "
+					   "interrupt for IO event type=%d, "
+					   "scope=%d. Interrupt lost!\n",
+					   ioei_buf->event_type,
+					   ioei_buf->scope);
+		}
+	} while (rtas_status == 0);
+
+	if (ioei_buf)
+		kfree(ioei_buf);
+	return IRQ_HANDLED;
+}
+
+static int __init pseries_ioei_init_irq(void)
+{
+	struct device_node *np;
+
+	ioei_supported = 0;
+	ioei_check_exception_token = rtas_token("check-exception");
+	if (ioei_check_exception_token == RTAS_UNKNOWN_SERVICE) {
+		pr_warning("io_event_irq: No check-exception on system! "
+			   "IO Event interrupt disabled.\n");
+		return -ENODEV;
+	}
+
+	np = of_find_node_by_path("/event-sources/ibm,io-events");
+	if (np) {
+		request_event_sources_irqs(np, ioei_interrupt, "IO_EVENT");
+		of_node_put(np);
+	} else {
+		pr_warning("io_event_irq: No ibm,io-events on system! "
+			   "IO Event interrupt disabled.\n");
+		return -ENODEV;
+	}
+
+	ioei_supported = 1;
+
+	return 0;
+}
+
+machine_device_initcall(pseries, pseries_ioei_init_irq);
+

^ permalink raw reply related

* [PATCH v3 2/3] powerpc: Add IO event interrupt support
From: Tseng-Hui (Frank) Lin @ 2011-03-14 20:29 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tsenglin


This patch adds IBM specific v6 extended log definition and utilities.

Change log from V2:
- Change the log name from error log to event log.
- Change function name from pseries_elog_find_section() to
  pseries_elog_find_sect_data().

Signed-off-by: Tseng-Hui (Frank) Lin <tsenglin@us.ibm.com>
---
 arch/powerpc/platforms/pseries/Kconfig             |    5 ++
 arch/powerpc/platforms/pseries/Makefile            |    1 +
 arch/powerpc/platforms/pseries/pseries_event_log.c |   61 ++++++++++++++++++++
 arch/powerpc/platforms/pseries/pseries_event_log.h |   50 ++++++++++++++++
 4 files changed, 117 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 5b3da4b..98e5e39 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -47,6 +47,11 @@ config SCANLOG
 	tristate "Scanlog dump interface"
 	depends on RTAS_PROC && PPC_PSERIES
 
+config PSERIES_EVENT_LOG
+	bool
+	depends on PPC_PSERIES && RTAS_ERROR_LOGGING
+	default n
+
 config LPARCFG
 	bool "LPAR Configuration Data"
 	depends on PPC_PSERIES || PPC_ISERIES
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index fc52378..07bbf75 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_HCALL_STATS)	+= hvCall_inst.o
 obj-$(CONFIG_PHYP_DUMP)		+= phyp_dump.o
 obj-$(CONFIG_CMM)		+= cmm.o
 obj-$(CONFIG_DTL)		+= dtl.o
+obj-$(CONFIG_PSERIES_EVENT_LOG)	+= pseries_event_log.o
 
 ifeq ($(CONFIG_PPC_PSERIES),y)
 obj-$(CONFIG_SUSPEND)		+= suspend.o
diff --git a/arch/powerpc/platforms/pseries/pseries_event_log.c b/arch/powerpc/platforms/pseries/pseries_event_log.c
new file mode 100644
index 0000000..36ad8a1
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/pseries_event_log.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2010, 2011 Tseng-Hui (Frank) Lin, IBM Corporation
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+/*
+ * IBM pSerie platform event log specific functions.
+ * All data in this file is in big endian.
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+#include <asm/rtas.h>
+
+#include "pseries_event_log.h"
+
+/*
+ * Find the size of the data portation of a platform event log section.
+ */
+size_t pseries_elog_sect_data_len(void *sect_data_p)
+{
+	struct pseries_elog_section *p;
+
+	p = container_of(sect_data_p, struct pseries_elog_section, sect_data);
+	return(p->length - offsetof(struct pseries_elog_section, sect_data));
+}
+
+/*
+ * Find data portion of a specific section in RTAS extended event log.
+ * Return:
+ *	pointer to the section data of the specified section
+ *	NULL if not found
+ */
+void *pseries_elog_find_sect_data(struct rtas_ext_event_log_v6 *v6ext,
+				  size_t v6ext_len, uint16_t sect_id)
+{
+	struct pseries_elog_section *sect_p;
+	uint8_t *p, *log_end;
+
+	if ((v6ext_len < sizeof(struct rtas_ext_event_log_v6)) ||
+	    (v6ext->log_format != RTAS_V6EXT_LOG_FORMAT_EVENT_LOG) ||
+	    (v6ext->company_id != RTAS_V6EXT_COMPANY_ID_IBM))
+		return NULL;
+
+	log_end = (uint8_t *) v6ext + v6ext_len;
+	p = (uint8_t *) v6ext->vendor_log;
+	while (p < log_end) {
+		sect_p = (struct pseries_elog_section *) p;
+		if (sect_p->id == sect_id)
+			return sect_p->sect_data;
+		p += sect_p->length;
+	}
+
+	return NULL;
+}
+
diff --git a/arch/powerpc/platforms/pseries/pseries_event_log.h b/arch/powerpc/platforms/pseries/pseries_event_log.h
new file mode 100644
index 0000000..879f2ed
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/pseries_event_log.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2010, 2011 Tseng-Hui (Frank) Lin, IBM Corporation
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _PSERIES_PSERIES_EVENT_LOG_H
+#define _PSERIES_PSERIES_EVENT_LOG_H
+
+#include <linux/types.h>
+
+#include <asm/rtas.h>
+
+/* Two bytes ASCII section IDs */
+#define PSERIES_ELOG_SECT_ID_PRIV_HDR		(('P' << 8) | 'H')
+#define PSERIES_ELOG_SECT_ID_USER_HDR		(('U' << 8) | 'H')
+#define PSERIES_ELOG_SECT_ID_PRIMARY_SRC	(('P' << 8) | 'S')
+#define PSERIES_ELOG_SECT_ID_EXTENDED_UH	(('E' << 8) | 'H')
+#define PSERIES_ELOG_SECT_ID_FAILING_MTMS	(('M' << 8) | 'T')
+#define PSERIES_ELOG_SECT_ID_SECONDARY_SRC	(('S' << 8) | 'S')
+#define PSERIES_ELOG_SECT_ID_DUMP_LOCATOR	(('D' << 8) | 'H')
+#define PSERIES_ELOG_SECT_ID_FW_ERROR		(('S' << 8) | 'W')
+#define PSERIES_ELOG_SECT_ID_IMPACT_PART_ID	(('L' << 8) | 'P')
+#define PSERIES_ELOG_SECT_ID_LOGIC_RESOURCE_ID	(('L' << 8) | 'R')
+#define PSERIES_ELOG_SECT_ID_HMC_ID		(('H' << 8) | 'M')
+#define PSERIES_ELOG_SECT_ID_EPOW		(('E' << 8) | 'P')
+#define PSERIES_ELOG_SECT_ID_IO_EVENT		(('I' << 8) | 'E')
+#define PSERIES_ELOG_SECT_ID_MANUFACT_INFO	(('M' << 8) | 'I')
+#define PSERIES_ELOG_SECT_ID_CALL_HOME		(('C' << 8) | 'H')
+#define PSERIES_ELOG_SECT_ID_USER_DEF		(('U' << 8) | 'D')
+
+/* Vendor specific Platform Event Log Format, Version 6, section header */
+
+struct pseries_elog_section {
+	uint16_t id;			/* 0x00 2-byte ASCII section ID	*/
+	uint16_t length;		/* 0x02 Section length in bytes	*/
+	uint8_t version;		/* 0x04 Section version		*/
+	uint8_t subtype;		/* 0x05 Section subtype		*/
+	uint16_t creator_component;	/* 0x06 Creator component ID	*/
+	uint8_t sect_data[1];		/* 0x08 Start of section data	*/
+};
+
+size_t pseries_elog_sect_data_len(void *sect_data_p);
+void *pseries_elog_find_sect_data(struct rtas_ext_event_log_v6 *v6ext,
+				  size_t v6ext_len, uint16_t sect_id);
+
+#endif /* _PSERIES_PSERIES_EVENT_LOG_H */

^ permalink raw reply related

* [PATCH v3 1/3] powerpc: Add IO event interrupt support
From: Tseng-Hui (Frank) Lin @ 2011-03-14 20:29 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tsenglin


This patch adds definitions of non-IBM specific v6 extended log definitions to rtas.h.

Change log from V2:
- rename RTAS general extended event log version 6 structure from
  rtas_error_log_v6ext to rtas_ext_event_log_v6.

Signed-off-by: Tseng-Hui (Frank) Lin <tsenglin@us.ibm.com>
---
 arch/powerpc/include/asm/rtas.h |   45 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 9a1193e..58625d1 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -158,7 +158,50 @@ struct rtas_error_log {
 	unsigned long target:4;			/* Target of failed operation */
 	unsigned long type:8;			/* General event or error*/
 	unsigned long extended_log_length:32;	/* length in bytes */
-	unsigned char buffer[1];
+	unsigned char buffer[1];		/* Start of extended log */
+						/* Variable length.      */
+};
+
+#define RTAS_V6EXT_LOG_FORMAT_EVENT_LOG	14
+
+#define RTAS_V6EXT_COMPANY_ID_IBM	(('I' << 24) | ('B' << 16) | ('M' << 8))
+
+/* RTAS general extended event log, Version 6. The extended log starts
+ * from "buffer" field of struct rtas_error_log defined above.
+ */
+struct rtas_ext_event_log_v6 {
+	/* Byte 0 */
+	uint32_t log_valid:1;		/* 1:Log valid */
+	uint32_t unrecoverable_error:1;	/* 1:Unrecoverable error */
+	uint32_t recoverable_error:1;	/* 1:recoverable (correctable	*/
+					/*   or successfully retried)	*/
+	uint32_t degraded_operation:1;	/* 1:Unrecoverable err, bypassed*/
+					/*   - degraded operation (e.g.	*/
+					/*   CPU or mem taken off-line)	*/
+	uint32_t predictive_error:1;
+	uint32_t new_log:1;		/* 1:"New" log (Always 1 for	*/
+					/*   data returned from RTAS	*/
+	uint32_t big_endian:1;		/* 1: Big endian */
+	uint32_t :1;			/* reserved */
+	/* Byte 1 */
+	uint32_t :8;			/* reserved */
+	/* Byte 2 */
+	uint32_t powerpc_format:1;	/* Set to 1 (indicating log is	*/
+					/* in PowerPC format		*/
+	uint32_t :3;			/* reserved */
+	uint32_t log_format:4;		/* Log format indicator. Define	*/
+					/* format used for byte 12-2047	*/
+	/* Byte 3 */
+	uint32_t :8;			/* reserved */
+	/* Byte 4-11 */
+	uint8_t reserved[8];		/* reserved */
+	/* Byte 12-15 */
+	uint32_t company_id;		/* Company ID of the company	*/
+					/* that defines the format for	*/
+					/* the vendor specific log type	*/
+	/* Byte 16-end of log */
+	uint8_t vendor_log[1];		/* Start of vendor specific log	*/
+					/* Variable length.		*/
 };
 
 /*

^ permalink raw reply related

* [PATCH v3 0/3] powerpc: Add IO event interrupt support
From: Tseng-Hui (Frank) Lin @ 2011-03-14 20:29 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tsenglin


This series of patches adds support for handling IO Event interrupts which
come through at the /event-sources/ibm,io-events device tree node.

Change log from V2:

- rename RTAS general extended event log version 6 structure from
  rtas_error_log_v6ext to rtas_ext_event_log_v6.
- Re-implement interrupt call list with atomic notifier.

platforms/pseries/io_event_irq.c:
- Move IO Event data copy to ioei_interrupt(). Rename ioei_get_event()
  to ioei_find_event().
- Remove unused ioei_call_handlers(), pseries_ioei_register_handler(),
  pseries_ioei_unregister_handler() as the functions are replaced by
  notifier.

Change log from v1:
- Restructure the patch into 3 patches.
  = Move non-IBM specific v6 extended log definition to rtas.h.
  = Move IBM specific v6 extended log definition to pseries_event_log.h
    and code to pseries_event_log.c.
- Add CONFIG_PSERIES_EVENT_LOG to pseries Kconfig
- Add CONFIG_IO_EVENT_IRQ to pseries Kconfig

io_events.h:
- Change C++ comments to C format.
- Add definitions for all known type, sub-types, and scopes.
- Change data type of rpc_data from u32 to u8 as the size of rpc_data is
  specified in rpc_field_len in bytes.
- Set maximum length for rpc_data.
- Change ioei_register_isr() and ioei_unregister_isr() declearation to match
  the change in io_events.c file

io_events.c:
- Use pseries_/PSERIES_ prefix for global symbols.
- Change to use list_head for ioei_consumer list.
- Remove scope from handler registeration.
- Change device_initcall() to machine_device_initcall()
- ioei_register_handler():
  = Return -ENODEV if IOEI not supported on the machine.
  = Change use spin_lock() to use spin_lock_irq().
- ioei_unregister_handler():
  = Change use spin_lock() to use spin_lock_irq().
- ioei_call_consumers():
  = Change spin_lock_irqsave() to spin_lock() because we are called from
    an interrupt handler.
  = Return IRQ_HANDLED/IRQ_NONE if interrupt is handled/not handled.
  = Print an error message if no one claims the interrupt.
- io_event_interrupt():
  = Change to use rtas_data_buf and RTAS_DATA_BUF_SIZE for rtas_call().
  = Loop calling rtas_call() to pull in multiple events in one interrupt.
  = Split IO event section searching code into ioei_get_event().
- init_ioei_IRQ()
  = Check rtas_token() return code.


Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Signed-off-by: Tseng-Hui (Frank) Lin <tsenglin@us.ibm.com>
---

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox