Re: [PATCH] macintosh: therm_pm72: delete deprecated driver

2014-11-06 Thread Wolfram Sang
On Thu, Nov 06, 2014 at 01:19:36PM +1100, Benjamin Herrenschmidt wrote:
 On Thu, 2014-11-06 at 02:45 +0100, Wolfram Sang wrote:
  The new driver is around for more than 2 years now, so the old one can
  go. Getting rid of it helps the removal of the legacy .attach_adapter
  callback of the I2C subsystem.
  
  Signed-off-by: Wolfram Sang w...@the-dreams.de
 
 Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org

Thanks! I can take it via my I2C tree, but I'd think it makes more sense
if you take it via ppc? What do you prefer?



signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] macintosh: therm_pm72: delete deprecated driver

2014-11-06 Thread Benjamin Herrenschmidt
On Thu, 2014-11-06 at 10:25 +0100, Wolfram Sang wrote:
 On Thu, Nov 06, 2014 at 01:19:36PM +1100, Benjamin Herrenschmidt wrote:
  On Thu, 2014-11-06 at 02:45 +0100, Wolfram Sang wrote:
   The new driver is around for more than 2 years now, so the old one can
   go. Getting rid of it helps the removal of the legacy .attach_adapter
   callback of the I2C subsystem.
   
   Signed-off-by: Wolfram Sang w...@the-dreams.de
  
  Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
 
 Thanks! I can take it via my I2C tree, but I'd think it makes more sense
 if you take it via ppc? What do you prefer?

Either works. These days Michael Ellerman handles the day to day
maintainance of the powerpc tree so it's his choice but if you need this
as a dependency on your subsequent API removal it's probably better that
you take it.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] macintosh: therm_pm72: delete deprecated driver

2014-11-06 Thread Wolfram Sang
On Thu, Nov 06, 2014 at 08:50:04PM +1100, Benjamin Herrenschmidt wrote:
 On Thu, 2014-11-06 at 10:25 +0100, Wolfram Sang wrote:
  On Thu, Nov 06, 2014 at 01:19:36PM +1100, Benjamin Herrenschmidt wrote:
   On Thu, 2014-11-06 at 02:45 +0100, Wolfram Sang wrote:
The new driver is around for more than 2 years now, so the old one can
go. Getting rid of it helps the removal of the legacy .attach_adapter
callback of the I2C subsystem.

Signed-off-by: Wolfram Sang w...@the-dreams.de
   
   Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
  
  Thanks! I can take it via my I2C tree, but I'd think it makes more sense
  if you take it via ppc? What do you prefer?
 
 Either works. These days Michael Ellerman handles the day to day
 maintainance of the powerpc tree so it's his choice but if you need this
 as a dependency on your subsequent API removal it's probably better that
 you take it.

No dependency, just a first step. Good to know, I will CC Michael on
(somewhen) upcoming patches, too.



signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/iommu: Rename iommu_[un]map_sg functions

2014-11-06 Thread Joerg Roedel
Hi,

here is a patch that fixes a compile failure on powerpc with the recent
iommu tree. If this patch is okay with you guys I'd like to carry it in
the iommu tree too.

Thanks,

Joerg

From ff39a0301d01ad24f7097718b4ec8215eb0c1141 Mon Sep 17 00:00:00 2001
From: Joerg Roedel jroe...@suse.de
Date: Wed, 5 Nov 2014 15:28:30 +0100
Subject: [PATCH] powerpc/iommu: Rename iommu_[un]map_sg functions

The IOMMU-API gained support for a new iommu_map_sg
function. This causes compile failures on powerpc because
the function name is already globally used there.
This patch renames adds a ppc_ prefix to these functions to
solve the compile problem.

Signed-off-by: Joerg Roedel jroe...@suse.de
---
 arch/powerpc/include/asm/iommu.h| 17 ++---
 arch/powerpc/kernel/dma-iommu.c |  8 
 arch/powerpc/kernel/iommu.c | 16 
 arch/powerpc/platforms/cell/iommu.c |  9 +
 4 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
index 42632c7..9cfa370 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
@@ -137,13 +137,16 @@ static inline void set_iommu_table_base_and_group(struct 
device *dev,
iommu_add_device(dev);
 }
 
-extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
-   struct scatterlist *sglist, int nelems,
-   unsigned long mask, enum dma_data_direction direction,
-   struct dma_attrs *attrs);
-extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
-  int nelems, enum dma_data_direction direction,
-  struct dma_attrs *attrs);
+extern int ppc_iommu_map_sg(struct device *dev, struct iommu_table *tbl,
+   struct scatterlist *sglist, int nelems,
+   unsigned long mask,
+   enum dma_data_direction direction,
+   struct dma_attrs *attrs);
+extern void ppc_iommu_unmap_sg(struct iommu_table *tbl,
+  struct scatterlist *sglist,
+  int nelems,
+  enum dma_data_direction direction,
+  struct dma_attrs *attrs);
 
 extern void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
  size_t size, dma_addr_t *dma_handle,
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index 54d0116..4c68bfe 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -60,16 +60,16 @@ static int dma_iommu_map_sg(struct device *dev, struct 
scatterlist *sglist,
int nelems, enum dma_data_direction direction,
struct dma_attrs *attrs)
 {
-   return iommu_map_sg(dev, get_iommu_table_base(dev), sglist, nelems,
-   device_to_mask(dev), direction, attrs);
+   return ppc_iommu_map_sg(dev, get_iommu_table_base(dev), sglist, nelems,
+   device_to_mask(dev), direction, attrs);
 }
 
 static void dma_iommu_unmap_sg(struct device *dev, struct scatterlist *sglist,
int nelems, enum dma_data_direction direction,
struct dma_attrs *attrs)
 {
-   iommu_unmap_sg(get_iommu_table_base(dev), sglist, nelems, direction,
-  attrs);
+   ppc_iommu_unmap_sg(get_iommu_table_base(dev), sglist, nelems,
+  direction, attrs);
 }
 
 /* We support DMA to/from any memory page via the iommu */
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index a10642a..a83cf5e 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -428,10 +428,10 @@ static void iommu_free(struct iommu_table *tbl, 
dma_addr_t dma_addr,
ppc_md.tce_flush(tbl);
 }
 
-int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
-struct scatterlist *sglist, int nelems,
-unsigned long mask, enum dma_data_direction direction,
-struct dma_attrs *attrs)
+int ppc_iommu_map_sg(struct device *dev, struct iommu_table *tbl,
+struct scatterlist *sglist, int nelems,
+unsigned long mask, enum dma_data_direction direction,
+struct dma_attrs *attrs)
 {
dma_addr_t dma_next = 0, dma_addr;
struct scatterlist *s, *outs, *segstart;
@@ -539,7 +539,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table 
*tbl,
 
DBG(mapped %d elements:\n, outcount);
 
-   /* For the sake of iommu_unmap_sg, we clear out the length in the
+   /* For the sake of ppc_iommu_unmap_sg, we clear out the length in the
 * next entry of the sglist if we didn't fill the list completely
 */
if (outcount  incount) {
@@ -572,9 

Re: [PATCH] hwrng: pseries - port to new read API and fix stack corruption

2014-11-06 Thread Herbert Xu
On Fri, Oct 31, 2014 at 07:50:11AM +0100, Greg Kurz wrote:
 The add_early_randomness() function in drivers/char/hw_random/core.c passes
 a 16-byte buffer to pseries_rng_data_read(). Unfortunately, plpar_hcall()
 returns four 64-bit values and trashes 16 bytes on the stack.
 
 This bug has been lying around for a long time. It got unveiled by:
 
 commit d3cc7996473a7bdd33256029988ea690754e4e2a
 Author: Amit Shah amit.s...@redhat.com
 Date:   Thu Jul 10 15:42:34 2014 +0530
 
 hwrng: fetch randomness only after device init
 
 It may trig a oops while loading or unloading the pseries-rng module for both
 PowerVM and PowerKVM guests.
 
 This patch does two things:
 - pass an intermediate well sized buffer to plpar_hcall(). This is acceptalbe
   since we're not on a hot path.
 - move to the new read API so that we know the return buffer size for sure.
 
 Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com

Patch applied to crypto.

Thanks,
-- 
Email: Herbert Xu herb...@gondor.apana.org.au
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/3] powerpc/dts: Factorize the clock control node

2014-11-06 Thread Emil Medve
Hello Scott,


On 10/30/2014 06:21 PM, Scott Wood wrote:
 I don't think the mux stuff belongs here, given that clockgen2.dtsi
 doesn't have it, and I saw at least one clockgen1 user needing to
 supplement this with more muxes.

 The intent was to put here devices/nodes that are common per chassis
 from the low to high end. Specific SoC would change/augment this as
 appropriate. I could have put each node in its own file as we've done
 elsewhere, but I thought it would be too much

 Yes, chassis v1 and v2 have differences, but that's not unexpected
 
 It just strikes me as being an awkward split of where each mux node
 goes.  Is it guaranteed by the chassis that all v1 will have at least
 the first two muxes?

As far as I'm aware we're not building chassis v1 SoC(s) anymore


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 1/3] powerpc/dts: Factorize the clock control node

2014-11-06 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com
Change-Id: I25ce24a25862b4ca460164159867abefe00ccdd1
---

v2: Whitespace fixes

 arch/powerpc/boot/dts/b4860emu.dts |  4 +-
 arch/powerpc/boot/dts/fsl/b4420si-post.dtsi| 28 +
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi| 28 +
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi| 48 +---
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi| 48 +---
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi| 48 +---
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi| 48 +---
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi| 48 +---
 arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi | 78 ++
 arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi | 61 
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi| 30 +-
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi| 29 +-
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi| 29 +-
 arch/powerpc/boot/dts/t4240emu.dts |  4 +-
 14 files changed, 163 insertions(+), 368 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi

diff --git a/arch/powerpc/boot/dts/b4860emu.dts 
b/arch/powerpc/boot/dts/b4860emu.dts
index 85646b4..2aa5cd3 100644
--- a/arch/powerpc/boot/dts/b4860emu.dts
+++ b/arch/powerpc/boot/dts/b4860emu.dts
@@ -193,9 +193,9 @@
fsl,liodn-bits = 12;
};
 
-   clockgen: global-utilities@e1000 {
+/include/ fsl/qoriq-clockgen2.dtsi
+   global-utilities@e1000 {
compatible = fsl,b4-clockgen, fsl,qoriq-clockgen-2.0;
-   reg = 0xe1000 0x1000;
};
 
 /include/ fsl/qoriq-dma-0.dtsi
diff --git a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
index b34c62e..aced374 100644
--- a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
@@ -80,33 +80,9 @@
compatible = fsl,b4420-device-config, 
fsl,qoriq-device-config-2.0;
};
 
-   clockgen: global-utilities@e1000 {
+/include/ qoriq-clockgen2.dtsi
+   global-utilities@e1000 {
compatible = fsl,b4420-clockgen, fsl,qoriq-clockgen-2.0;
-   ranges = 0x0 0xe1000 0x1000;
-   #address-cells = 1;
-   #size-cells = 1;
-
-   sysclk: sysclk {
-   #clock-cells = 0;
-   compatible = fsl,qoriq-sysclk-2.0;
-   clock-output-names = sysclk;
-   };
-
-   pll0: pll0@800 {
-   #clock-cells = 1;
-   reg = 0x800 0x4;
-   compatible = fsl,qoriq-core-pll-2.0;
-   clocks = sysclk;
-   clock-output-names = pll0, pll0-div2, pll0-div4;
-   };
-
-   pll1: pll1@820 {
-   #clock-cells = 1;
-   reg = 0x820 0x4;
-   compatible = fsl,qoriq-core-pll-2.0;
-   clocks = sysclk;
-   clock-output-names = pll1, pll1-div2, pll1-div4;
-   };
 
mux0: mux0@0 {
#clock-cells = 0;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index 256fac8..3b9bb37 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -273,33 +273,9 @@
compatible = fsl,b4860-device-config, 
fsl,qoriq-device-config-2.0;
};
 
-   clockgen: global-utilities@e1000 {
+/include/ qoriq-clockgen2.dtsi
+   global-utilities@e1000 {
compatible = fsl,b4860-clockgen, fsl,qoriq-clockgen-2.0;
-   ranges = 0x0 0xe1000 0x1000;
-   #address-cells = 1;
-   #size-cells = 1;
-
-   sysclk: sysclk {
-   #clock-cells = 0;
-   compatible = fsl,qoriq-sysclk-2.0;
-   clock-output-names = sysclk;
-   };
-
-   pll0: pll0@800 {
-   #clock-cells = 1;
-   reg = 0x800 0x4;
-   compatible = fsl,qoriq-core-pll-2.0;
-   clocks = sysclk;
-   clock-output-names = pll0, pll0-div2, pll0-div4;
-   };
-
-   pll1: pll1@820 {
-   #clock-cells = 1;
-   reg = 0x820 0x4;
-   compatible = fsl,qoriq-core-pll-2.0;
-   clocks = sysclk;
-   clock-output-names = pll1, pll1-div2, pll1-div4;
-   };
 
mux0: mux0@0 {
#clock-cells = 0;
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi 

[PATCH v2 3/3] powerpc/dts: Add node(s) for the platform PLL

2014-11-06 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com
Change-Id: If76cd705a01813abe53396c1486bc13c4289ee92
---
 arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi | 7 +++
 arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi | 7 +++
 2 files changed, 14 insertions(+)

diff --git a/arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi 
b/arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi
index 4871048..4ece1ed 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi
@@ -75,4 +75,11 @@ global-utilities@e1000 {
clock-names = pll0, pll0-div2, pll1, pll1-div2;
clock-output-names = cmux1;
};
+   platform_pll: platform-pll@c00 {
+   #clock-cells = 1;
+   reg = 0xc00 0x4;
+   compatible = fsl,qoriq-platform-pll-1.0;
+   clocks = sysclk;
+   clock-output-names = platform-pll, platform-pll-div2;
+   };
 };
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi 
b/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
index 5d18d2a..48e0b6e 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
@@ -58,4 +58,11 @@ global-utilities@e1000 {
clocks = sysclk;
clock-output-names = pll1, pll1-div2, pll1-div4;
};
+   platform_pll: platform-pll@c00 {
+   #clock-cells = 1;
+   reg = 0xc00 0x4;
+   compatible = fsl,qoriq-platform-pll-2.0;
+   clocks = sysclk;
+   clock-output-names = platform-pll, platform-pll-div2;
+   };
 };
-- 
2.1.3

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 2/3] dt/bindings: qoriq-clock: Add binding for the platform PLL

2014-11-06 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com
Change-Id: I7950afa9650d15ec7ce2cca89bb2a1e38586d4a5
---

v2: Whitespace fixes

 Documentation/devicetree/bindings/clock/qoriq-clock.txt | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/qoriq-clock.txt 
b/Documentation/devicetree/bindings/clock/qoriq-clock.txt
index 5666812..266ff9d 100644
--- a/Documentation/devicetree/bindings/clock/qoriq-clock.txt
+++ b/Documentation/devicetree/bindings/clock/qoriq-clock.txt
@@ -62,6 +62,8 @@ Required properties:
It takes parent's clock-frequency as its clock.
* fsl,qoriq-sysclk-2.0: for input system clock (v2.0).
It takes parent's clock-frequency as its clock.
+   * fsl,qoriq-platform-pll-1.0 for the platform PLL clock (v1.0)
+   * fsl,qoriq-platform-pll-2.0 for the platform PLL clock (v2.0)
 - #clock-cells: From common clock binding. The number of cells in a
clock-specifier. Should be 0 for fsl,qoriq-sysclk-[1,2].0
clocks, or 1 for fsl,qoriq-core-pll-[1,2].0 clocks.
@@ -128,8 +130,16 @@ Example for clock block and clock provider:
clock-names = pll0, pll0-div2, pll1, pll1-div2;
clock-output-names = cmux1;
};
+
+   platform-pll: platform-pll@c00 {
+   #clock-cells = 1;
+   reg = 0xc00 0x4;
+   compatible = fsl,qoriq-platform-pll-1.0;
+   clocks = sysclk;
+   clock-output-names = platform-pll, 
platform-pll-div2;
+   };
};
-  }
+};
 
 Example for clock consumer:
 
@@ -139,4 +149,4 @@ Example for clock consumer:
clocks = mux0;
...
};
-  }
+};
-- 
2.1.3

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v5 08/48] kernel: Move pm_power_off to common code

2014-11-06 Thread Guenter Roeck
pm_power_off is defined for all architectures. Move it to common code.

Have all architectures call do_kernel_power_off instead of pm_power_off.
Some architectures point pm_power_off to machine_power_off. For those,
call do_kernel_power_off from machine_power_off instead.

Acked-by: David Vrabel david.vra...@citrix.com
Acked-by: Geert Uytterhoeven ge...@linux-m68k.org
Acked-by: Hirokazu Takata tak...@linux-m32r.org
Acked-by: James Hogan james.ho...@imgtec.com
Acked-by: Jesper Nilsson jesper.nils...@axis.com
Acked-by: Max Filippov jcmvb...@gmail.com
Acked-by: Rafael J. Wysocki r...@rjwysocki.net
Acked-by: Richard Weinberger rich...@nod.at
Acked-by: Xuetao Guan g...@mprc.pku.edu.cn
Acked-by: Ralf Baechle r...@linux-mips.org
Signed-off-by: Guenter Roeck li...@roeck-us.net
---
v5:
- Rebase to v3.18-rc3
- Update powerpc code to reflect merged power-off handler changes
v4:
- No change
v3:
- Replace poweroff in all newly introduced variables and in text
  with power_off or power-off as appropriate
v2:
- do_kernel_poweroff - do_kernel_power_off
- have_kernel_poweroff - have_kernel_power_off

 arch/alpha/kernel/process.c|  9 +++--
 arch/arc/kernel/reset.c|  5 +
 arch/arm/kernel/process.c  |  5 +
 arch/arm64/kernel/process.c|  5 +
 arch/avr32/kernel/process.c|  6 +-
 arch/blackfin/kernel/process.c |  3 ---
 arch/blackfin/kernel/reboot.c  |  2 ++
 arch/c6x/kernel/process.c  |  9 +
 arch/cris/kernel/process.c |  4 +---
 arch/frv/kernel/process.c  |  5 ++---
 arch/hexagon/kernel/reset.c|  5 ++---
 arch/ia64/kernel/process.c |  5 +
 arch/m32r/kernel/process.c |  8 
 arch/m68k/kernel/process.c |  6 +-
 arch/metag/kernel/process.c|  6 +-
 arch/microblaze/kernel/process.c   |  3 ---
 arch/microblaze/kernel/reset.c |  1 +
 arch/mips/kernel/reset.c   |  6 +-
 arch/mn10300/kernel/process.c  |  8 ++--
 arch/openrisc/kernel/process.c |  8 +---
 arch/parisc/kernel/process.c   |  8 
 arch/powerpc/kernel/setup-common.c |  6 +-
 arch/powerpc/xmon/xmon.c   |  3 +--
 arch/s390/kernel/setup.c   |  8 ++--
 arch/score/kernel/process.c|  8 
 arch/sh/kernel/reboot.c|  6 +-
 arch/sparc/kernel/process_32.c | 10 ++
 arch/sparc/kernel/reboot.c |  8 ++--
 arch/tile/kernel/reboot.c  |  7 +++
 arch/um/kernel/reboot.c|  2 --
 arch/unicore32/kernel/process.c|  9 +
 arch/x86/kernel/reboot.c   | 11 +++
 arch/x86/xen/enlighten.c   |  3 +--
 arch/xtensa/kernel/process.c   |  4 
 drivers/parisc/power.c |  3 +--
 kernel/power/power_off_handler.c   |  9 +
 kernel/reboot.c|  4 ++--
 37 files changed, 68 insertions(+), 150 deletions(-)

diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 1941a07..81c43f8 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -24,6 +24,7 @@
 #include linux/vt.h
 #include linux/mman.h
 #include linux/elfcore.h
+#include linux/pm.h
 #include linux/reboot.h
 #include linux/tty.h
 #include linux/console.h
@@ -40,12 +41,6 @@
 #include proto.h
 #include pci_impl.h
 
-/*
- * Power off function, if any
- */
-void (*pm_power_off)(void) = machine_power_off;
-EXPORT_SYMBOL(pm_power_off);
-
 #ifdef CONFIG_ALPHA_WTINT
 /*
  * Sleep the CPU.
@@ -184,6 +179,8 @@ machine_halt(void)
 void
 machine_power_off(void)
 {
+   do_kernel_power_off();
+
common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL);
 }
 
diff --git a/arch/arc/kernel/reset.c b/arch/arc/kernel/reset.c
index 2768fa1..0758d9d 100644
--- a/arch/arc/kernel/reset.c
+++ b/arch/arc/kernel/reset.c
@@ -26,9 +26,6 @@ void machine_restart(char *__unused)
 
 void machine_power_off(void)
 {
-   /* FIXME ::  power off ??? */
+   do_kernel_power_off();
machine_halt();
 }
-
-void (*pm_power_off) (void) = NULL;
-EXPORT_SYMBOL(pm_power_off);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index fe972a2..aa3f656 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -117,8 +117,6 @@ void soft_restart(unsigned long addr)
 /*
  * Function pointers to optional machine specific functions
  */
-void (*pm_power_off)(void);
-EXPORT_SYMBOL(pm_power_off);
 
 void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
 
@@ -205,8 +203,7 @@ void machine_power_off(void)
local_irq_disable();
smp_send_stop();
 
-   if (pm_power_off)
-   pm_power_off();
+   do_kernel_power_off();
 }
 
 /*
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index fde9923..6f623a0 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -68,8 +68,6 @@ void soft_restart(unsigned long addr)
 /*
  * Function pointers to optional machine specific 

[PATCH v5 41/48] powerpc: Register with kernel power-off handler

2014-11-06 Thread Guenter Roeck
Register with kernel power-off handler instead of setting pm_power_off
directly.

If there is an indication that there can be more than one power-off handler,
use register_power_off_handler, otherwise use register_power_off_handler_simple
to register the power-off handler.

If the power-off handler only resets or stops the system, select the fallback
priority to indicate that the power-off handler is one of last resort.
If the power-off handler powers off the system, select the default priority,
unless the power-off handler installation code suggests that there can be
more than one power-off handler and the new handler is only installed
conditionally. In this case, install the handler with low priority.

Cc: Alexander Graf ag...@suse.de
Cc: Michael Ellerman m...@ellerman.id.au
Signed-off-by: Guenter Roeck li...@roeck-us.net
---
v5:
- New patch

 arch/powerpc/platforms/44x/ppc476.c  |  3 ++-
 arch/powerpc/platforms/52xx/efika.c  |  3 ++-
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c   | 30 
 arch/powerpc/platforms/85xx/corenet_generic.c|  3 ++-
 arch/powerpc/platforms/85xx/sgy_cts1000.c| 16 +++--
 arch/powerpc/platforms/cell/celleb_setup.c   |  6 +++--
 arch/powerpc/platforms/cell/qpace_setup.c|  3 ++-
 arch/powerpc/platforms/cell/setup.c  |  3 ++-
 arch/powerpc/platforms/chrp/setup.c  |  3 ++-
 arch/powerpc/platforms/embedded6xx/gamecube.c|  3 ++-
 arch/powerpc/platforms/embedded6xx/linkstation.c |  3 ++-
 arch/powerpc/platforms/embedded6xx/wii.c |  3 ++-
 arch/powerpc/platforms/maple/setup.c |  6 +++--
 arch/powerpc/platforms/powermac/setup.c  |  3 ++-
 arch/powerpc/platforms/powernv/setup.c   |  6 +++--
 arch/powerpc/platforms/ps3/setup.c   |  3 ++-
 arch/powerpc/platforms/pseries/setup.c   |  3 ++-
 arch/powerpc/sysdev/fsl_soc.c|  6 ++---
 18 files changed, 73 insertions(+), 33 deletions(-)

diff --git a/arch/powerpc/platforms/44x/ppc476.c 
b/arch/powerpc/platforms/44x/ppc476.c
index c11ce65..590d31f 100644
--- a/arch/powerpc/platforms/44x/ppc476.c
+++ b/arch/powerpc/platforms/44x/ppc476.c
@@ -94,7 +94,8 @@ static int avr_probe(struct i2c_client *client,
 {
avr_i2c_client = client;
ppc_md.restart = avr_reset_system;
-   pm_power_off = avr_power_off_system;
+   register_power_off_handler_simple(avr_power_off_system,
+ POWER_OFF_PRIORITY_DEFAULT);
return 0;
 }
 
diff --git a/arch/powerpc/platforms/52xx/efika.c 
b/arch/powerpc/platforms/52xx/efika.c
index 6af651e..321a7a7 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -212,7 +212,8 @@ static int __init efika_probe(void)
DMA_MODE_READ = 0x44;
DMA_MODE_WRITE = 0x48;
 
-   pm_power_off = rtas_power_off;
+   register_power_off_handler_simple(rtas_power_off,
+ POWER_OFF_PRIORITY_DEFAULT);
 
return 1;
 }
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c 
b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 15e8021..1bf6b0e 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -19,6 +19,7 @@
 #include linux/gpio.h
 #include linux/of.h
 #include linux/of_gpio.h
+#include linux/pm.h
 #include linux/slab.h
 #include linux/kthread.h
 #include linux/reboot.h
@@ -86,7 +87,7 @@ static ssize_t show_status(struct device *d,
 }
 static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
 
-static void mcu_power_off(void)
+static void mcu_power_off(struct power_off_handler_block *this)
 {
struct mcu *mcu = glob_mcu;
 
@@ -97,6 +98,11 @@ static void mcu_power_off(void)
mutex_unlock(mcu-lock);
 }
 
+static struct power_off_handler_block mcu_power_off_hb = {
+   .handler = mcu_power_off,
+   .priority = POWER_OFF_PRIORITY_LOW,
+};
+
 static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
 {
struct mcu *mcu = container_of(gc, struct mcu, gc);
@@ -167,13 +173,15 @@ static int mcu_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
if (ret)
goto err;
 
-   /* XXX: this is potentially racy, but there is no lock for pm_power_off 
*/
-   if (!pm_power_off) {
-   glob_mcu = mcu;
-   pm_power_off = mcu_power_off;
-   dev_info(client-dev, will provide power-off service\n);
+   glob_mcu = mcu;
+   ret = register_power_off_handler(mcu_power_off_hb);
+   if (ret) {
+   dev_err(client-dev, Failed to register power-off handler\n);
+   goto err_handler;
}
 
+   dev_info(client-dev, will provide power-off service\n);
+
if (device_create_file(client-dev, dev_attr_status))
dev_err(client-dev,
couldn't create device file for 

Re: [PATCH v3 1/4] dt/bindings: Introduce the FSL QorIQ DPAA BMan

2014-11-06 Thread Scott Wood
On Wed, 2014-11-05 at 09:18 -0600, Emil Medve wrote:
 +Devices connected to a BMan instance via Direct Connect Portals (DCP) must 
 link
 +to the respective BMan instance
 +
 +- fsl,bman
 + Usage:  Required
 + Value type: prop-encoded-array
 + Description:List of phandle and DCP index pairs, to the BMan 
 instance
 + to which this device is connected via the DCP

Does software need the DCP index (though for QMan there do seem to be a
few registers associated with each DCP)?  Where can I find that info in
the manual?

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] i2c-qoriq: modified compatibility for correct prescaler

2014-11-06 Thread Scott Wood
On Wed, 2014-10-29 at 09:59 +0100, Valentin Longchamp wrote:
 On 10/29/2014 12:08 AM, Scott Wood wrote:
  On Fri, 2014-10-17 at 11:27 +0200, Valentin Longchamp wrote:
  With fsl-i2c compatibility the i2c frequency is not set
  correctly, because it sets no prescaler. According to the AN2919 from
  Freescale and the QorIQ (P2041) documentation, the source clock is 1/2
  the platform clock. This implies that a prescaler of 2 must be used.
 
  This changes the compatibility of the qoriq-i2c .dtsi files to pick the
  mpc8543, which uses the same driver but sets the correct prescaler.
 
  Signed-off-by: Rainer Boschung rainer.bosch...@keymile.com
  Signed-off-by: Valentin Longchamp valentin.longch...@keymile.com
  ---
 
   arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi | 4 ++--
   arch/powerpc/boot/dts/fsl/qoriq-i2c-1.dtsi | 4 ++--
   2 files changed, 4 insertions(+), 4 deletions(-)
 
  diff --git a/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi 
  b/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi
  index 5f9bf7d..aa6c366 100644
  --- a/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi
  +++ b/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi
  @@ -36,7 +36,7 @@ i2c@118000 {
 #address-cells = 1;
 #size-cells = 0;
 cell-index = 0;
  -  compatible = fsl-i2c;
  +  compatible = fsl,mpc8543-i2c, fsl-i2c;
 reg = 0x118000 0x100;
 interrupts = 38 2 0 0;
 dfsrr;
  @@ -46,7 +46,7 @@ i2c@118100 {
 #address-cells = 1;
 #size-cells = 0;
 cell-index = 1;
  -  compatible = fsl-i2c;
  +  compatible = fsl,mpc8543-i2c, fsl-i2c;
 reg = 0x118100 0x100;
 interrupts = 38 2 0 0;
 dfsrr;
  
  Are all chips that use this dtsi 100% compatible with mpc8543's i2c, or
  just in ways the Linux driver cares about?
 
 I have just looked briefly at the mpc8548 RM (covers mpc8543) and its i2c
 controller looks the same as the qoriq's. I cannot however state if they are
 100% compatible.
 
 If we wanted to be on the safe side and strict (since we are not sure that the
 hardware is 100% compatible), we maybe should add a fsl,qoriq-i2c compatible 
 to
 the driver that does the same as mpc8543-i2c.

If we're going to change the device tree I'd rather just add a property
to say what the prescaler is.

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/fsl: Update fman dt binding with clock name and qbman link

2014-11-06 Thread Scott Wood
The clock name fmanclk was given in the example, but not specified
in the binding itself.  Made clock-names mandatory as otherwise there's
not much point having it.

Added a reference to the fsl,qman and fsl,bman properties proposed
in http://patchwork.ozlabs.org/patch/407034/ and
http://patchwork.ozlabs.org/patch/407035/

Signed-off-by: Scott Wood scottw...@freescale.com
---
This patch is on top of http://patchwork.ozlabs.org/patch/390351/

 Documentation/devicetree/bindings/powerpc/fsl/fman.txt | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/powerpc/fsl/fman.txt 
b/Documentation/devicetree/bindings/powerpc/fsl/fman.txt
index da8e5f2..edeea16 100644
--- a/Documentation/devicetree/bindings/powerpc/fsl/fman.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/fman.txt
@@ -79,12 +79,12 @@ PROPERTIES
 - clocks
Usage: required
Value type: prop-encoded-array
-   Definition: phandle for fman clock.
+   Definition: phandle for the fman input clock.
 
 - clock-names
-   usage: optional
+   usage: required
Value type: stringlist
-   Definition: A standard property
+   Definition: fmanclk for the fman input clock.
 
 - interrupts
Usage: required
@@ -104,6 +104,11 @@ PROPERTIES
Work Queue (WQ) Channel Assignments in the QMan section
in DPAA Reference Manual.
 
+- fsl,qman
+- fsl,bman
+   Usage: required
+   Definition: See soc/fsl/qman.txt and soc/fsl/bman.txt
+
 =
 FMan MURAM Node
 
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [v4,17/21] powerpc/8xx: set PTE bit 22 off TLBmiss

2014-11-06 Thread Scott Wood
On Fri, Sep 19, 2014 at 10:36:09AM +0200, LEROY Christophe wrote:
 No need to re-set this bit at each TLB miss. Let's set it in the PTE.
 
 Signed-off-by: Christophe Leroy christophe.le...@c-s.fr
 ---
 Changes in v2:
 - None
 
 Changes in v3:
 - Removed PPC405 related macro from PPC8xx specific code
 - PTE_NONE_MASK doesn't need PAGE_ACCESSED in Linux 2.6
 
 Changes in v4:
 - None
 
  arch/powerpc/include/asm/pgtable-ppc32.h | 20 
  arch/powerpc/include/asm/pte-8xx.h   |  7 +--
  arch/powerpc/kernel/head_8xx.S   | 10 ++
  3 files changed, 27 insertions(+), 10 deletions(-)
 
 diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h 
 b/arch/powerpc/include/asm/pgtable-ppc32.h
 index 47edde8..35a9b44 100644
 --- a/arch/powerpc/include/asm/pgtable-ppc32.h
 +++ b/arch/powerpc/include/asm/pgtable-ppc32.h
 @@ -172,6 +172,25 @@ static inline unsigned long pte_update(pte_t *p,
  #ifdef PTE_ATOMIC_UPDATES
   unsigned long old, tmp;
  
 +#ifdef CONFIG_PPC_8xx
 + unsigned long tmp2;
 +
 + __asm__ __volatile__(\
 +1:   lwarx   %0,0,%4\n\
 + andc%1,%0,%5\n\
 + or  %1,%1,%6\n\
 + /* 0x200 == Extended encoding, bit 22 */ \
 + /* Bit 22 has to be 1 if neither _PAGE_USER nor _PAGE_RW are set */ \
 + rlwimi  %1,%1,32-2,0x200\n /* get _PAGE_USER */ \
 + rlwinm  %3,%1,32-1,0x200\n /* get _PAGE_RW */ \
 + or  %1,%3,%1\n\
 + xori%1,%1,0x200\n
 +stwcx.  %1,0,%4\n\
 + bne-1b

Why do you need this...

 diff --git a/arch/powerpc/include/asm/pte-8xx.h 
 b/arch/powerpc/include/asm/pte-8xx.h
 index d44826e..daa4616 100644
 --- a/arch/powerpc/include/asm/pte-8xx.h
 +++ b/arch/powerpc/include/asm/pte-8xx.h
 @@ -48,19 +48,22 @@
   */
  #define _PAGE_RW 0x0400  /* lsb PP bits, inverted in HW */
  #define _PAGE_USER   0x0800  /* msb PP bits */
 +/* set when neither _PAGE_USER nor _PAGE_RW are set */
 +#define _PAGE_KNLRO  0x0200
  
  #define _PMD_PRESENT 0x0001
  #define _PMD_BAD 0x0ff0
  #define _PMD_PAGE_MASK   0x000c
  #define _PMD_PAGE_8M 0x000c
  
 -#define _PTE_NONE_MASK _PAGE_ACCESSED
 +#define _PTE_NONE_MASK _PAGE_KNLRO
  
  /* Until my rework is finished, 8xx still needs atomic PTE updates */
  #define PTE_ATOMIC_UPDATES   1
  
  /* We need to add _PAGE_SHARED to kernel pages */
 -#define _PAGE_KERNEL_RO  (_PAGE_SHARED)
 +#define _PAGE_KERNEL_RO  (_PAGE_SHARED | _PAGE_KNLRO)
 +#define _PAGE_KERNEL_ROX (_PAGE_EXEC | _PAGE_KNLRO)
  #define _PAGE_KERNEL_RW  (_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)

...if 0x200 is already being set in the PTE here?

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: powerpc/8xx: Remove Kconfig symbol FADS

2014-11-06 Thread Scott Wood
On Wed, Sep 24, 2014 at 10:06:19AM +0200, Paul Bolle wrote:
 Commit 39eb56da2b53 (pcmcia: Remove m8xx_pcmcia driver) removed the
 only driver that used CONFIG_FADS. Setting the Kconfig symbol FADS is
 pointless since that commit. Remove it.
 
 Signed-off-by: Paul Bolle pebo...@tiscali.nl
 ---
 Done on top of next-20140923. Tested with git grep only.
 
 Another cleanup might be to remove MPC8XXFADS (or FADS) from the 8xx
 Machine Type choice. Is there any reason left to pick FADS as a
 machine type?

Nothing references MPC8XXFADS, so yes, it can be removed.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 0/3] fix a kernel panic on fsl corenet board when CONFIG_CLK_PPC_CORENET is enabled

2014-11-06 Thread Scott Wood
On Sun, 2014-10-19 at 14:11 +0800, Kevin Hao wrote:
 Hi,
 
 I have done a boot test on p2014rdb and t4240qds boards. I don't have an 
 access
 to mpc512x board, so only build test for that.
 
 v2:
  - Revert the commit da788acb2838 first.
  - Invoke of_clk_init() from a common place.
 
 v1
 This tries to fix a kernel panic introduced by commit da788acb2838
 (clk: ppc-corenet: Fix Section mismatch warning).
 
 Kevin Hao (3):
   Revert clk: ppc-corenet: Fix Section mismatch warning
   powerpc: call of_clk_init() from time_init()
   clk: ppc-corenet: fix section mismatch warning
 
  arch/powerpc/kernel/time.c|  5 
  arch/powerpc/platforms/512x/clock-commonclk.c | 11 ---
  drivers/clk/clk-ppc-corenet.c | 43 
 ---
  3 files changed, 16 insertions(+), 43 deletions(-)
 

Acked-by: Scott Wood scottw...@freescale.com

Whose tree should this go through?

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/4] dt/bindings: Introduce the FSL QorIQ DPAA BMan

2014-11-06 Thread Emil Medve
Hello Scott,


On 11/06/2014 03:49 PM, Scott Wood wrote:
 On Wed, 2014-11-05 at 09:18 -0600, Emil Medve wrote:
 +Devices connected to a BMan instance via Direct Connect Portals (DCP) must 
 link
 +to the respective BMan instance
 +
 +- fsl,bman
 +Usage:  Required
 +Value type: prop-encoded-array
 +Description:List of phandle and DCP index pairs, to the BMan 
 instance
 +to which this device is connected via the DCP
 
 Does software need the DCP index (though for QMan there do seem to be a
 few registers associated with each DCP)?  Where can I find that info in
 the manual?

The DCP index helps describe the topology of the devices connected to
the B/QMan. One might be tempted to use some address to reference said
DCP, unfortunately the pertinent registers/bits for said DCP(s) are not
into a compact region. Look at the CCSR memory map for B/QMan

In the QMan case things are marginally better. For each hardware portal
there are a handful of (vaguely named *DCx*, *DCPx* or *DCP*) registers
(configuration, performance monitoring and debugging). However, still
registers and bits spread here and there

In the BMan case things are a bit worse as the registers names are less
friendly and still spread around

Do you need specific names/offsets?


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/4] dt/bindings: Introduce the FSL QorIQ DPAA BMan

2014-11-06 Thread Scott Wood
On Fri, 2014-11-07 at 01:31 -0600, Emil Medve wrote:
 Hello Scott,
 
 
 On 11/06/2014 03:49 PM, Scott Wood wrote:
  On Wed, 2014-11-05 at 09:18 -0600, Emil Medve wrote:
  +Devices connected to a BMan instance via Direct Connect Portals (DCP) 
  must link
  +to the respective BMan instance
  +
  +- fsl,bman
  +  Usage:  Required
  +  Value type: prop-encoded-array
  +  Description:List of phandle and DCP index pairs, to the BMan 
  instance
  +  to which this device is connected via the DCP
  
  Does software need the DCP index (though for QMan there do seem to be a
  few registers associated with each DCP)?  Where can I find that info in
  the manual?
 
 The DCP index helps describe the topology of the devices connected to
 the B/QMan. One might be tempted to use some address to reference said
 DCP, unfortunately the pertinent registers/bits for said DCP(s) are not
 into a compact region. Look at the CCSR memory map for B/QMan
 
 In the QMan case things are marginally better. For each hardware portal
 there are a handful of (vaguely named *DCx*, *DCPx* or *DCP*) registers
 (configuration, performance monitoring and debugging). However, still
 registers and bits spread here and there
 
 In the BMan case things are a bit worse as the registers names are less
 friendly and still spread around
 
 Do you need specific names/offsets?

My question about the manual wasn't rhetorical -- I tried to find this
information and couldn't.

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev