LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: powerpc/pseries: add missing cpumask.h include file
From: Michael Ellerman @ 2018-10-31  5:43 UTC (permalink / raw)
  To: Tyrel Datwyler; +Cc: nfont, linuxppc-dev, Tyrel Datwyler
In-Reply-To: <1540258332-15520-1-git-send-email-tyreld@linux.vnet.ibm.com>

On Tue, 2018-10-23 at 01:32:12 UTC, Tyrel Datwyler wrote:
> Build error is encountered when inlcuding <asm/rtas.h> if no explicit or
> implicit include of cpumask.h exists in the including file.
> 
> In file included from arch/powerpc/platforms/pseries/hotplug-pci.c:3:0:
> ./arch/powerpc/include/asm/rtas.h:360:34: error: unknown type name 'cpumask_var_t'
>  extern int rtas_online_cpus_mask(cpumask_var_t cpus);
>                                   ^
> ./arch/powerpc/include/asm/rtas.h:361:35: error: unknown type name 'cpumask_var_t'
>  extern int rtas_offline_cpus_mask(cpumask_var_t cpus);
> 
> Fixes: 120496ac2d2d ("powerpc: Bring all threads online prior to migration/hibernation")
> Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/8dce6b2215eaa91dbf04463e11098a

cheers

^ permalink raw reply

* Re: powerpc/process: Fix flush_all_to_thread for SPE
From: Michael Ellerman @ 2018-10-31  5:43 UTC (permalink / raw)
  To: DATACOM - Felipe.Rechia, linuxppc-dev; +Cc: Zaneti
In-Reply-To: <344813002.4841437.1540469274858.JavaMail.zimbra@datacom.com.br>

On Thu, 2018-10-25 at 12:07:54 UTC, "DATACOM - Felipe.Rechia" wrote:
> From: "Felipe Rechia" <felipe.rechia@datacom.com.br>
> Date: Wed, 24 Oct 2018 10:57:22 -0300
> Subject: [PATCH] powerpc/process: Fix flush_all_to_thread for SPE
> 
> Fix a bug introduced by the creation of flush_all_to_thread() for
> processors that have SPE (Signal Processing Engine) and use it to
> compute floating-point operations.
> 
> >From userspace perspective, the problem was seen in attempts of
> computing floating-point operations which should generate exceptions.
> For example:
> 
>   fork();
>   float x = 0.0 / 0.0;
>   isnan(x);           // forked process returns False (should be True)
> 
> The operation above also should always cause the SPEFSCR FINV bit to
> be set. However, the SPE floating-point exceptions were turned off
> after a fork().
> 
> Kernel versions prior to the bug used flush_spe_to_thread(), which
> first saves SPEFSCR register values in tsk->thread and then calls
> giveup_spe(tsk).
> 
> After commit 579e633e764e, the save_all() function was called first
> to giveup_spe(), and then the SPEFSCR register values were saved in
> tsk->thread. This would save the SPEFSCR register values after
> disabling SPE for that thread, causing the bug described above.
> 
> Fixes 579e633e764e ("powerpc: create flush_all_to_thread()")
> Signed-off-by: felipe.rechia <felipe.rechia@datacom.com.br>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/e901378578c62202594cba0f6c076f

cheers

^ permalink raw reply

* Re: [PATCH v7 5/6] arm64: dts: add QorIQ LX2160A SoC support
From: Shawn Guo @ 2018-10-31  6:25 UTC (permalink / raw)
  To: Vabhav Sharma
  Cc: mark.rutland@arm.com, kstewart@linuxfoundation.org,
	ulf.hansson@linaro.org, Yogesh Narayan Gaur,
	linux-kernel-owner@vger.kernel.org, catalin.marinas@arm.com,
	mturquette@baylibre.com, will.deacon@arm.com,
	adrian.hunter@intel.com, yamada.masahiro@socionext.com,
	Sriram Dash, linux-clk@vger.kernel.org, Horia Geanta,
	Pankaj Bansal, Udit Kumar, linux@armlinux.org.uk, Priyanka Jain,
	viresh.kumar@linaro.org, Yinbo Zhu, devicetree@vger.kernel.org,
	arnd@arndb.de, linux-pm@vger.kernel.org, oss@buserror.net,
	robh+dt@kernel.org, Varun Sethi, Nipun Gupta,
	linux-arm-kernel@lists.infradead.org, Ramneek Mehresh,
	sboyd@kernel.org, gregkh@linuxfoundation.org, Ying Zhang,
	rjw@rjwysocki.net, linux-kernel@vger.kernel.org, Leo Li,
	sudeep.holla@arm.com, Ran Wang, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1540759926-3641-6-git-send-email-vabhav.sharma@nxp.com>

On Mon, Oct 29, 2018 at 08:57:54AM +0000, Vabhav Sharma wrote:
> LX2160A SoC is based on Layerscape Chassis Generation 3.2 Architecture.
> 
> LX2160A features an advanced 16 64-bit ARM v8 CortexA72 processor cores
> in 8 cluster, CCN508, GICv3,two 64-bit DDR4 memory controller, 8 I2C
> controllers, 3 dspi, 2 esdhc,2 USB 3.0, mmu 500, 3 SATA, 4 PL011 SBSA
> UARTs etc.
> 
> Signed-off-by: Ramneek Mehresh <ramneek.mehresh@nxp.com>
> Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
> Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
> Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
> Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
> Signed-off-by: Horia Geanta <horia.geanta@nxp.com>
> Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v7 6/6] arm64: dts: add LX2160ARDB board support
From: Shawn Guo @ 2018-10-31  6:25 UTC (permalink / raw)
  To: Vabhav Sharma
  Cc: mark.rutland@arm.com, kstewart@linuxfoundation.org,
	ulf.hansson@linaro.org, linux-kernel-owner@vger.kernel.org,
	catalin.marinas@arm.com, mturquette@baylibre.com,
	will.deacon@arm.com, adrian.hunter@intel.com,
	yamada.masahiro@socionext.com, Sriram Dash,
	linux-clk@vger.kernel.org, Horia Geanta, Pankaj Bansal,
	Udit Kumar, linux@armlinux.org.uk, Priyanka Jain,
	viresh.kumar@linaro.org, Yinbo Zhu, devicetree@vger.kernel.org,
	arnd@arndb.de, linux-pm@vger.kernel.org, oss@buserror.net,
	robh+dt@kernel.org, Varun Sethi,
	linux-arm-kernel@lists.infradead.org, sboyd@kernel.org,
	gregkh@linuxfoundation.org, Ying Zhang, rjw@rjwysocki.net,
	linux-kernel@vger.kernel.org, Leo Li, sudeep.holla@arm.com,
	Ran Wang, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1540759926-3641-7-git-send-email-vabhav.sharma@nxp.com>

On Mon, Oct 29, 2018 at 08:58:01AM +0000, Vabhav Sharma wrote:
> LX2160A reference design board (RDB) is a high-performance
> computing, evaluation, and development platform with LX2160A
> SoC.
> 
> Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
> Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
> Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
> Signed-off-by: Horia Geanta <horia.geanta@nxp.com>
> Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
> Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
> Acked-by: Li Yang <leoyang.li@nxp.com>

Applied, thanks.

^ permalink raw reply

* [PATCH 2/2 v3] clk: qoriq: add more compatibles strings
From: Yuantian Tang @ 2018-10-31  6:57 UTC (permalink / raw)
  To: oss
  Cc: mark.rutland, devicetree, Yuantian Tang, sboyd, mturquette,
	linux-kernel, robh+dt, paulus, linuxppc-dev, linux-clk
In-Reply-To: <20181031065736.32719-1-andy.tang@nxp.com>

Add more SoC compatible strings to support more chips.

Signed-off-by: Yuantian Tang <andy.tang@nxp.com>
---
v3:
  - undo deleting old bindings
  - split the dts and driver to different patchset

 .../devicetree/bindings/clock/qoriq-clock.txt      |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/qoriq-clock.txt b/Documentation/devicetree/bindings/clock/qoriq-clock.txt
index 97f46ad..c655f28 100644
--- a/Documentation/devicetree/bindings/clock/qoriq-clock.txt
+++ b/Documentation/devicetree/bindings/clock/qoriq-clock.txt
@@ -28,6 +28,12 @@ Required properties:
 	* "fsl,p4080-clockgen"
 	* "fsl,p5020-clockgen"
 	* "fsl,p5040-clockgen"
+	* "fsl,t1023-clockgen"
+	* "fsl,t1024-clockgen"
+	* "fsl,t1040-clockgen"
+	* "fsl,t1042-clockgen"
+	* "fsl,t2080-clockgen"
+	* "fsl,t2081-clockgen"
 	* "fsl,t4240-clockgen"
 	* "fsl,b4420-clockgen"
 	* "fsl,b4860-clockgen"
-- 
1.7.1


^ permalink raw reply related

* [PATCH 1/2 v3] powerpc/fsl: Use new clockgen binding
From: Yuantian Tang @ 2018-10-31  6:57 UTC (permalink / raw)
  To: oss
  Cc: mark.rutland, devicetree, Tang Yuantian, sboyd, mturquette,
	linux-kernel, robh+dt, paulus, linuxppc-dev, linux-clk

From: Scott Wood <oss@buserror.net>

The driver retains compatibility with old device trees, but we don't
want the old nodes lying around to be copied, or used as a reference
(some of the mux options are incorrect), or even just being clutter.

Signed-off-by: Scott Wood <oss@buserror.net>
Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
---
v3:
  - update the commit message
  - split the dts and driver to different patchset

 arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi     |    4 +-
 arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi     |    8 ++--
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi       |   15 -----
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi    |   18 ------
 arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi     |    8 ++--
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi    |   18 ------
 arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi     |    8 ++--
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi    |   70 ------------------------
 arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi     |   16 +++---
 arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi     |    4 +-
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi    |   18 ------
 arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi     |    8 ++--
 arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi |   55 +++----------------
 arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi |   38 +++----------
 arch/powerpc/boot/dts/fsl/t1023si-post.dtsi    |   16 ------
 arch/powerpc/boot/dts/fsl/t102xsi-pre.dtsi     |    4 +-
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi    |   44 ---------------
 arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi     |    8 ++--
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi    |   22 --------
 arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi     |    8 ++--
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi    |   61 ---------------------
 arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi     |   24 ++++----
 22 files changed, 66 insertions(+), 409 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
index 88d8423..bb7b9b9 100644
--- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
@@ -70,14 +70,14 @@
 		cpu0: PowerPC,e6500@0 {
 			device_type = "cpu";
 			reg = <0 1>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu1: PowerPC,e6500@2 {
 			device_type = "cpu";
 			reg = <2 3>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
index f3f968c..388ba1b 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
@@ -75,28 +75,28 @@
 		cpu0: PowerPC,e6500@0 {
 			device_type = "cpu";
 			reg = <0 1>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu1: PowerPC,e6500@2 {
 			device_type = "cpu";
 			reg = <2 3>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu2: PowerPC,e6500@4 {
 			device_type = "cpu";
 			reg = <4 5>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu3: PowerPC,e6500@6 {
 			device_type = "cpu";
 			reg = <6 7>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
index 1b33f51..4f044b4 100644
--- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
@@ -398,21 +398,6 @@
 	};
 
 /include/ "qoriq-clockgen2.dtsi"
-	clockgen: global-utilities@e1000 {
-		compatible = "fsl,b4-clockgen", "fsl,qoriq-clockgen-2.0";
-		reg = <0xe1000 0x1000>;
-
-		mux0: mux0@0 {
-			#clock-cells = <0>;
-			reg = <0x0 0x4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				<&pll1 0>, <&pll1 1>, <&pll1 2>;
-			clock-names = "pll0", "pll0-div2", "pll0-div4",
-				"pll1", "pll1-div2", "pll1-div4";
-			clock-output-names = "cmux0";
-		};
-	};
 
 	rcpm: global-utilities@e2000 {
 		compatible = "fsl,b4-rcpm", "fsl,qoriq-rcpm-2.0";
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
index 51e975d..872e448 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
@@ -327,24 +327,6 @@
 /include/ "qoriq-clockgen1.dtsi"
 	global-utilities@e1000 {
 		compatible = "fsl,p2041-clockgen", "fsl,qoriq-clockgen-1.0";
-
-		mux2: mux2@40 {
-			#clock-cells = <0>;
-			reg = <0x40 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-			clock-output-names = "cmux2";
-		};
-
-		mux3: mux3@60 {
-			#clock-cells = <0>;
-			reg = <0x60 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-			clock-output-names = "cmux3";
-		};
 	};
 
 	rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
index 941274c..6318962 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
@@ -89,7 +89,7 @@
 		cpu0: PowerPC,e500mc@0 {
 			device_type = "cpu";
 			reg = <0>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_0>;
 			fsl,portid-mapping = <0x80000000>;
 			L2_0: l2-cache {
@@ -99,7 +99,7 @@
 		cpu1: PowerPC,e500mc@1 {
 			device_type = "cpu";
 			reg = <1>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x40000000>;
 			L2_1: l2-cache {
@@ -109,7 +109,7 @@
 		cpu2: PowerPC,e500mc@2 {
 			device_type = "cpu";
 			reg = <2>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_2>;
 			fsl,portid-mapping = <0x20000000>;
 			L2_2: l2-cache {
@@ -119,7 +119,7 @@
 		cpu3: PowerPC,e500mc@3 {
 			device_type = "cpu";
 			reg = <3>;
-			clocks = <&mux3>;
+			clocks = <&clockgen 1 3>;
 			next-level-cache = <&L2_3>;
 			fsl,portid-mapping = <0x10000000>;
 			L2_3: l2-cache {
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
index 187676f..81bc75a 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
@@ -354,24 +354,6 @@
 /include/ "qoriq-clockgen1.dtsi"
 	global-utilities@e1000 {
 		compatible = "fsl,p3041-clockgen", "fsl,qoriq-clockgen-1.0";
-
-		mux2: mux2@40 {
-			#clock-cells = <0>;
-			reg = <0x40 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-			clock-output-names = "cmux2";
-		};
-
-		mux3: mux3@60 {
-			#clock-cells = <0>;
-			reg = <0x60 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-			clock-output-names = "cmux3";
-		};
 	};
 
 	rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
index 50b73e8..db92f11 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
@@ -90,7 +90,7 @@
 		cpu0: PowerPC,e500mc@0 {
 			device_type = "cpu";
 			reg = <0>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_0>;
 			fsl,portid-mapping = <0x80000000>;
 			L2_0: l2-cache {
@@ -100,7 +100,7 @@
 		cpu1: PowerPC,e500mc@1 {
 			device_type = "cpu";
 			reg = <1>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x40000000>;
 			L2_1: l2-cache {
@@ -110,7 +110,7 @@
 		cpu2: PowerPC,e500mc@2 {
 			device_type = "cpu";
 			reg = <2>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_2>;
 			fsl,portid-mapping = <0x20000000>;
 			L2_2: l2-cache {
@@ -120,7 +120,7 @@
 		cpu3: PowerPC,e500mc@3 {
 			device_type = "cpu";
 			reg = <3>;
-			clocks = <&mux3>;
+			clocks = <&clockgen 1 3>;
 			next-level-cache = <&L2_3>;
 			fsl,portid-mapping = <0x10000000>;
 			L2_3: l2-cache {
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
index a025208..4da49b6 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -374,76 +374,6 @@
 /include/ "qoriq-clockgen1.dtsi"
 	global-utilities@e1000 {
 		compatible = "fsl,p4080-clockgen", "fsl,qoriq-clockgen-1.0";
-
-		pll2: pll2@840 {
-			#clock-cells = <1>;
-			reg = <0x840 0x4>;
-			compatible = "fsl,qoriq-core-pll-1.0";
-			clocks = <&sysclk>;
-			clock-output-names = "pll2", "pll2-div2";
-		};
-
-		pll3: pll3@860 {
-			#clock-cells = <1>;
-			reg = <0x860 0x4>;
-			compatible = "fsl,qoriq-core-pll-1.0";
-			clocks = <&sysclk>;
-			clock-output-names = "pll3", "pll3-div2";
-		};
-
-		mux2: mux2@40 {
-			#clock-cells = <0>;
-			reg = <0x40 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-			clock-output-names = "cmux2";
-		};
-
-		mux3: mux3@60 {
-			#clock-cells = <0>;
-			reg = <0x60 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-			clock-output-names = "cmux3";
-		};
-
-		mux4: mux4@80 {
-			#clock-cells = <0>;
-			reg = <0x80 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll2 0>, <&pll2 1>, <&pll3 0>, <&pll3 1>;
-			clock-names = "pll2", "pll2-div2", "pll3", "pll3-div2";
-			clock-output-names = "cmux4";
-		};
-
-		mux5: mux5@a0 {
-			#clock-cells = <0>;
-			reg = <0xa0 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll2 0>, <&pll2 1>, <&pll3 0>, <&pll3 1>;
-			clock-names = "pll2", "pll2-div2", "pll3", "pll3-div2";
-			clock-output-names = "cmux5";
-		};
-
-		mux6: mux6@c0 {
-			#clock-cells = <0>;
-			reg = <0xc0 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll2 0>, <&pll2 1>, <&pll3 0>, <&pll3 1>;
-			clock-names = "pll2", "pll2-div2", "pll3", "pll3-div2";
-			clock-output-names = "cmux6";
-		};
-
-		mux7: mux7@e0 {
-			#clock-cells = <0>;
-			reg = <0xe0 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll2 0>, <&pll2 1>, <&pll3 0>, <&pll3 1>;
-			clock-names = "pll2", "pll2-div2", "pll3", "pll3-div2";
-			clock-output-names = "cmux7";
-		};
 	};
 
 	rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
index d56a546..0a7c65a 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
@@ -94,7 +94,7 @@
 		cpu0: PowerPC,e500mc@0 {
 			device_type = "cpu";
 			reg = <0>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_0>;
 			fsl,portid-mapping = <0x80000000>;
 			L2_0: l2-cache {
@@ -104,7 +104,7 @@
 		cpu1: PowerPC,e500mc@1 {
 			device_type = "cpu";
 			reg = <1>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x40000000>;
 			L2_1: l2-cache {
@@ -114,7 +114,7 @@
 		cpu2: PowerPC,e500mc@2 {
 			device_type = "cpu";
 			reg = <2>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_2>;
 			fsl,portid-mapping = <0x20000000>;
 			L2_2: l2-cache {
@@ -124,7 +124,7 @@
 		cpu3: PowerPC,e500mc@3 {
 			device_type = "cpu";
 			reg = <3>;
-			clocks = <&mux3>;
+			clocks = <&clockgen 1 3>;
 			next-level-cache = <&L2_3>;
 			fsl,portid-mapping = <0x10000000>;
 			L2_3: l2-cache {
@@ -134,7 +134,7 @@
 		cpu4: PowerPC,e500mc@4 {
 			device_type = "cpu";
 			reg = <4>;
-			clocks = <&mux4>;
+			clocks = <&clockgen 1 4>;
 			next-level-cache = <&L2_4>;
 			fsl,portid-mapping = <0x08000000>;
 			L2_4: l2-cache {
@@ -144,7 +144,7 @@
 		cpu5: PowerPC,e500mc@5 {
 			device_type = "cpu";
 			reg = <5>;
-			clocks = <&mux5>;
+			clocks = <&clockgen 1 5>;
 			next-level-cache = <&L2_5>;
 			fsl,portid-mapping = <0x04000000>;
 			L2_5: l2-cache {
@@ -154,7 +154,7 @@
 		cpu6: PowerPC,e500mc@6 {
 			device_type = "cpu";
 			reg = <6>;
-			clocks = <&mux6>;
+			clocks = <&clockgen 1 6>;
 			next-level-cache = <&L2_6>;
 			fsl,portid-mapping = <0x02000000>;
 			L2_6: l2-cache {
@@ -164,7 +164,7 @@
 		cpu7: PowerPC,e500mc@7 {
 			device_type = "cpu";
 			reg = <7>;
-			clocks = <&mux7>;
+			clocks = <&clockgen 1 7>;
 			next-level-cache = <&L2_7>;
 			fsl,portid-mapping = <0x01000000>;
 			L2_7: l2-cache {
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
index bfba0b4..2d74ea8 100644
--- a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
@@ -96,7 +96,7 @@
 		cpu0: PowerPC,e5500@0 {
 			device_type = "cpu";
 			reg = <0>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_0>;
 			fsl,portid-mapping = <0x80000000>;
 			L2_0: l2-cache {
@@ -106,7 +106,7 @@
 		cpu1: PowerPC,e5500@1 {
 			device_type = "cpu";
 			reg = <1>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x40000000>;
 			L2_1: l2-cache {
diff --git a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
index e2bd931..16b454b 100644
--- a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
@@ -319,24 +319,6 @@
 /include/ "qoriq-clockgen1.dtsi"
 	global-utilities@e1000 {
 		compatible = "fsl,p5040-clockgen", "fsl,qoriq-clockgen-1.0";
-
-		mux2: mux2@40 {
-			#clock-cells = <0>;
-			reg = <0x40 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-			clock-output-names = "cmux2";
-		};
-
-		mux3: mux3@60 {
-			#clock-cells = <0>;
-			reg = <0x60 0x4>;
-			compatible = "fsl,qoriq-core-mux-1.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-			clock-output-names = "cmux3";
-		};
 	};
 
 	rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi
index dbd5775..ed89dbb 100644
--- a/arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi
@@ -102,7 +102,7 @@
 		cpu0: PowerPC,e5500@0 {
 			device_type = "cpu";
 			reg = <0>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_0>;
 			fsl,portid-mapping = <0x80000000>;
 			L2_0: l2-cache {
@@ -112,7 +112,7 @@
 		cpu1: PowerPC,e5500@1 {
 			device_type = "cpu";
 			reg = <1>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x40000000>;
 			L2_1: l2-cache {
@@ -122,7 +122,7 @@
 		cpu2: PowerPC,e5500@2 {
 			device_type = "cpu";
 			reg = <2>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_2>;
 			fsl,portid-mapping = <0x20000000>;
 			L2_2: l2-cache {
@@ -132,7 +132,7 @@
 		cpu3: PowerPC,e5500@3 {
 			device_type = "cpu";
 			reg = <3>;
-			clocks = <&mux3>;
+			clocks = <&clockgen 1 3>;
 			next-level-cache = <&L2_3>;
 			fsl,portid-mapping = <0x10000000>;
 			L2_3: l2-cache {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi
index 88cd70d..5c89cfa 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-clockgen1.dtsi
@@ -32,55 +32,16 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+sysclk: sysclk {
+	compatible = "fixed-clock";
+	#clock-cells = <0>;
+	clock-frequency = <100000000>;
+	clock-output-names = "sysclk";
+};
+
 clockgen: global-utilities@e1000 {
 	compatible = "fsl,qoriq-clockgen-1.0";
-	ranges = <0x0 0xe1000 0x1000>;
 	reg = <0xe1000 0x1000>;
-	clock-frequency = <0>;
-	#address-cells = <1>;
-	#size-cells = <1>;
 	#clock-cells = <2>;
-
-	sysclk: sysclk {
-		#clock-cells = <0>;
-		compatible = "fsl,qoriq-sysclk-1.0", "fixed-clock";
-		clock-output-names = "sysclk";
-	};
-	pll0: pll0@800 {
-		#clock-cells = <1>;
-		reg = <0x800 0x4>;
-		compatible = "fsl,qoriq-core-pll-1.0";
-		clocks = <&sysclk>;
-		clock-output-names = "pll0", "pll0-div2";
-	};
-	pll1: pll1@820 {
-		#clock-cells = <1>;
-		reg = <0x820 0x4>;
-		compatible = "fsl,qoriq-core-pll-1.0";
-		clocks = <&sysclk>;
-		clock-output-names = "pll1", "pll1-div2";
-	};
-	mux0: mux0@0 {
-		#clock-cells = <0>;
-		reg = <0x0 0x4>;
-		compatible = "fsl,qoriq-core-mux-1.0";
-		clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-		clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
-		clock-output-names = "cmux0";
-	};
-	mux1: mux1@20 {
-		#clock-cells = <0>;
-		reg = <0x20 0x4>;
-		compatible = "fsl,qoriq-core-mux-1.0";
-		clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
-		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";
-	};
+	clocks = <&sysclk>;
 };
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
index 6dfd7c5..bf649ce 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
@@ -32,38 +32,16 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+sysclk: sysclk {
+	compatible = "fixed-clock";
+	#clock-cells = <0>;
+	clock-frequency = <100000000>;
+	clock-output-names = "sysclk";
+};
+
 clockgen: global-utilities@e1000 {
 	compatible = "fsl,qoriq-clockgen-2.0";
-	ranges = <0x0 0xe1000 0x1000>;
 	reg = <0xe1000 0x1000>;
-	#address-cells = <1>;
-	#size-cells = <1>;
 	#clock-cells = <2>;
-
-	sysclk: sysclk {
-		#clock-cells = <0>;
-		compatible = "fsl,qoriq-sysclk-2.0", "fixed-clock";
-		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";
-	};
-	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";
-	};
+	clocks = <&sysclk>;
 };
diff --git a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
index 4908af5..d552044 100644
--- a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
@@ -345,22 +345,6 @@
 /include/ "qoriq-clockgen2.dtsi"
 	global-utilities@e1000 {
 		compatible = "fsl,t1023-clockgen", "fsl,qoriq-clockgen-2.0";
-		mux0: mux0@0 {
-			#clock-cells = <0>;
-			reg = <0x0 4>;
-			compatible = "fsl,core-mux-clock";
-			clocks = <&pll0 0>, <&pll0 1>;
-			clock-names = "pll0_0", "pll0_1";
-			clock-output-names = "cmux0";
-		};
-		mux1: mux1@20 {
-			#clock-cells = <0>;
-			reg = <0x20 4>;
-			compatible = "fsl,core-mux-clock";
-			clocks = <&pll0 0>, <&pll0 1>;
-			clock-names = "pll0_0", "pll0_1";
-			clock-output-names = "cmux1";
-		};
 	};
 
 	rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/t102xsi-pre.dtsi b/arch/powerpc/boot/dts/fsl/t102xsi-pre.dtsi
index 9d08a36..d87ea13 100644
--- a/arch/powerpc/boot/dts/fsl/t102xsi-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t102xsi-pre.dtsi
@@ -74,7 +74,7 @@
 		cpu0: PowerPC,e5500@0 {
 			device_type = "cpu";
 			reg = <0>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			#cooling-cells = <2>;
 			L2_1: l2-cache {
@@ -84,7 +84,7 @@
 		cpu1: PowerPC,e5500@1 {
 			device_type = "cpu";
 			reg = <1>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_2>;
 			#cooling-cells = <2>;
 			L2_2: l2-cache {
diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
index 145c7f4..315d055 100644
--- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
@@ -425,50 +425,6 @@
 /include/ "qoriq-clockgen2.dtsi"
 	global-utilities@e1000 {
 		compatible = "fsl,t1040-clockgen", "fsl,qoriq-clockgen-2.0";
-
-		mux0: mux0@0 {
-			#clock-cells = <0>;
-			reg = <0x0 4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				 <&pll1 0>, <&pll1 1>, <&pll1 2>;
-			clock-names = "pll0", "pll0-div2", "pll1-div4",
-				"pll1", "pll1-div2", "pll1-div4";
-			clock-output-names = "cmux0";
-		};
-
-		mux1: mux1@20 {
-			#clock-cells = <0>;
-			reg = <0x20 4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				 <&pll1 0>, <&pll1 1>, <&pll1 2>;
-			clock-names = "pll0", "pll0-div2", "pll1-div4",
-				"pll1", "pll1-div2", "pll1-div4";
-			clock-output-names = "cmux1";
-		};
-
-		mux2: mux2@40 {
-			#clock-cells = <0>;
-			reg = <0x40 4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				 <&pll1 0>, <&pll1 1>, <&pll1 2>;
-			clock-names = "pll0", "pll0-div2", "pll1-div4",
-				"pll1", "pll1-div2", "pll1-div4";
-			clock-output-names = "cmux2";
-		};
-
-		mux3: mux3@60 {
-			#clock-cells = <0>;
-			reg = <0x60 4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				 <&pll1 0>, <&pll1 1>, <&pll1 2>;
-			clock-names = "pll0_0", "pll0_1", "pll0_2",
-				"pll1_0", "pll1_1", "pll1_2";
-			clock-output-names = "cmux3";
-		};
 	};
 
 	rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi b/arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi
index 6db0ee8..dd59e4b 100644
--- a/arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi
@@ -74,7 +74,7 @@
 		cpu0: PowerPC,e5500@0 {
 			device_type = "cpu";
 			reg = <0>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			#cooling-cells = <2>;
 			L2_1: l2-cache {
@@ -84,7 +84,7 @@
 		cpu1: PowerPC,e5500@1 {
 			device_type = "cpu";
 			reg = <1>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_2>;
 			#cooling-cells = <2>;
 			L2_2: l2-cache {
@@ -94,7 +94,7 @@
 		cpu2: PowerPC,e5500@2 {
 			device_type = "cpu";
 			reg = <2>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_3>;
 			#cooling-cells = <2>;
 			L2_3: l2-cache {
@@ -104,7 +104,7 @@
 		cpu3: PowerPC,e5500@3 {
 			device_type = "cpu";
 			reg = <3>;
-			clocks = <&mux3>;
+			clocks = <&clockgen 1 3>;
 			next-level-cache = <&L2_4>;
 			#cooling-cells = <2>;
 			L2_4: l2-cache {
diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
index a97296c..ecbb447 100644
--- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
@@ -535,28 +535,6 @@
 /include/ "qoriq-clockgen2.dtsi"
 	global-utilities@e1000 {
 		compatible = "fsl,t2080-clockgen", "fsl,qoriq-clockgen-2.0";
-
-		mux0: mux0@0 {
-			#clock-cells = <0>;
-			reg = <0x0 4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				 <&pll1 0>, <&pll1 1>, <&pll1 2>;
-			clock-names = "pll0", "pll0-div2", "pll0-div4",
-				"pll1", "pll1-div2", "pll1-div4";
-			clock-output-names = "cmux0";
-		};
-
-		mux1: mux1@20 {
-			#clock-cells = <0>;
-			reg = <0x20 4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				 <&pll1 0>, <&pll1 1>, <&pll1 2>;
-			clock-names = "pll0", "pll0-div2", "pll0-div4",
-				"pll1", "pll1-div2", "pll1-div4";
-			clock-output-names = "cmux1";
-		};
 	};
 
 	rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi b/arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi
index c2e5720..3f745de 100644
--- a/arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi
@@ -81,28 +81,28 @@
 		cpu0: PowerPC,e6500@0 {
 			device_type = "cpu";
 			reg = <0 1>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu1: PowerPC,e6500@2 {
 			device_type = "cpu";
 			reg = <2 3>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu2: PowerPC,e6500@4 {
 			device_type = "cpu";
 			reg = <4 5>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu3: PowerPC,e6500@6 {
 			device_type = "cpu";
 			reg = <6 7>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
index 68c4ead..fcac734 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
@@ -950,67 +950,6 @@
 /include/ "qoriq-clockgen2.dtsi"
 	global-utilities@e1000 {
 		compatible = "fsl,t4240-clockgen", "fsl,qoriq-clockgen-2.0";
-
-		pll2: pll2@840 {
-			#clock-cells = <1>;
-			reg = <0x840 0x4>;
-			compatible = "fsl,qoriq-core-pll-2.0";
-			clocks = <&sysclk>;
-			clock-output-names = "pll2", "pll2-div2", "pll2-div4";
-		};
-
-		pll3: pll3@860 {
-			#clock-cells = <1>;
-			reg = <0x860 0x4>;
-			compatible = "fsl,qoriq-core-pll-2.0";
-			clocks = <&sysclk>;
-			clock-output-names = "pll3", "pll3-div2", "pll3-div4";
-		};
-
-		pll4: pll4@880 {
-			#clock-cells = <1>;
-			reg = <0x880 0x4>;
-			compatible = "fsl,qoriq-core-pll-2.0";
-			clocks = <&sysclk>;
-			clock-output-names = "pll4", "pll4-div2", "pll4-div4";
-		};
-
-		mux0: mux0@0 {
-			#clock-cells = <0>;
-			reg = <0x0 0x4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				<&pll1 0>, <&pll1 1>, <&pll1 2>,
-				<&pll2 0>, <&pll2 1>, <&pll2 2>;
-			clock-names = "pll0", "pll0-div2", "pll0-div4",
-				"pll1", "pll1-div2", "pll1-div4",
-				"pll2", "pll2-div2", "pll2-div4";
-			clock-output-names = "cmux0";
-		};
-
-		mux1: mux1@20 {
-			#clock-cells = <0>;
-			reg = <0x20 0x4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
-				<&pll1 0>, <&pll1 1>, <&pll1 2>,
-				<&pll2 0>, <&pll2 1>, <&pll2 2>;
-			clock-names = "pll0", "pll0-div2", "pll0-div4",
-				"pll1", "pll1-div2", "pll1-div4",
-				"pll2", "pll2-div2", "pll2-div4";
-			clock-output-names = "cmux1";
-		};
-
-		mux2: mux2@40 {
-			#clock-cells = <0>;
-			reg = <0x40 0x4>;
-			compatible = "fsl,qoriq-core-mux-2.0";
-			clocks = <&pll3 0>, <&pll3 1>, <&pll3 2>,
-				<&pll4 0>, <&pll4 1>, <&pll4 2>;
-			clock-names = "pll3", "pll3-div2", "pll3-div4",
-				"pll4", "pll4-div2", "pll4-div4";
-			clock-output-names = "cmux2";
-		};
 	};
 
 	rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi
index 038cf8f..632314c 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi
@@ -90,84 +90,84 @@
 		cpu0: PowerPC,e6500@0 {
 			device_type = "cpu";
 			reg = <0 1>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu1: PowerPC,e6500@2 {
 			device_type = "cpu";
 			reg = <2 3>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu2: PowerPC,e6500@4 {
 			device_type = "cpu";
 			reg = <4 5>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu3: PowerPC,e6500@6 {
 			device_type = "cpu";
 			reg = <6 7>;
-			clocks = <&mux0>;
+			clocks = <&clockgen 1 0>;
 			next-level-cache = <&L2_1>;
 			fsl,portid-mapping = <0x80000000>;
 		};
 		cpu4: PowerPC,e6500@8 {
 			device_type = "cpu";
 			reg = <8 9>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_2>;
 			fsl,portid-mapping = <0x40000000>;
 		};
 		cpu5: PowerPC,e6500@10 {
 			device_type = "cpu";
 			reg = <10 11>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_2>;
 			fsl,portid-mapping = <0x40000000>;
 		};
 		cpu6: PowerPC,e6500@12 {
 			device_type = "cpu";
 			reg = <12 13>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_2>;
 			fsl,portid-mapping = <0x40000000>;
 		};
 		cpu7: PowerPC,e6500@14 {
 			device_type = "cpu";
 			reg = <14 15>;
-			clocks = <&mux1>;
+			clocks = <&clockgen 1 1>;
 			next-level-cache = <&L2_2>;
 			fsl,portid-mapping = <0x40000000>;
 		};
 		cpu8: PowerPC,e6500@16 {
 			device_type = "cpu";
 			reg = <16 17>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_3>;
 			fsl,portid-mapping = <0x20000000>;
 		};
 		cpu9: PowerPC,e6500@18 {
 			device_type = "cpu";
 			reg = <18 19>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_3>;
 			fsl,portid-mapping = <0x20000000>;
 		};
 		cpu10: PowerPC,e6500@20 {
 			device_type = "cpu";
 			reg = <20 21>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_3>;
 			fsl,portid-mapping = <0x20000000>;
 		};
 		cpu11: PowerPC,e6500@22 {
 			device_type = "cpu";
 			reg = <22 23>;
-			clocks = <&mux2>;
+			clocks = <&clockgen 1 2>;
 			next-level-cache = <&L2_3>;
 			fsl,portid-mapping = <0x20000000>;
 		};
-- 
1.7.1


^ permalink raw reply related

* Re: [PATCH 2/2] selftests/powerpc: Skip test instead of failing
From: Michael Ellerman @ 2018-10-31  9:41 UTC (permalink / raw)
  To: Tyrel Datwyler, Breno Leitao, linuxppc-dev; +Cc: Thiago Jung Bauermann
In-Reply-To: <56cdd832-6229-bf95-58ee-1783f931e7bd@linux.vnet.ibm.com>

Tyrel Datwyler <tyreld@linux.vnet.ibm.com> writes:
> On 10/23/2018 01:23 PM, Breno Leitao wrote:
>> Current core-pkey selftest fails if the test runs without privileges to
>> write into the core pattern file (/proc/sys/kernel/core_pattern). This
>> causes the test to fail and give the impression that the subsystem being
>> tested is broken, when, in fact, the test is being executed without the
>> proper privileges. This is the current error:
>> 
>> 	test: core_pkey
>> 	tags: git_version:v4.19-3-g9e3363be9bce-dirty
>> 	Error writing to core_pattern file: Permission denied
>> 	failure: core_pkey
>> 
>> This patch simply skips this test if it runs without the proper privileges,
>> avoiding this undesired failure.
>> 
>> CC: Thiago Jung Bauermann <bauerman@linux.ibm.com>
>> Signed-off-by: Breno Leitao <leitao@debian.org>
>> ---
>>  tools/testing/selftests/powerpc/ptrace/core-pkey.c | 10 ++--------
>>  1 file changed, 2 insertions(+), 8 deletions(-)
>> 
>> diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powerpc/ptrace/core-pkey.c
>> index e23e2e199eb4..e07949120fc8 100644
>> --- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c
>> +++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c
>> @@ -352,17 +352,11 @@ static int write_core_pattern(const char *core_pattern)
>>  	FILE *f;
>> 
>>  	f = fopen(core_pattern_file, "w");
>> -	if (!f) {
>> -		perror("Error writing to core_pattern file");
>> -		return TEST_FAIL;
>> -	}
>> +	SKIP_IF(!f);
>> 
>>  	ret = fwrite(core_pattern, 1, len, f);
>>  	fclose(f);
>> -	if (ret != len) {
>> -		perror("Error writing to core_pattern file");
>> -		return TEST_FAIL;
>> -	}
>> +	SKIP_IF(ret != len);
>
> If we don't have proper privileges we should fail on the open, right?
> So wouldn't we still want to fail on the write if something goes
> wrong?

Yes you're right. If we don't have permission then the open should have
failed, and we skip then.

But if the open succeeded and the write fails then we don't know what's
going on and the test should fail.

cheers

^ permalink raw reply

* Re: [PATCH 2/2] selftests/powerpc: Skip test instead of failing
From: Michael Ellerman @ 2018-10-31  9:42 UTC (permalink / raw)
  To: Tyrel Datwyler, Thiago Jung Bauermann, Breno Leitao
  Cc: linuxppc-dev, Tyrel Datwyler
In-Reply-To: <fd8d4568-c69c-5e90-27f6-574a4bc88d2c@linux.vnet.ibm.com>

Tyrel Datwyler <tyreld@linux.vnet.ibm.com> writes:
> On 10/30/2018 08:16 AM, Michael Ellerman wrote:
>> Thiago Jung Bauermann <bauerman@linux.ibm.com> writes:
>> 
>>> Breno Leitao <leitao@debian.org> writes:
>>>
>>>> Hi Tyrel,
>>>>
>>>> On 10/23/2018 05:41 PM, Tyrel Datwyler wrote:
>>>>>> --- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c
>>>>>> +++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c
>>>>>> @@ -352,17 +352,11 @@ static int write_core_pattern(const char *core_pattern)
>>>>>>  	FILE *f;
>>>>>>
>>>>>>  	f = fopen(core_pattern_file, "w");
>>>>>> -	if (!f) {
>>>>>> -		perror("Error writing to core_pattern file");
>>>>>> -		return TEST_FAIL;
>>>>>> -	}
>>>>>> +	SKIP_IF(!f);
>>>>>>
>>>>>>  	ret = fwrite(core_pattern, 1, len, f);
>>>>>>  	fclose(f);
>>>>>> -	if (ret != len) {
>>>>>> -		perror("Error writing to core_pattern file");
>>>>>> -		return TEST_FAIL;
>>>>>> -	}
>>>>>> +	SKIP_IF(ret != len);
>>>>
>>>>> If we don't have proper privileges we should fail on the open, right?
>>>>> So wouldn't we still want to fail on the write if something goes
>>>>> wrong?
>>>>
>>>> That is a good point. Should the test fail or skip if it is not possible
>>>> to create the infrastructure to run the core test?
>>>>
>>>> Trying to find the answer in the current test sets, I find tests where
>>>> the self test skips if the test environment is not able to be set up, as
>>>> for example, when a memory allocation fails.
>>>>
>>>> File: tools/testing/selftests/powerpc/alignment/alignment_handler.c
>>>>
>>>>         ci1 = mmap(NULL, bufsize, PROT_WRITE, MAP_SHARED,
>>>>                    fd, bufsize);
>>>>         if ((ci0 == MAP_FAILED) || (ci1 == MAP_FAILED)) {
>>>>                 printf("\n");
>>>>                 perror("mmap failed");
>>>>                 SKIP_IF(1);
>>>>         }
>>>
>>> I think TEST_FAIL means the test was able to exercise the feature
>>> and found a problem with it. In this case, the test wasn't able to
>>> exercise the feature so it's not appropriate.
>>>
>>> Ideally, there should be a TEST_ERROR result for a case like this where
>>> an unexpected problem prevented the testcase from exercising the
>>> feature.
>>>
>>> If we're to use the an existing result then I vote for SKIP_IF.
>> 
>> Yeah I agree.
>> 
>> See for example some of the TM tests, which skip if TM is not available.
>> Or the alignment test which skips if it can't open /dev/fb0.
>> 
>> In this case it should print "you need to be root to run this" and then
>> skip.
>
> Agreed that there should be some indicator of why we are skipping the
> test. My original point I was trying to make was that I thought
> skipping a failed open was okay because we are likely not root.
> However, I wasn't sure that a failed write was okay to skip as that
> could be an indicator that something has actually been broken.

Yes I agree. I didn't read your mail closely enough. Have just replied
to it.

cheers

^ permalink raw reply

* Re: arch/powerpc/kvm/trace.h:9:0: error: "TRACE_INCLUDE_PATH" redefined
From: Christian Zigotzky @ 2018-10-31 10:09 UTC (permalink / raw)
  To: linuxppc-dev, kvm-ppc@vger.kernel.org
In-Reply-To: <009777be-1025-a309-2804-c76cd00d3947@xenosoft.de>

Hello,

I compiled the latest Git kernel today. The error 'TRACE_INCLUDE_PATH 
redefined' still exist.

Cheers,
Christian


On 29 October 2018 at 11:22AM, Christian Zigotzky wrote:
> Hello,
>
> The latest Git kernel doesn't compile currently because of the 
> following error:
>
>
> christian@christian-virtual-machine:~/Downloads/a$ env LANG=C make 
> CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc uImage
>   CALL    scripts/checksyscalls.sh
>   CHK     include/generated/compile.h
>   CALL    arch/powerpc/kernel/systbl_chk.sh
>   CC      arch/powerpc/kvm/powerpc.o
> In file included from arch/powerpc/kvm/powerpc.c:51:0:
> arch/powerpc/kvm/trace.h:9:0: error: "TRACE_INCLUDE_PATH" redefined 
> [-Werror]
>  #define TRACE_INCLUDE_PATH .
>  ^
> In file included from arch/powerpc/kvm/../mm/mmu_decl.h:25:0,
>                  from arch/powerpc/kvm/powerpc.c:48:
> ./arch/powerpc/include/asm/trace.h:224:0: note: this is the location 
> of the previous definition
>  #define TRACE_INCLUDE_PATH asm
>  ^
> cc1: all warnings being treated as errors
> scripts/Makefile.build:305: recipe for target 
> 'arch/powerpc/kvm/powerpc.o' failed
> make[2]: *** [arch/powerpc/kvm/powerpc.o] Error 1
> scripts/Makefile.build:546: recipe for target 'arch/powerpc/kvm' failed
> make[1]: *** [arch/powerpc/kvm] Error 2
> Makefile:1052: recipe for target 'arch/powerpc' failed
> make: *** [arch/powerpc] Error 2
>
> ---
>
> I deleted the definition of 'TRACE_INCLUDE_PATH' in 
> 'arch/powerpc/kvm/trace.h'. After that the kernel compiled without any 
> problems.
>
> -- Christian
>


^ permalink raw reply

* RE: [PATCH 5/6] pci: layerscape: Add the EP mode support.
From: Xiaowei Bao @ 2018-10-31 10:38 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, bhelgaas@google.com, robh+dt@kernel.org,
	mark.rutland@arm.com, shawnguo@kernel.org, Leo Li,
	lorenzo.pieralisi@arm.com, arnd@arndb.de,
	gregkh@linuxfoundation.org, M.h. Lian, Mingkai Hu, Roy Zang,
	kstewart@linuxfoundation.org, cyrille.pitchen@free-electrons.com,
	pombredanne@nexb.com, shawn.lin@rock-chips.com,
	niklas.cassel@axis.com, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org
  Cc: Jiafei Pan
In-Reply-To: <a85a6900-2478-0750-6f33-2e787cf80d1d@ti.com>



-----Original Message-----
From: Kishon Vijay Abraham I <kishon@ti.com> 
Sent: 2018年10月31日 12:15
To: Xiaowei Bao <xiaowei.bao@nxp.com>; bhelgaas@google.com; robh+dt@kernel.org; mark.rutland@arm.com; shawnguo@kernel.org; Leo Li <leoyang.li@nxp.com>; lorenzo.pieralisi@arm.com; arnd@arndb.de; gregkh@linuxfoundation.org; M.h. Lian <minghuan.lian@nxp.com>; Mingkai Hu <mingkai.hu@nxp.com>; Roy Zang <roy.zang@nxp.com>; kstewart@linuxfoundation.org; cyrille.pitchen@free-electrons.com; pombredanne@nexb.com; shawn.lin@rock-chips.com; niklas.cassel@axis.com; linux-pci@vger.kernel.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linuxppc-dev@lists.ozlabs.org
Cc: Jiafei Pan <jiafei.pan@nxp.com>
Subject: Re: [PATCH 5/6] pci: layerscape: Add the EP mode support.

Hi,

On 31/10/18 8:03 AM, Xiaowei Bao wrote:
> 
> 
> -----Original Message-----
> From: Xiaowei Bao
> Sent: 2018年10月26日 17:19
> To: 'Kishon Vijay Abraham I' <kishon@ti.com>; bhelgaas@google.com; 
> robh+dt@kernel.org; mark.rutland@arm.com; shawnguo@kernel.org; Leo Li 
> <leoyang.li@nxp.com>; lorenzo.pieralisi@arm.com; arnd@arndb.de; 
> gregkh@linuxfoundation.org; M.h. Lian <minghuan.lian@nxp.com>; Mingkai 
> Hu <mingkai.hu@nxp.com>; Roy Zang <roy.zang@nxp.com>; 
> kstewart@linuxfoundation.org; cyrille.pitchen@free-electrons.com; 
> pombredanne@nexb.com; shawn.lin@rock-chips.com; 
> niklas.cassel@axis.com; linux-pci@vger.kernel.org; 
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; 
> linux-arm-kernel@lists.infradead.org; linuxppc-dev@lists.ozlabs.org
> Cc: Jiafei Pan <jiafei.pan@nxp.com>
> Subject: RE: [PATCH 5/6] pci: layerscape: Add the EP mode support.
> 
> 
> 
> -----Original Message-----
> From: Kishon Vijay Abraham I <kishon@ti.com>
> Sent: 2018年10月26日 13:29
> To: Xiaowei Bao <xiaowei.bao@nxp.com>; bhelgaas@google.com; 
> robh+dt@kernel.org; mark.rutland@arm.com; shawnguo@kernel.org; Leo Li 
> <leoyang.li@nxp.com>; lorenzo.pieralisi@arm.com; arnd@arndb.de; 
> gregkh@linuxfoundation.org; M.h. Lian <minghuan.lian@nxp.com>; Mingkai 
> Hu <mingkai.hu@nxp.com>; Roy Zang <roy.zang@nxp.com>; 
> kstewart@linuxfoundation.org; cyrille.pitchen@free-electrons.com; 
> pombredanne@nexb.com; shawn.lin@rock-chips.com; 
> niklas.cassel@axis.com; linux-pci@vger.kernel.org; 
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; 
> linux-arm-kernel@lists.infradead.org; linuxppc-dev@lists.ozlabs.org
> Subject: Re: [PATCH 5/6] pci: layerscape: Add the EP mode support.
> 
> Hi,
> 
> On Thursday 25 October 2018 04:39 PM, Xiaowei Bao wrote:
>> Add the PCIe EP mode support for layerscape platform.
>>
>> Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
>> ---
>>  drivers/pci/controller/dwc/Makefile            |    2 +-
>>  drivers/pci/controller/dwc/pci-layerscape-ep.c |  161
>> ++++++++++++++++++++++++
>>  2 files changed, 162 insertions(+), 1 deletions(-)  create mode
>> 100644 drivers/pci/controller/dwc/pci-layerscape-ep.c
>>
>> diff --git a/drivers/pci/controller/dwc/Makefile
>> b/drivers/pci/controller/dwc/Makefile
>> index 5d2ce72..b26d617 100644
>> --- a/drivers/pci/controller/dwc/Makefile
>> +++ b/drivers/pci/controller/dwc/Makefile
>> @@ -8,7 +8,7 @@ obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
>>  obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
>>  obj-$(CONFIG_PCIE_SPEAR13XX) += pcie-spear13xx.o
>>  obj-$(CONFIG_PCI_KEYSTONE) += pci-keystone-dw.o pci-keystone.o
>> -obj-$(CONFIG_PCI_LAYERSCAPE) += pci-layerscape.o
>> +obj-$(CONFIG_PCI_LAYERSCAPE) += pci-layerscape.o pci-layerscape-ep.o
>>  obj-$(CONFIG_PCIE_QCOM) += pcie-qcom.o
>>  obj-$(CONFIG_PCIE_ARMADA_8K) += pcie-armada8k.o
>>  obj-$(CONFIG_PCIE_ARTPEC6) += pcie-artpec6.o diff --git 
>> a/drivers/pci/controller/dwc/pci-layerscape-ep.c
>> b/drivers/pci/controller/dwc/pci-layerscape-ep.c
>> new file mode 100644
>> index 0000000..3b33bbc
>> --- /dev/null
>> +++ b/drivers/pci/controller/dwc/pci-layerscape-ep.c
>> @@ -0,0 +1,161 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * PCIe controller EP driver for Freescale Layerscape SoCs
>> + *
>> + * Copyright (C) 2018 NXP Semiconductor.
>> + *
>> + * Author: Xiaowei Bao <xiaowei.bao@nxp.com>  */
>> +
>> +#include <linux/kernel.h>
>> +#include <linux/init.h>
>> +#include <linux/of_pci.h>
>> +#include <linux/of_platform.h>
>> +#include <linux/of_address.h>
>> +#include <linux/pci.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/resource.h>
>> +
>> +#include "pcie-designware.h"
>> +
>> +#define PCIE_DBI2_OFFSET		0x1000	/* DBI2 base address*/
> 
> The base address should come from dt.
>> +
>> +struct ls_pcie_ep {
>> +	struct dw_pcie		*pci;
>> +};
>> +
>> +#define to_ls_pcie_ep(x)	dev_get_drvdata((x)->dev)
>> +
>> +static bool ls_pcie_is_bridge(struct ls_pcie_ep *pcie) {
>> +	struct dw_pcie *pci = pcie->pci;
>> +	u32 header_type;
>> +
>> +	header_type = ioread8(pci->dbi_base + PCI_HEADER_TYPE);
>> +	header_type &= 0x7f;
>> +
>> +	return header_type == PCI_HEADER_TYPE_BRIDGE; }
>> +
>> +static int ls_pcie_establish_link(struct dw_pcie *pci) {
>> +	return 0;
>> +}
> 
> There should be some way by which EP should tell RC that it is not configured yet. Are there no bits to control LTSSM state initialization or Configuration retry status enabling?
> [Xiaowei Bao] There have not bits to control LTSSM state to tell the RC it is configured. The start link is auto completed.
> [Xiaowei Bao] Hi Kishon, is there any advice?

If there is no HW support, I don't think anything could be done here. This could result in RC reading configuration space even before EP is fully initialized.
[Xiaowei Bao] The bootloader have initialized the EP device and set the config ready bit, and the kernel don't need to do anything. 
>> +
>> +static const struct dw_pcie_ops ls_pcie_ep_ops = {
>> +	.start_link = ls_pcie_establish_link, };
>> +
>> +static const struct of_device_id ls_pcie_ep_of_match[] = {
>> +	{ .compatible = "fsl,ls-pcie-ep",},
>> +	{ },
>> +};
>> +
>> +static void ls_pcie_ep_init(struct dw_pcie_ep *ep) {
>> +	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
>> +	struct pci_epc *epc = ep->epc;
>> +	enum pci_barno bar;
>> +
>> +	for (bar = BAR_0; bar <= BAR_5; bar++)
>> +		dw_pcie_ep_reset_bar(pci, bar);
>> +
>> +	epc->features |= EPC_FEATURE_NO_LINKUP_NOTIFIER; }
>> +
>> +static int ls_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
>> +				  enum pci_epc_irq_type type, u16 interrupt_num) {
>> +	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
>> +
>> +	switch (type) {
>> +	case PCI_EPC_IRQ_LEGACY:
>> +		return dw_pcie_ep_raise_legacy_irq(ep, func_no);
>> +	case PCI_EPC_IRQ_MSI:
>> +		return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
>> +	case PCI_EPC_IRQ_MSIX:
>> +		return dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num);
>> +	default:
>> +		dev_err(pci->dev, "UNKNOWN IRQ type\n");
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static struct dw_pcie_ep_ops pcie_ep_ops = {
>> +	.ep_init = ls_pcie_ep_init,
>> +	.raise_irq = ls_pcie_ep_raise_irq,
>> +};
>> +
>> +static int __init ls_add_pcie_ep(struct ls_pcie_ep *pcie,
>> +					struct platform_device *pdev)
>> +{
>> +	struct dw_pcie *pci = pcie->pci;
>> +	struct device *dev = pci->dev;
>> +	struct dw_pcie_ep *ep;
>> +	struct resource *res;
>> +	int ret;
>> +
>> +	ep = &pci->ep;
>> +	ep->ops = &pcie_ep_ops;
>> +
>> +	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space");
>> +	if (!res)
>> +		return -EINVAL;
>> +
>> +	ep->phys_base = res->start;
>> +	ep->addr_size = resource_size(res);
>> +
>> +	ret = dw_pcie_ep_init(ep);
>> +	if (ret) {
>> +		dev_err(dev, "failed to initialize endpoint\n");
>> +		return ret;
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static int __init ls_pcie_ep_probe(struct platform_device *pdev) {
>> +	struct device *dev = &pdev->dev;
>> +	struct dw_pcie *pci;
>> +	struct ls_pcie_ep *pcie;
>> +	struct resource *dbi_base;
>> +	int ret;
>> +
>> +	pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
>> +	if (!pcie)
>> +		return -ENOMEM;
>> +
>> +	pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL);
>> +	if (!pci)
>> +		return -ENOMEM;
>> +
>> +	dbi_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
>> +	pci->dbi_base = devm_pci_remap_cfg_resource(dev, dbi_base);
>> +	if (IS_ERR(pci->dbi_base))
>> +		return PTR_ERR(pci->dbi_base);
>> +
>> +	pci->dbi_base2 = pci->dbi_base + PCIE_DBI2_OFFSET;
>> +	pci->dev = dev;
>> +	pci->ops = &ls_pcie_ep_ops;
>> +	pcie->pci = pci;
>> +
>> +	if (ls_pcie_is_bridge(pcie))
>> +		return -ENODEV;
> 
> For an endpoint this condition should never occur. This should only mean, a wrong compatible has been used in dt.
> [Xiaowei Bao] This function is a way that can check the PCI controller whether work in EP mode, I think it is more safer. Of course, it can be removed.
> [Xiaowei Bao] Hi Kishon, is there any advice?

IMHO this check is not required.
[Xiaowei Bao] OK, I will remove this function in patch-v2.

Thanks
Kishon

^ permalink raw reply

* [PATCH] powerpc/mm: remove const type qualifier from function ‘pud_pfn’
From: Mathieu Malaterre @ 2018-10-31 11:03 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mathieu Malaterre, Paul Mackerras, linuxppc-dev, linux-kernel

Type qualifier on return type is ignored. Remove warning in W=1:

  arch/powerpc/include/asm/book3s/64/pgtable.h:1268:25: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 6c99e846a8c9..2e6ada28da64 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -1304,7 +1304,7 @@ static inline int pgd_devmap(pgd_t pgd)
 }
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
-static inline const int pud_pfn(pud_t pud)
+static inline int pud_pfn(pud_t pud)
 {
 	/*
 	 * Currently all calls to pud_pfn() are gated around a pud_devmap()
-- 
2.11.0


^ permalink raw reply related

* [PATCH] powerpc/32: Add .data..Lubsan_data*/.data..Lubsan_type* sections explicitly
From: Mathieu Malaterre @ 2018-10-31 12:31 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mathieu Malaterre, Paul Mackerras, linuxppc-dev, linux-kernel

When both `CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y` and `CONFIG_UBSAN=y`
are set, link step typically produce numberous warnings about orphan
section:

  + powerpc-linux-gnu-ld -EB -m elf32ppc -Bstatic --orphan-handling=warn --build-id --gc-sections -X -o .tmp_vmlinux1 -T ./arch/powerpc/kernel/vmlinux.lds --who
  le-archive built-in.a --no-whole-archive --start-group lib/lib.a --end-group
  powerpc-linux-gnu-ld: warning: orphan section `.data..Lubsan_data393' from `init/main.o' being placed in section `.data..Lubsan_data393'.
  powerpc-linux-gnu-ld: warning: orphan section `.data..Lubsan_data394' from `init/main.o' being placed in section `.data..Lubsan_data394'.
  ...
  powerpc-linux-gnu-ld: warning: orphan section `.data..Lubsan_type11' from `init/main.o' being placed in section `.data..Lubsan_type11'.
  powerpc-linux-gnu-ld: warning: orphan section `.data..Lubsan_type12' from `init/main.o' being placed in section `.data..Lubsan_type12'.
  ...

This commit remove those warnings produced at W=1.

Link: https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg135407.html
Suggested-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/vmlinux.lds.S | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 434581bcd5b4..1148c3c60c3b 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -308,6 +308,10 @@ SECTIONS
 #ifdef CONFIG_PPC32
 	.data : AT(ADDR(.data) - LOAD_OFFSET) {
 		DATA_DATA
+#ifdef CONFIG_UBSAN
+		*(.data..Lubsan_data*)
+		*(.data..Lubsan_type*)
+#endif
 		*(.data.rel*)
 		*(SDATA_MAIN)
 		*(.sdata2)
-- 
2.11.0


^ permalink raw reply related

* Re: NXP P50XX/e5500: SMP doesn't work anymore with the latest Git kernel
From: Michael Ellerman @ 2018-10-31 13:20 UTC (permalink / raw)
  To: Christian Zigotzky, linuxppc-dev
In-Reply-To: <ac15715d-5335-da80-6d1c-1d558fb3cebd@xenosoft.de>

Christian Zigotzky <chzigotzky@xenosoft.de> writes:

> Little progress ...
>
> I reverted the following two OF files of the commit 'Merge tag 
> devicetree-for-4.20' and SMP works! The problematic code is somewhere in 
> these two files.
>
> a/include/linux/of.h
> a/drivers/of/base.c

Hi Christian,

Trying to debug things by reverting like this can work, but it's quite
error prone and is usually only used *after* a bisect has identified the
suspect code, or if a bisect can't work for some reason.

I know you said you'd had trouble bisecting in the past, but this one
should be a good one to practice on.

You already identified that the merge of the devicetree changes was the
problem, ie. 

  b27186abb37b Merge tag 'devicetree-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux


So you do:
  $ git show b27186abb37b 
  commit b27186abb37b7bd19e0ca434f4f425c807dbd708
  Merge: 0ef7791e2bfb d061864b89c3
  Author: Linus Torvalds <torvalds@linux-foundation.org>
  Date:   Fri Oct 26 12:09:58 2018 -0700
  
      Merge tag 'devicetree-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux


And that shows you the two commits that were merged 0ef7791e2bfb and
d061864b89c3. If you look at them you see:

  $ git log -1 --oneline 0ef7791e2bfb
  0ef7791e2bfb Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
   
  $ git log -1 --oneline d061864b89c3
  d061864b89c3 ARM: dt: relicense two DT binding IRQ headers

You can see that the first one is the previous commit on Linus' branch,
ie. an unrelated merge. The 2nd commit is the commit that was on top of
robh's tree, ie. that's the start of the interesting commits for us.

You can also get to that 2nd commit using b27186abb37b^2.

If you look at what came in via Rob's branch with:

  $ git log --oneline d061864b89c3
  or
  $ git log --oneline b27186abb37b^2

You see there's quite a few commits, and in particular there's another
merge:

  389d0a8a7af8 Merge branch 'dt/cpu-type-rework' into dt/next

If we log the 2nd parent of that, we see:

 $ git log --oneline 389d0a8a7af8^2
 4c29e5934f6c microblaze: get cpu node with of_get_cpu_node
 a691240e36e3 fbdev: fsl-diu: get cpu node with of_get_cpu_node
 651d44f9679c of: use for_each_of_cpu_node iterator
 a9a455e854cd iommu: fsl_pamu: use for_each_of_cpu_node iterator
 37dc218bed44 edac: cpc925: use for_each_of_cpu_node iterator
 76ec23b127cd clk: mvebu: use for_each_of_cpu_node iterator
 7de8f4aa2f35 x86: DT: use for_each_of_cpu_node iterator
 8cabf5bc1049 SH: use for_each_of_cpu_node iterator
 38959a091e4a powerpc: 8xx: get cpu node with of_get_cpu_node
 84dbc69a2ff3 powerpc: 4xx: get cpu node with of_get_cpu_node
 a94fe366340a powerpc: use for_each_of_cpu_node iterator
 5e5abae858b5 openrisc: use for_each_of_cpu_node iterator
 1f0fe1f67cef nios2: get cpu node with of_get_cpu_node
 5a931a3c80b5 c6x: use for_each_of_cpu_node iterator
 de76e70a8d4e arm64: use for_each_of_cpu_node iterator
 5af5d40c4015 ARM: shmobile: use for_each_of_cpu_node iterator
 07d44f1f82b7 ARM: topology: remove unneeded check for /cpus node
 d4866f751edf ARM: use for_each_of_cpu_node iterator
 6487c15f1cc9 of: Support matching cpu nodes with no 'reg' property
 f1f207e43b8a of: Add cpu node iterator for_each_of_cpu_node()
 f6707fd6241e of: make PowerMac cache node search conditional on CONFIG_PPC_PMAC
 6d0a70a284be vsprintf: print OF node name using full_name
 a613b26a5013 of: Convert to using %pOFn instead of device_node.name
 6901378c799d of/unittest: add printf tests for node name
 b610e2ff4622 of/unittest: remove use of node name pointer in overlay high level test
 57361846b52b (tag: v4.19-rc2) Linux 4.19-rc2


So if we think the suspect commit is in there, we would confirm that by
checking out v4.19-rc2 and testing it works. And then checkout out
4c29e5934f6c and testing that it's broken.

Assuming the former worked and the latter was broken, we do:

 $ git bisect good v4.19-rc2
 $ git bisect bad 4c29e5934f6c 

And then just follow the prompts.

One thing to watch out for is hitting an unrelated bug, that can
sometimes derail your bisection.

In this case the bug we're looking for is that CPU 1 isn't onlined
properly. But if the system doesn't boot entirely for example then you
shouldn't mark the commit as bad, instead it's better to skip it. Then
git will choose a different commit for you to test.

Anyway hope that helps.

cheers

> On 29 October 2018 at 6:00PM, Christian Zigotzky wrote:
>> Hello,
>>
>> I figured out that the problem is in the OF source code of the commit: 
>> Merge tag devicetree-for-4.20. [1]
>>
>> I reverted the following OF files and SMP works!
>>
>> drivers/of/base.c
>> drivers/of/device.c
>> drivers/of/of_mdio.c
>> drivers/of/of_numa.c
>> drivers/of/of_private.h
>> drivers/of/overlay.c
>> drivers/of/platform.c
>> drivers/of/unittest-data/overlay_15.dts
>> drivers/of/unittest-data/tests-overlay.dtsi
>> drivers/of/unittest.c
>> include/linux/of.h
>>
>> Cheers,
>> Christian
>>
>> [1] 
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b27186abb37b7bd19e0ca434f4f425c807dbd708
>>
>>
>> On 29 October 2018 at 10:56AM, Christian Zigotzky wrote:
>>> Hello,
>>>
>>> I have figured out that the commit 'devicetree-for-4.20' [1] is 
>>> responsible for the SMP problem. I was able to revert this commit 
>>> with 'git revert b27186abb37b7bd19e0ca434f4f425c807dbd708 -m 1' today.
>>>
>>> [master ec81438] Revert "Merge tag 'devicetree-for-4.20' of 
>>> git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux"
>>> 138 files changed, 931 insertions(+), 1538 deletions(-)
>>> rename Documentation/devicetree/bindings/arm/{atmel-sysregs.txt => 
>>> atmel-at91.txt} (67%)
>>> delete mode 100644 
>>> Documentation/devicetree/bindings/arm/freescale/fsl,layerscape-dcfg.txt
>>> delete mode 100644 
>>> Documentation/devicetree/bindings/arm/freescale/fsl,layerscape-scfg.txt
>>> rename Documentation/devicetree/bindings/arm/{zte,sysctrl.txt => 
>>> zte.txt} (62%)
>>> delete mode 100644 Documentation/devicetree/bindings/misc/lwn-bk4.txt
>>> create mode 100644 arch/c6x/boot/dts/linked_dtb.S
>>> delete mode 100644 arch/nios2/boot/dts/Makefile
>>> create mode 100644 arch/nios2/boot/linked_dtb.S
>>> delete mode 100644 arch/powerpc/boot/dts/Makefile
>>> delete mode 100644 arch/powerpc/boot/dts/fsl/Makefile
>>> delete mode 100644 scripts/dtc/yamltree.c
>>>
>>> It solves the SMP problem! SMP works again on my P5020 board and on 
>>> virtual e5500 QEMU machines.
>>>
>>> QEMU command: ./qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048 
>>> -kernel /home/christian/Downloads/uImage-4.20-alpha5 -drive 
>>> format=raw,file=/home/christian/Dokumente/ubuntu_MATE_16.04.3_LTS_PowerPC_QEMU/ubuntu_MATE_16.04_PowerPC.img,index=0,if=virtio 
>>> -nic user,model=e1000 -append "rw root=/dev/vda3" -device virtio-vga 
>>> -device virtio-mouse-pci -device virtio-keyboard-pci -soundhw es1370 
>>> -smp 4
>>>
>>> Screenshot: 
>>> https://plus.google.com/u/0/photos/photo/115515624056477014971/6617705776207990082
>>>
>>> Do we need a new dtb file or is it a bug?
>>>
>>> Thanks,
>>> Christian
>>>
>>> [1] 
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b27186abb37b7bd19e0ca434f4f425c807dbd708
>>>
>>>
>>> On 28 October 2018 at 5:35PM, Christian Zigotzky wrote:
>>>> Hello,
>>>>
>>>> SMP doesn't work anymore with the latest Git kernel (28/10/18 
>>>> 11:12AM GMT) on my P5020 board and on virtual e5500 QEMU machines.
>>>>
>>>> Board with P5020 dual core CPU:
>>>>
>>>> [    0.000000] -----------------------------------------------------
>>>> [    0.000000] phys_mem_size     = 0x200000000
>>>> [    0.000000] dcache_bsize      = 0x40
>>>> [    0.000000] icache_bsize      = 0x40
>>>> [    0.000000] cpu_features      = 0x00000003008003b4
>>>> [    0.000000]   possible        = 0x00000003009003b4
>>>> [    0.000000]   always          = 0x00000003008003b4
>>>> [    0.000000] cpu_user_features = 0xcc008000 0x08000000
>>>> [    0.000000] mmu_features      = 0x000a0010
>>>> [    0.000000] firmware_features = 0x0000000000000000
>>>> [    0.000000] -----------------------------------------------------
>>>> [    0.000000] CoreNet Generic board
>>>>
>>>>     ...
>>>>
>>>> [    0.002161] smp: Bringing up secondary CPUs ...
>>>> [    0.002339] No cpu-release-addr for cpu 1
>>>> [    0.002347] smp: failed starting cpu 1 (rc -2)
>>>> [    0.002401] smp: Brought up 1 node, 1 CPU
>>>>
>>>> Virtual e5500 quad core QEMU machine:
>>>>
>>>> [    0.026394] smp: Bringing up secondary CPUs ...
>>>> [    0.027831] No cpu-release-addr for cpu 1
>>>> [    0.027989] smp: failed starting cpu 1 (rc -2)
>>>> [    0.030143] No cpu-release-addr for cpu 2
>>>> [    0.030304] smp: failed starting cpu 2 (rc -2)
>>>> [    0.032400] No cpu-release-addr for cpu 3
>>>> [    0.032533] smp: failed starting cpu 3 (rc -2)
>>>> [    0.033117] smp: Brought up 1 node, 1 CPU
>>>>
>>>> QEMU command: ./qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048 
>>>> -kernel 
>>>> /home/christian/Downloads/vmlinux-4.20-alpha4-AmigaOne_X1000_X5000/X5000_and_QEMU_e5500/uImage-4.20 
>>>> -drive 
>>>> format=raw,file=/home/christian/Downloads/MATE_PowerPC_Remix_2017_0.9.img,index=0,if=virtio 
>>>> -nic user,model=e1000 -append "rw root=/dev/vda" -device virtio-vga 
>>>> -device virtio-mouse-pci -device virtio-keyboard-pci -usb -soundhw 
>>>> es1370 -smp 4
>>>>
>>>> .config:
>>>>
>>>> ...
>>>> CONFIG_SMP=y
>>>> CONFIG_NR_CPUS=4
>>>> ...
>>>>
>>>> Please test the latest Git kernel on your NXP P50XX boards.
>>>>
>>>> Thanks,
>>>> Christian
>>>>
>>>
>>>
>>
>>

^ permalink raw reply

* Re: NXP P50XX/e5500: SMP doesn't work anymore with the latest Git kernel
From: Christian Zigotzky @ 2018-10-31 13:38 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <87o9bafe12.fsf@concordia.ellerman.id.au>

Hi Michael,

Many thanks for this good explanation. I will try to learn more about 
bisecting. Sometimes the problem is the time. I usually work for a Linux 
first level support for our AmigaOne machines. That means my main work 
is end user support. Therefore I have to learn more about second and 
third level Linux support.

Cheers,
Christian

On 31 October 2018 at 2:20PM, Michael Ellerman wrote:
> Christian Zigotzky <chzigotzky@xenosoft.de> writes:
>
>> Little progress ...
>>
>> I reverted the following two OF files of the commit 'Merge tag
>> devicetree-for-4.20' and SMP works! The problematic code is somewhere in
>> these two files.
>>
>> a/include/linux/of.h
>> a/drivers/of/base.c
> Hi Christian,
>
> Trying to debug things by reverting like this can work, but it's quite
> error prone and is usually only used *after* a bisect has identified the
> suspect code, or if a bisect can't work for some reason.
>
> I know you said you'd had trouble bisecting in the past, but this one
> should be a good one to practice on.
>
> You already identified that the merge of the devicetree changes was the
> problem, ie.
>
>    b27186abb37b Merge tag 'devicetree-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
>
>
> So you do:
>    $ git show b27186abb37b
>    commit b27186abb37b7bd19e0ca434f4f425c807dbd708
>    Merge: 0ef7791e2bfb d061864b89c3
>    Author: Linus Torvalds <torvalds@linux-foundation.org>
>    Date:   Fri Oct 26 12:09:58 2018 -0700
>    
>        Merge tag 'devicetree-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
>
>
> And that shows you the two commits that were merged 0ef7791e2bfb and
> d061864b89c3. If you look at them you see:
>
>    $ git log -1 --oneline 0ef7791e2bfb
>    0ef7791e2bfb Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
>     
>    $ git log -1 --oneline d061864b89c3
>    d061864b89c3 ARM: dt: relicense two DT binding IRQ headers
>
> You can see that the first one is the previous commit on Linus' branch,
> ie. an unrelated merge. The 2nd commit is the commit that was on top of
> robh's tree, ie. that's the start of the interesting commits for us.
>
> You can also get to that 2nd commit using b27186abb37b^2.
>
> If you look at what came in via Rob's branch with:
>
>    $ git log --oneline d061864b89c3
>    or
>    $ git log --oneline b27186abb37b^2
>
> You see there's quite a few commits, and in particular there's another
> merge:
>
>    389d0a8a7af8 Merge branch 'dt/cpu-type-rework' into dt/next
>
> If we log the 2nd parent of that, we see:
>
>   $ git log --oneline 389d0a8a7af8^2
>   4c29e5934f6c microblaze: get cpu node with of_get_cpu_node
>   a691240e36e3 fbdev: fsl-diu: get cpu node with of_get_cpu_node
>   651d44f9679c of: use for_each_of_cpu_node iterator
>   a9a455e854cd iommu: fsl_pamu: use for_each_of_cpu_node iterator
>   37dc218bed44 edac: cpc925: use for_each_of_cpu_node iterator
>   76ec23b127cd clk: mvebu: use for_each_of_cpu_node iterator
>   7de8f4aa2f35 x86: DT: use for_each_of_cpu_node iterator
>   8cabf5bc1049 SH: use for_each_of_cpu_node iterator
>   38959a091e4a powerpc: 8xx: get cpu node with of_get_cpu_node
>   84dbc69a2ff3 powerpc: 4xx: get cpu node with of_get_cpu_node
>   a94fe366340a powerpc: use for_each_of_cpu_node iterator
>   5e5abae858b5 openrisc: use for_each_of_cpu_node iterator
>   1f0fe1f67cef nios2: get cpu node with of_get_cpu_node
>   5a931a3c80b5 c6x: use for_each_of_cpu_node iterator
>   de76e70a8d4e arm64: use for_each_of_cpu_node iterator
>   5af5d40c4015 ARM: shmobile: use for_each_of_cpu_node iterator
>   07d44f1f82b7 ARM: topology: remove unneeded check for /cpus node
>   d4866f751edf ARM: use for_each_of_cpu_node iterator
>   6487c15f1cc9 of: Support matching cpu nodes with no 'reg' property
>   f1f207e43b8a of: Add cpu node iterator for_each_of_cpu_node()
>   f6707fd6241e of: make PowerMac cache node search conditional on CONFIG_PPC_PMAC
>   6d0a70a284be vsprintf: print OF node name using full_name
>   a613b26a5013 of: Convert to using %pOFn instead of device_node.name
>   6901378c799d of/unittest: add printf tests for node name
>   b610e2ff4622 of/unittest: remove use of node name pointer in overlay high level test
>   57361846b52b (tag: v4.19-rc2) Linux 4.19-rc2
>
>
> So if we think the suspect commit is in there, we would confirm that by
> checking out v4.19-rc2 and testing it works. And then checkout out
> 4c29e5934f6c and testing that it's broken.
>
> Assuming the former worked and the latter was broken, we do:
>
>   $ git bisect good v4.19-rc2
>   $ git bisect bad 4c29e5934f6c
>
> And then just follow the prompts.
>
> One thing to watch out for is hitting an unrelated bug, that can
> sometimes derail your bisection.
>
> In this case the bug we're looking for is that CPU 1 isn't onlined
> properly. But if the system doesn't boot entirely for example then you
> shouldn't mark the commit as bad, instead it's better to skip it. Then
> git will choose a different commit for you to test.
>
> Anyway hope that helps.
>
> cheers
>
>> On 29 October 2018 at 6:00PM, Christian Zigotzky wrote:
>>> Hello,
>>>
>>> I figured out that the problem is in the OF source code of the commit:
>>> Merge tag devicetree-for-4.20. [1]
>>>
>>> I reverted the following OF files and SMP works!
>>>
>>> drivers/of/base.c
>>> drivers/of/device.c
>>> drivers/of/of_mdio.c
>>> drivers/of/of_numa.c
>>> drivers/of/of_private.h
>>> drivers/of/overlay.c
>>> drivers/of/platform.c
>>> drivers/of/unittest-data/overlay_15.dts
>>> drivers/of/unittest-data/tests-overlay.dtsi
>>> drivers/of/unittest.c
>>> include/linux/of.h
>>>
>>> Cheers,
>>> Christian
>>>
>>> [1]
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b27186abb37b7bd19e0ca434f4f425c807dbd708
>>>
>>>
>>> On 29 October 2018 at 10:56AM, Christian Zigotzky wrote:
>>>> Hello,
>>>>
>>>> I have figured out that the commit 'devicetree-for-4.20' [1] is
>>>> responsible for the SMP problem. I was able to revert this commit
>>>> with 'git revert b27186abb37b7bd19e0ca434f4f425c807dbd708 -m 1' today.
>>>>
>>>> [master ec81438] Revert "Merge tag 'devicetree-for-4.20' of
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux"
>>>> 138 files changed, 931 insertions(+), 1538 deletions(-)
>>>> rename Documentation/devicetree/bindings/arm/{atmel-sysregs.txt =>
>>>> atmel-at91.txt} (67%)
>>>> delete mode 100644
>>>> Documentation/devicetree/bindings/arm/freescale/fsl,layerscape-dcfg.txt
>>>> delete mode 100644
>>>> Documentation/devicetree/bindings/arm/freescale/fsl,layerscape-scfg.txt
>>>> rename Documentation/devicetree/bindings/arm/{zte,sysctrl.txt =>
>>>> zte.txt} (62%)
>>>> delete mode 100644 Documentation/devicetree/bindings/misc/lwn-bk4.txt
>>>> create mode 100644 arch/c6x/boot/dts/linked_dtb.S
>>>> delete mode 100644 arch/nios2/boot/dts/Makefile
>>>> create mode 100644 arch/nios2/boot/linked_dtb.S
>>>> delete mode 100644 arch/powerpc/boot/dts/Makefile
>>>> delete mode 100644 arch/powerpc/boot/dts/fsl/Makefile
>>>> delete mode 100644 scripts/dtc/yamltree.c
>>>>
>>>> It solves the SMP problem! SMP works again on my P5020 board and on
>>>> virtual e5500 QEMU machines.
>>>>
>>>> QEMU command: ./qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048
>>>> -kernel /home/christian/Downloads/uImage-4.20-alpha5 -drive
>>>> format=raw,file=/home/christian/Dokumente/ubuntu_MATE_16.04.3_LTS_PowerPC_QEMU/ubuntu_MATE_16.04_PowerPC.img,index=0,if=virtio
>>>> -nic user,model=e1000 -append "rw root=/dev/vda3" -device virtio-vga
>>>> -device virtio-mouse-pci -device virtio-keyboard-pci -soundhw es1370
>>>> -smp 4
>>>>
>>>> Screenshot:
>>>> https://plus.google.com/u/0/photos/photo/115515624056477014971/6617705776207990082
>>>>
>>>> Do we need a new dtb file or is it a bug?
>>>>
>>>> Thanks,
>>>> Christian
>>>>
>>>> [1]
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b27186abb37b7bd19e0ca434f4f425c807dbd708
>>>>
>>>>
>>>> On 28 October 2018 at 5:35PM, Christian Zigotzky wrote:
>>>>> Hello,
>>>>>
>>>>> SMP doesn't work anymore with the latest Git kernel (28/10/18
>>>>> 11:12AM GMT) on my P5020 board and on virtual e5500 QEMU machines.
>>>>>
>>>>> Board with P5020 dual core CPU:
>>>>>
>>>>> [    0.000000] -----------------------------------------------------
>>>>> [    0.000000] phys_mem_size     = 0x200000000
>>>>> [    0.000000] dcache_bsize      = 0x40
>>>>> [    0.000000] icache_bsize      = 0x40
>>>>> [    0.000000] cpu_features      = 0x00000003008003b4
>>>>> [    0.000000]   possible        = 0x00000003009003b4
>>>>> [    0.000000]   always          = 0x00000003008003b4
>>>>> [    0.000000] cpu_user_features = 0xcc008000 0x08000000
>>>>> [    0.000000] mmu_features      = 0x000a0010
>>>>> [    0.000000] firmware_features = 0x0000000000000000
>>>>> [    0.000000] -----------------------------------------------------
>>>>> [    0.000000] CoreNet Generic board
>>>>>
>>>>>      ...
>>>>>
>>>>> [    0.002161] smp: Bringing up secondary CPUs ...
>>>>> [    0.002339] No cpu-release-addr for cpu 1
>>>>> [    0.002347] smp: failed starting cpu 1 (rc -2)
>>>>> [    0.002401] smp: Brought up 1 node, 1 CPU
>>>>>
>>>>> Virtual e5500 quad core QEMU machine:
>>>>>
>>>>> [    0.026394] smp: Bringing up secondary CPUs ...
>>>>> [    0.027831] No cpu-release-addr for cpu 1
>>>>> [    0.027989] smp: failed starting cpu 1 (rc -2)
>>>>> [    0.030143] No cpu-release-addr for cpu 2
>>>>> [    0.030304] smp: failed starting cpu 2 (rc -2)
>>>>> [    0.032400] No cpu-release-addr for cpu 3
>>>>> [    0.032533] smp: failed starting cpu 3 (rc -2)
>>>>> [    0.033117] smp: Brought up 1 node, 1 CPU
>>>>>
>>>>> QEMU command: ./qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048
>>>>> -kernel
>>>>> /home/christian/Downloads/vmlinux-4.20-alpha4-AmigaOne_X1000_X5000/X5000_and_QEMU_e5500/uImage-4.20
>>>>> -drive
>>>>> format=raw,file=/home/christian/Downloads/MATE_PowerPC_Remix_2017_0.9.img,index=0,if=virtio
>>>>> -nic user,model=e1000 -append "rw root=/dev/vda" -device virtio-vga
>>>>> -device virtio-mouse-pci -device virtio-keyboard-pci -usb -soundhw
>>>>> es1370 -smp 4
>>>>>
>>>>> .config:
>>>>>
>>>>> ...
>>>>> CONFIG_SMP=y
>>>>> CONFIG_NR_CPUS=4
>>>>> ...
>>>>>
>>>>> Please test the latest Git kernel on your NXP P50XX boards.
>>>>>
>>>>> Thanks,
>>>>> Christian
>>>>>
>>>>
>>>


^ permalink raw reply

* Re: [PATCH v2 2/2] kgdb: Fix kgdb_roundup_cpus() for arches who used smp_call_function()
From: Peter Zijlstra @ 2018-10-31 13:49 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Kate Stewart, linux-mips, Rich Felker, linux-sh, Catalin Marinas,
	Will Deacon, linux-kernel, Paul Mackerras, Daniel Thompson,
	Yoshinori Sato, linux-hexagon, Russell King, kgdb-bugreport,
	James Hogan, linux-snps-arc, Jason Wessel, Thomas Gleixner,
	linux-arm-kernel, Vineet Gupta, Greg Kroah-Hartman, Ralf Baechle,
	Richard Kuo, Paul Burton, Philippe Ombredanne, linuxppc-dev
In-Reply-To: <20181030221843.121254-3-dianders@chromium.org>

On Tue, Oct 30, 2018 at 03:18:43PM -0700, Douglas Anderson wrote:
> Looking closely at it, it seems like a really bad idea to be calling
> local_irq_enable() in kgdb_roundup_cpus().  If nothing else that seems
> like it could violate spinlock semantics and cause a deadlock.
> 
> Instead, let's use a private csd alongside
> smp_call_function_single_async() to round up the other CPUs.  Using
> smp_call_function_single_async() doesn't require interrupts to be
> enabled so we can remove the offending bit of code.

You might want to mention that the only reason this isn't a deadlock
itself is because there is a timeout on waiting for the slaves to
check-in.

> --- a/kernel/debug/debug_core.c
> +++ b/kernel/debug/debug_core.c
> @@ -55,6 +55,7 @@
>  #include <linux/mm.h>
>  #include <linux/vmacache.h>
>  #include <linux/rcupdate.h>
> +#include <linux/irq.h>
>  
>  #include <asm/cacheflush.h>
>  #include <asm/byteorder.h>
> @@ -220,6 +221,39 @@ int __weak kgdb_skipexception(int exception, struct pt_regs *regs)
>  	return 0;
>  }
>  
> +/*
> + * Default (weak) implementation for kgdb_roundup_cpus
> + */
> +
> +static DEFINE_PER_CPU(call_single_data_t, kgdb_roundup_csd);
> +
> +void __weak kgdb_call_nmi_hook(void *ignored)
> +{
> +	kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
> +}
> +
> +void __weak kgdb_roundup_cpus(void)
> +{
> +	call_single_data_t *csd;
> +	int cpu;
> +
> +	for_each_cpu(cpu, cpu_online_mask) {
> +		csd = &per_cpu(kgdb_roundup_csd, cpu);
> +		smp_call_function_single_async(cpu, csd);
> +	}
> +}
> +
> +static void kgdb_generic_roundup_init(void)
> +{
> +	call_single_data_t *csd;
> +	int cpu;
> +
> +	for_each_possible_cpu(cpu) {
> +		csd = &per_cpu(kgdb_roundup_csd, cpu);
> +		csd->func = kgdb_call_nmi_hook;
> +	}
> +}
> +
>  /*
>   * Some architectures need cache flushes when we set/clear a
>   * breakpoint:
> @@ -993,6 +1027,8 @@ int kgdb_register_io_module(struct kgdb_io *new_dbg_io_ops)
>  		return -EBUSY;
>  	}
>  
> +	kgdb_generic_roundup_init();
> +
>  	if (new_dbg_io_ops->init) {
>  		err = new_dbg_io_ops->init();
>  		if (err) {

That's a little bit of overhead for those architectures not using that
generic code; but I suppose we can live with that.

^ permalink raw reply

* [PATCH v2] powerpc/mm: Remove extern from function definition
From: Breno Leitao @ 2018-10-31 14:24 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Breno Leitao

Function huge_ptep_set_access_flags() has the 'extern' keyword in the
function definition and also in the function declaration. This causes a
warning in 'sparse' since the 'extern' storage class should not be used
in the function definition.

	arch/powerpc/mm/pgtable.c:232:12: warning: function 'huge_ptep_set_access_flags' with external linkage has definition

This patch removes the keyword from the definition part. It also removes
the extern keyword from the declaration part, since checkpatch --strict
complains about it.

Suggested-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 arch/powerpc/include/asm/hugetlb.h | 6 +++---
 arch/powerpc/mm/pgtable.c          | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 383da1ab9e23..98004262bc87 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -135,9 +135,9 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
 }
 
 #define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
-extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
-				      unsigned long addr, pte_t *ptep,
-				      pte_t pte, int dirty);
+int huge_ptep_set_access_flags(struct vm_area_struct *vma,
+			       unsigned long addr, pte_t *ptep,
+			       pte_t pte, int dirty);
 
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index 010e1c616cb2..1e33dccbd176 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -221,9 +221,9 @@ int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
-extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
-				      unsigned long addr, pte_t *ptep,
-				      pte_t pte, int dirty)
+int huge_ptep_set_access_flags(struct vm_area_struct *vma,
+			       unsigned long addr, pte_t *ptep,
+			       pte_t pte, int dirty)
 {
 #ifdef HUGETLB_NEED_PRELOAD
 	/*
-- 
2.13.2


^ permalink raw reply related

* [PATCH v2 1/3] selftests/powerpc: Allocate base registers
From: Breno Leitao @ 2018-10-31 14:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Breno Leitao

Some ptrace selftests are passing input operands using a constraint that
can allocate any register for the operand, and using these registers on
load/store operations.

If the register allocated by the compiler happens to be zero (r0), it might
cause an invalid memory address access, since load and store operations
consider the content of 0x0 address if the base register is r0, instead of
the content of the r0 register. For example:

	r1 := 0xdeadbeef
	r0 := 0xdeadbeef

	ld r2, 0(1) /* will load into r2 the content of r1 address */
	ld r2, 0(0) /* will load into r2 the content of 0x0 */

In order to avoid this possible problem, the inline assembly constraint
should be aware that these registers will be used as a base register, thus,
r0 should not be allocated.

Other than that, this patch removes inline assembly operands that are not
used by the tests.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
---
 tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c        | 2 +-
 tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c     | 4 ++--
 tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c | 2 +-
 tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c | 3 +--
 tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c     | 2 +-
 tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar.c     | 2 +-
 tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c     | 3 +--
 7 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c b/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c
index 0b4ebcc2f485..ca29fafeed5d 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c
@@ -31,7 +31,7 @@ void gpr(void)
 		ASM_LOAD_GPR_IMMED(gpr_1)
 		ASM_LOAD_FPR_SINGLE_PRECISION(flt_1)
 		:
-		: [gpr_1]"i"(GPR_1), [flt_1] "r" (&a)
+		: [gpr_1]"i"(GPR_1), [flt_1] "b" (&a)
 		: "memory", "r6", "r7", "r8", "r9", "r10",
 		"r11", "r12", "r13", "r14", "r15", "r16", "r17",
 		"r18", "r19", "r20", "r21", "r22", "r23", "r24",
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c
index 59206b96e98a..a08a91594dbe 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c
@@ -59,8 +59,8 @@ void tm_gpr(void)
 		"3: ;"
 		: [res] "=r" (result), [texasr] "=r" (texasr)
 		: [gpr_1]"i"(GPR_1), [gpr_2]"i"(GPR_2),
-		[sprn_texasr] "i" (SPRN_TEXASR), [flt_1] "r" (&a),
-		[flt_2] "r" (&b), [cptr1] "r" (&cptr[1])
+		[sprn_texasr] "i" (SPRN_TEXASR), [flt_1] "b" (&a),
+		[flt_2] "b" (&b), [cptr1] "b" (&cptr[1])
 		: "memory", "r7", "r8", "r9", "r10",
 		"r11", "r12", "r13", "r14", "r15", "r16",
 		"r17", "r18", "r19", "r20", "r21", "r22",
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c
index b3c061dc9512..f47174746231 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c
@@ -72,7 +72,7 @@ void tm_spd_tar(void)
 		"3: ;"
 
 		: [res] "=r" (result), [texasr] "=r" (texasr)
-		: [val] "r" (cptr[1]), [sprn_dscr]"i"(SPRN_DSCR),
+		: [sprn_dscr]"i"(SPRN_DSCR),
 		[sprn_tar]"i"(SPRN_TAR), [sprn_ppr]"i"(SPRN_PPR),
 		[sprn_texasr]"i"(SPRN_TEXASR), [tar_1]"i"(TAR_1),
 		[dscr_1]"i"(DSCR_1), [tar_2]"i"(TAR_2), [dscr_2]"i"(DSCR_2),
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c
index 277dade1b382..18a685bf6a09 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c
@@ -77,8 +77,7 @@ void tm_spd_vsx(void)
 
 		"3: ;"
 		: [res] "=r" (result), [texasr] "=r" (texasr)
-		: [fp_load] "r" (fp_load), [fp_load_ckpt] "r" (fp_load_ckpt),
-		[sprn_texasr] "i"  (SPRN_TEXASR)
+		: [sprn_texasr] "i"  (SPRN_TEXASR)
 		: "memory", "r0", "r1", "r3", "r4",
 		"r7", "r8", "r9", "r10", "r11"
 		);
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c
index 51427a2465f6..ba04999254e3 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c
@@ -74,7 +74,7 @@ void tm_spr(void)
 
 		"3: ;"
 		: [tfhar] "=r" (tfhar), [res] "=r" (result),
-		[texasr] "=r" (texasr), [cptr1] "=r" (cptr1)
+		[texasr] "=r" (texasr), [cptr1] "=b" (cptr1)
 		: [sprn_texasr] "i"  (SPRN_TEXASR)
 		: "memory", "r0", "r8", "r31"
 		);
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar.c
index 48b462f75023..f70023b25e6e 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar.c
@@ -65,7 +65,7 @@ void tm_tar(void)
 		: [sprn_dscr]"i"(SPRN_DSCR), [sprn_tar]"i"(SPRN_TAR),
 		[sprn_ppr]"i"(SPRN_PPR), [sprn_texasr]"i"(SPRN_TEXASR),
 		[tar_1]"i"(TAR_1), [dscr_1]"i"(DSCR_1), [tar_2]"i"(TAR_2),
-		[dscr_2]"i"(DSCR_2), [cptr1] "r" (&cptr[1])
+		[dscr_2]"i"(DSCR_2), [cptr1] "b" (&cptr[1])
 		: "memory", "r0", "r1", "r3", "r4", "r5", "r6"
 		);
 
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c
index 17c23cabac3e..dfba80058977 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c
@@ -65,8 +65,7 @@ void tm_vsx(void)
 
 		"3: ;"
 		: [res] "=r" (result), [texasr] "=r" (texasr)
-		: [fp_load] "r" (fp_load), [fp_load_ckpt] "r" (fp_load_ckpt),
-		[sprn_texasr] "i"  (SPRN_TEXASR), [cptr1] "r" (&cptr[1])
+		: [sprn_texasr] "i"  (SPRN_TEXASR), [cptr1] "b" (&cptr[1])
 		: "memory", "r0", "r1", "r3", "r4",
 		"r7", "r8", "r9", "r10", "r11"
 		);
-- 
2.13.2


^ permalink raw reply related

* [PATCH v2 2/3] selftests/powerpc: Create a new SKIP_IF macro
From: Breno Leitao @ 2018-10-31 14:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540996702-27161-1-git-send-email-leitao@debian.org>

This patch creates a new macro that skips a test and prints a message to
stderr. This is useful to give an idea why the tests is being skipped,
other than just skipping the test blindly.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 tools/testing/selftests/powerpc/include/utils.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/testing/selftests/powerpc/include/utils.h b/tools/testing/selftests/powerpc/include/utils.h
index da1b963cdb32..486c1782c23e 100644
--- a/tools/testing/selftests/powerpc/include/utils.h
+++ b/tools/testing/selftests/powerpc/include/utils.h
@@ -72,6 +72,16 @@ do {								\
 	}							\
 } while (0)
 
+#define SKIP_IF_MSG(x, msg)					\
+do {								\
+	if ((x)) {						\
+		fprintf(stderr,					\
+		"[SKIP] Test skipped on line %d: %s\n",		\
+		 __LINE__, msg);				\
+		return MAGIC_SKIP_RETURN_VALUE;			\
+	}							\
+} while (0)
+
 #define _str(s) #s
 #define str(s) _str(s)
 
-- 
2.13.2


^ permalink raw reply related

* [PATCH v2 3/3] selftests/powerpc: Skip test instead of failing
From: Breno Leitao @ 2018-10-31 14:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Breno Leitao, Tyrel Datwyler, Thiago Jung Bauermann
In-Reply-To: <1540996702-27161-1-git-send-email-leitao@debian.org>

Current core-pkey selftest fails if the test runs without privileges to
write into the core pattern file (/proc/sys/kernel/core_pattern). This
causes the test to fail and give the impression that the subsystem being
tested is broken, when, in fact, the test is being executed without the
proper privileges. This is the current error:

	test: core_pkey
	tags: git_version:v4.19-3-g9e3363be9bce-dirty
	Error writing to core_pattern file: Permission denied
	failure: core_pkey

This patch simply skips this test if it runs without the proper privileges,
avoiding this undesired failure.

CC: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
CC: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 tools/testing/selftests/powerpc/ptrace/core-pkey.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powerpc/ptrace/core-pkey.c
index e23e2e199eb4..d5c64fee032d 100644
--- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c
+++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c
@@ -352,10 +352,7 @@ static int write_core_pattern(const char *core_pattern)
 	FILE *f;
 
 	f = fopen(core_pattern_file, "w");
-	if (!f) {
-		perror("Error writing to core_pattern file");
-		return TEST_FAIL;
-	}
+	SKIP_IF_MSG(!f, "Try with root privileges");
 
 	ret = fwrite(core_pattern, 1, len, f);
 	fclose(f);
-- 
2.13.2


^ permalink raw reply related

* Re: [PATCH 3/9] powerpc/mm: Remove extern from function definition
From: Breno Leitao @ 2018-10-31 14:43 UTC (permalink / raw)
  To: LEROY Christophe, mpe; +Cc: linuxppc-dev
In-Reply-To: <20181024171228.Horde.g2r8Qp5NqN_pn0TW6sUFCw6@messagerie.si.c-s.fr>

Hi Christophe,

On 10/24/18 12:12 PM, LEROY Christophe wrote:
> Breno Leitao <leitao@debian.org> a écrit :
> 
>> hi Christophe,
>>
>> On 10/23/2018 12:38 PM, LEROY Christophe wrote:
>>> Breno Leitao <leitao@debian.org> a écrit :
>>>>
>>>> This patch removes the keyword from the definition part, while keeps
>>>> it in
>>>> the declaration part.
>>>
>>> I think checkpatch also says that extern should be avoided in
>>> declarations.
>>
>> Thanks for the review. I tried to look at this complain, but I didn't see
>> this behavior on checkpatch.pl from kernel 4.19. I created a commit
>> that adds
>> a new extern prototype and checked the patch. Take a look:
> 
> Use option --strict with checkpatch.pl

Thanks. I fixed this patch and resent a v2 with this fix.

Michael,

If you happen to accept this series, please ignore this patch (3/9) and
use a v2 as its replacement:

https://patchwork.ozlabs.org/patch/991444/

^ permalink raw reply

* Re: [PATCH 1/9] aha152x: rename the PCMCIA define
From: Masahiro Yamada @ 2018-10-31 15:22 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-arch, linux-scsi, Linux Kbuild mailing list, linux-pci,
	Linux Kernel Mailing List, Dominik Brodowski, Alex Bounine,
	linuxppc-dev, linux-arm-kernel
In-Reply-To: <20181019120952.32763-2-hch@lst.de>

On Fri, Oct 19, 2018 at 9:10 PM Christoph Hellwig <hch@lst.de> wrote:
>
> We plan to enable building the PCMCIA core and drivers, and the
> non-prefixed PCMCIA name clashes with some arch headers.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Thomas Gleixner <tglx@linutronix.de>
> ---


Applied to linux-kbuild.




>  drivers/scsi/aha152x.c             | 14 +++++++-------
>  drivers/scsi/pcmcia/aha152x_core.c |  2 +-
>  2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
> index 4d7b0e0adbf7..301b3cad15f8 100644
> --- a/drivers/scsi/aha152x.c
> +++ b/drivers/scsi/aha152x.c
> @@ -269,7 +269,7 @@ static LIST_HEAD(aha152x_host_list);
>  /* DEFINES */
>
>  /* For PCMCIA cards, always use AUTOCONF */
> -#if defined(PCMCIA) || defined(MODULE)
> +#if defined(AHA152X_PCMCIA) || defined(MODULE)
>  #if !defined(AUTOCONF)
>  #define AUTOCONF
>  #endif
> @@ -297,7 +297,7 @@ CMD_INC_RESID(struct scsi_cmnd *cmd, int inc)
>
>  #define DELAY_DEFAULT 1000
>
> -#if defined(PCMCIA)
> +#if defined(AHA152X_PCMCIA)
>  #define IRQ_MIN 0
>  #define IRQ_MAX 16
>  #else
> @@ -328,7 +328,7 @@ MODULE_AUTHOR("Jürgen Fischer");
>  MODULE_DESCRIPTION(AHA152X_REVID);
>  MODULE_LICENSE("GPL");
>
> -#if !defined(PCMCIA)
> +#if !defined(AHA152X_PCMCIA)
>  #if defined(MODULE)
>  static int io[] = {0, 0};
>  module_param_hw_array(io, int, ioport, NULL, 0);
> @@ -391,7 +391,7 @@ static struct isapnp_device_id id_table[] = {
>  MODULE_DEVICE_TABLE(isapnp, id_table);
>  #endif /* ISAPNP */
>
> -#endif /* !PCMCIA */
> +#endif /* !AHA152X_PCMCIA */
>
>  static struct scsi_host_template aha152x_driver_template;
>
> @@ -863,7 +863,7 @@ void aha152x_release(struct Scsi_Host *shpnt)
>         if (shpnt->irq)
>                 free_irq(shpnt->irq, shpnt);
>
> -#if !defined(PCMCIA)
> +#if !defined(AHA152X_PCMCIA)
>         if (shpnt->io_port)
>                 release_region(shpnt->io_port, IO_RANGE);
>  #endif
> @@ -2924,7 +2924,7 @@ static struct scsi_host_template aha152x_driver_template = {
>         .slave_alloc                    = aha152x_adjust_queue,
>  };
>
> -#if !defined(PCMCIA)
> +#if !defined(AHA152X_PCMCIA)
>  static int setup_count;
>  static struct aha152x_setup setup[2];
>
> @@ -3392,4 +3392,4 @@ static int __init aha152x_setup(char *str)
>  __setup("aha152x=", aha152x_setup);
>  #endif
>
> -#endif /* !PCMCIA */
> +#endif /* !AHA152X_PCMCIA */
> diff --git a/drivers/scsi/pcmcia/aha152x_core.c b/drivers/scsi/pcmcia/aha152x_core.c
> index dba3716511c5..24b89228b241 100644
> --- a/drivers/scsi/pcmcia/aha152x_core.c
> +++ b/drivers/scsi/pcmcia/aha152x_core.c
> @@ -1,3 +1,3 @@
> -#define PCMCIA 1
> +#define AHA152X_PCMCIA 1
>  #define AHA152X_STAT 1
>  #include "aha152x.c"
> --
> 2.19.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply

* Re: [PATCH 3/9] powerpc: remove CONFIG_PCI_QSPAN
From: Masahiro Yamada @ 2018-10-31 15:27 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-arch, linux-scsi, Linux Kbuild mailing list, linux-pci,
	Linux Kernel Mailing List, Dominik Brodowski, Alex Bounine,
	linuxppc-dev, linux-arm-kernel
In-Reply-To: <20181019120952.32763-4-hch@lst.de>

On Fri, Oct 19, 2018 at 9:10 PM Christoph Hellwig <hch@lst.de> wrote:
>
> This option isn't actually used anywhere.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---


Applied to linux-kbuild.




>  arch/powerpc/Kconfig | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index a80669209155..e8c8970248bc 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -955,7 +955,6 @@ config PCI
>         bool "PCI support" if PPC_PCI_CHOICE
>         default y if !40x && !CPM2 && !PPC_8xx && !PPC_83xx \
>                 && !PPC_85xx && !PPC_86xx && !GAMECUBE_COMMON
> -       default PCI_QSPAN if PPC_8xx
>         select GENERIC_PCI_IOMAP
>         help
>           Find out whether your system includes a PCI bus. PCI is the name of
> @@ -969,14 +968,6 @@ config PCI_DOMAINS
>  config PCI_SYSCALL
>         def_bool PCI
>
> -config PCI_QSPAN
> -       bool "QSpan PCI"
> -       depends on PPC_8xx
> -       select PPC_I8259
> -       help
> -         Say Y here if you have a system based on a Motorola 8xx-series
> -         embedded processor with a QSPAN PCI interface, otherwise say N.
> -
>  config PCI_8260
>         bool
>         depends on PCI && 8260
> --
> 2.19.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply

* Re: [PATCH 4/9] powerpc: remove CONFIG_MCA leftovers
From: Masahiro Yamada @ 2018-10-31 15:31 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-arch, linux-scsi, Linux Kbuild mailing list, linux-pci,
	Linux Kernel Mailing List, Dominik Brodowski, Alex Bounine,
	linuxppc-dev, linux-arm-kernel
In-Reply-To: <20181019120952.32763-5-hch@lst.de>

On Fri, Oct 19, 2018 at 9:12 PM Christoph Hellwig <hch@lst.de> wrote:
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Thomas Gleixner <tglx@linutronix.de>
> ---

Applied to linux-kbuild.



>  arch/powerpc/Kconfig | 4 ----
>  drivers/scsi/Kconfig | 6 +++---
>  2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index e8c8970248bc..d4e97469a5f0 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -941,10 +941,6 @@ config FSL_GTM
>         help
>           Freescale General-purpose Timers support
>
> -# Yes MCA RS/6000s exist but Linux-PPC does not currently support any
> -config MCA
> -       bool
> -
>  # Platforms that what PCI turned unconditionally just do select PCI
>  # in their config node.  Platforms that want to choose at config
>  # time should select PPC_PCI_CHOICE
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index 7c097006c54d..d3734c54aec9 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig
> @@ -535,7 +535,7 @@ config SCSI_HPTIOP
>
>  config SCSI_BUSLOGIC
>         tristate "BusLogic SCSI support"
> -       depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API && VIRT_TO_BUS
> +       depends on (PCI || ISA) && SCSI && ISA_DMA_API && VIRT_TO_BUS
>         ---help---
>           This is support for BusLogic MultiMaster and FlashPoint SCSI Host
>           Adapters. Consult the SCSI-HOWTO, available from
> @@ -1142,12 +1142,12 @@ config SCSI_LPFC_DEBUG_FS
>
>  config SCSI_SIM710
>         tristate "Simple 53c710 SCSI support (Compaq, NCR machines)"
> -       depends on (EISA || MCA) && SCSI
> +       depends on EISA && SCSI
>         select SCSI_SPI_ATTRS
>         ---help---
>           This driver is for NCR53c710 based SCSI host adapters.
>
> -         It currently supports Compaq EISA cards and NCR MCA cards
> +         It currently supports Compaq EISA cards.
>
>  config SCSI_DC395x
>         tristate "Tekram DC395(U/UW/F) and DC315(U) SCSI support"
> --
> 2.19.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply

* Re: [PATCH 5/9] powerpc: PCI_MSI needs PCI
From: Masahiro Yamada @ 2018-10-31 15:33 UTC (permalink / raw)
  To: Josh Triplett
  Cc: linux-arch, linux-scsi, Linux Kbuild mailing list, linux-pci,
	Linux Kernel Mailing List, Dominik Brodowski, Alex Bounine,
	linuxppc-dev, Christoph Hellwig, linux-arm-kernel
In-Reply-To: <20181019151019.GA5618@localhost>

On Sat, Oct 20, 2018 at 12:10 AM Josh Triplett <josh@joshtriplett.org> wrote:
>
> On Fri, Oct 19, 2018 at 02:09:48PM +0200, Christoph Hellwig wrote:
> > Various powerpc boards select the PCI_MSI config option without selecting
> > PCI, resulting in potentially not compilable configurations if the by
> > default enabled PCI option is disabled.  Explicitly select PCI to ensure
> > we always have valid configs.
> [...]
> > --- a/arch/powerpc/platforms/44x/Kconfig
> > +++ b/arch/powerpc/platforms/44x/Kconfig
> > @@ -24,6 +24,7 @@ config BLUESTONE
> >       default n
> >       select PPC44x_SIMPLE
> >       select APM821xx
> > +     select PCI
> >       select PCI_MSI
> >       select PPC4xx_MSI
> >       select PPC4xx_PCI_EXPRESS
> > @@ -78,6 +79,7 @@ config KATMAI
> >       select 440SPe
> >       select PCI
> >       select PPC4xx_PCI_EXPRESS
> > +     select PCI
> >       select PCI_MSI
>
> This case already had PCI selected a couple of lines above.


Good catch!

I dropped this hunk,
and applied to linux-kbuild.





> >       select PPC4xx_MSI
> >       help
> > @@ -219,6 +221,7 @@ config AKEBONO
> >       select SWIOTLB
> >       select 476FPE
> >       select PPC4xx_PCI_EXPRESS
> > +     select PCI
> >       select PCI_MSI
> >       select PPC4xx_HSTA_MSI
> >       select I2C
> > --
> > 2.19.1
> >



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply

* Re: [PATCH] selftests: powerpc: Fix warning for security subdir
From: Naveen N. Rao @ 2018-10-31 15:38 UTC (permalink / raw)
  To: Joel Stanley, linuxppc-dev
In-Reply-To: <20181022120926.12797-1-joel@jms.id.au>

Joel Stanley wrote:
> typing 'make' inside tools/testing/selftests/powerpc gave a build
> warning:
> 
> BUILD_TARGET=tools/testing/selftests/powerpc/security; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C security all
> make[1]: Entering directory 'tools/testing/selftests/powerpc/security'
> ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory
> make[1]: *** No rule to make target '../../../../scripts/subarch.include'.
> make[1]: Failed to remake makefile '../../../../scripts/subarch.include'.
> 
> The build is one level deeper than lib.mk thinks it is. Set top_srcdir
> to set things straight.
> 
> Note that the test program is still built.
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Thanks.
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.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