All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] clk: qcom: Drop use of pxo/cxo_board for rpm devices
@ 2022-07-05 20:28 Christian Marangi
  2022-07-05 20:28 ` [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc Christian Marangi
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-05 20:28 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel
  Cc: Christian Marangi

Trying to convert every driver used by ipq806x to parent_data api, I notice
RPM was still using pxo_board clk.

pxo and pxo_board are the same clock and are defined just to handle old
clock definition. It was discovered that rpm is the last driver using
pxo_board instead of pxo.

While updating the rpm driver I notice the documentation was also wrong,
so this series also fix that.

Christian Marangi (5):
  dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc
  ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  clk: qcom: clk-rpm: convert to parent_data API
  ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064
  clk: qcom: gcc-ipq806x: remove cc_register_board for pxo and cxo

 .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
 arch/arm/boot/dts/qcom-apq8064.dtsi           |  2 +
 arch/arm/boot/dts/qcom-ipq8064.dtsi           |  4 +
 arch/arm/boot/dts/qcom-msm8660.dtsi           |  4 +-
 drivers/clk/qcom/clk-rpm.c                    | 24 ++++--
 drivers/clk/qcom/gcc-ipq806x.c                |  8 --
 6 files changed, 98 insertions(+), 21 deletions(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc
  2022-07-05 20:28 [PATCH 0/5] clk: qcom: Drop use of pxo/cxo_board for rpm devices Christian Marangi
@ 2022-07-05 20:28 ` Christian Marangi
  2022-07-06  7:43   ` Krzysztof Kozlowski
  2022-07-06  8:23   ` Dmitry Baryshkov
  2022-07-05 20:28 ` [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks Christian Marangi
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-05 20:28 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel
  Cc: Christian Marangi

qcom,rpmcc describe 2 different kind of device.
Currently we have definition for rpm-smd based device but we lack
Documentation for simple rpm based device.

Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and
provide and additional example.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
 1 file changed, 73 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
index 9d296b89a8d0..028eb0277495 100644
--- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
@@ -48,16 +48,65 @@ properties:
   '#clock-cells':
     const: 1
 
-  clocks:
-    maxItems: 1
+  clocks: true
 
-  clock-names:
-    const: xo
+  clock-names: true
 
 required:
   - compatible
   - '#clock-cells'
 
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - qcom,rpmcc-apq8060
+          - qcom,rpmcc-ipq806x
+          - qcom,rpmcc-msm8660
+
+then:
+  properties:
+    clocks:
+      description: pxo clock
+
+    clock-names:
+      const: pxo
+
+  required:
+    - clocks
+    - clock-names
+
+else:
+  if:
+    properties:
+      compatible:
+        contains:
+          const: qcom,rpmcc-apq8064
+  then:
+    properties:
+      clocks:
+        items:
+          - description: pxo clock
+          - description: cxo clock
+
+      clock-names:
+        items:
+          - const: pxo
+          - const: cxo
+
+    required:
+      - clocks
+      - clock-names
+
+  else:
+    properties:
+      clocks:
+        description: xo clock
+
+      clock-names:
+        const: xo
+
 additionalProperties: false
 
 examples:
@@ -73,3 +122,23 @@ examples:
             };
         };
     };
+
+  - |
+    rpm {
+        clock-controller {
+            compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
+            #clock-cells = <1>;
+            clocks = <&pxo_board>;
+            clock-names = "pxo";
+        };
+    };
+
+  - |
+    rpm {
+        clock-controller {
+            compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
+            #clock-cells = <1>;
+            clocks = <&pxo_board>, <&cxo_board>;
+            clock-names = "pxo", "cxo";
+        };
+    };
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  2022-07-05 20:28 [PATCH 0/5] clk: qcom: Drop use of pxo/cxo_board for rpm devices Christian Marangi
  2022-07-05 20:28 ` [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc Christian Marangi
@ 2022-07-05 20:28 ` Christian Marangi
  2022-07-06  7:35   ` Dmitry Baryshkov
  2022-07-06  7:44   ` Krzysztof Kozlowski
  2022-07-05 20:28 ` [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API Christian Marangi
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-05 20:28 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel
  Cc: Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the
required clocks.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 arch/arm/boot/dts/qcom-apq8064.dtsi | 2 ++
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
 arch/arm/boot/dts/qcom-msm8660.dtsi | 4 +++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi
index 91adcbd54b17..6a88e616ea01 100644
--- a/arch/arm/boot/dts/qcom-apq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-apq8064.dtsi
@@ -853,6 +853,8 @@ rpm@108000 {
 			rpmcc: clock-controller {
 				compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
 				#clock-cells = <1>;
+				clocks = <&pxo_board>, <&cxo_board>;
+				clock-names = "pxo", "cxo";
 			};
 
 			regulators {
diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
index 4b475d98343c..1425a4e4283f 100644
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -773,6 +773,8 @@ rpm: rpm@108000 {
 			rpmcc: clock-controller {
 				compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
 				#clock-cells = <1>;
+				clocks = <&pxo_board>;
+				clock-names = "pxo";
 			};
 		};
 
diff --git a/arch/arm/boot/dts/qcom-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi
index b9cded35b1cc..63a501c63cf8 100644
--- a/arch/arm/boot/dts/qcom-msm8660.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8660.dtsi
@@ -56,7 +56,7 @@ cxo_board {
 			clock-frequency = <19200000>;
 		};
 
-		pxo_board {
+		pxo_board: pxo_board {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <27000000>;
@@ -411,6 +411,8 @@ rpm: rpm@104000 {
 			rpmcc: clock-controller {
 				compatible = "qcom,rpmcc-msm8660", "qcom,rpmcc";
 				#clock-cells = <1>;
+				clocks = <&pxo_board>;
+				clock-names = "pxo";
 			};
 
 			pm8901-regulators {
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API
  2022-07-05 20:28 [PATCH 0/5] clk: qcom: Drop use of pxo/cxo_board for rpm devices Christian Marangi
  2022-07-05 20:28 ` [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc Christian Marangi
  2022-07-05 20:28 ` [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks Christian Marangi
@ 2022-07-05 20:28 ` Christian Marangi
  2022-07-06  8:27   ` Dmitry Baryshkov
  2022-07-06 13:26   ` Konrad Dybcio
  2022-07-05 20:28 ` [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064 Christian Marangi
  2022-07-05 20:28 ` [PATCH 5/5] clk: qcom: gcc-ipq806x: remove cc_register_board for pxo and cxo Christian Marangi
  4 siblings, 2 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-05 20:28 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel
  Cc: Christian Marangi

Convert clk-rpm driver to parent_data API and change parent names to cxo
and pxo instead of the board variant as pxo_board is an ancient name and
pxo should be used instead.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/qcom/clk-rpm.c b/drivers/clk/qcom/clk-rpm.c
index a18811c38018..d45a8b0fc97c 100644
--- a/drivers/clk/qcom/clk-rpm.c
+++ b/drivers/clk/qcom/clk-rpm.c
@@ -23,6 +23,14 @@
 #define QCOM_RPM_SCALING_ENABLE_ID			0x2
 #define QCOM_RPM_XO_MODE_ON				0x2
 
+static const struct clk_parent_data gcc_pxo[] = {
+	{ .fw_name = "pxo", .name = "pxo" },
+};
+
+static const struct clk_parent_data gcc_cxo[] = {
+	{ .fw_name = "cxo", .name = "cxo" },
+};
+
 #define DEFINE_CLK_RPM(_platform, _name, _active, r_id)			      \
 	static struct clk_rpm _platform##_##_active;			      \
 	static struct clk_rpm _platform##_##_name = {			      \
@@ -32,8 +40,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_ops,				      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "pxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	};								      \
 	static struct clk_rpm _platform##_##_active = {			      \
@@ -44,8 +52,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_ops,				      \
 			.name = #_active,				      \
-			.parent_names = (const char *[]){ "pxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	}
 
@@ -56,8 +64,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_xo_ops,			      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "cxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_cxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_cxo),		      \
 		},							      \
 	}
 
@@ -68,8 +76,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_fixed_ops,			      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "pxo" },	      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	}
 
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064
  2022-07-05 20:28 [PATCH 0/5] clk: qcom: Drop use of pxo/cxo_board for rpm devices Christian Marangi
                   ` (2 preceding siblings ...)
  2022-07-05 20:28 ` [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API Christian Marangi
@ 2022-07-05 20:28 ` Christian Marangi
  2022-07-06  8:29   ` Dmitry Baryshkov
  2022-07-06 13:24   ` Konrad Dybcio
  2022-07-05 20:28 ` [PATCH 5/5] clk: qcom: gcc-ipq806x: remove cc_register_board for pxo and cxo Christian Marangi
  4 siblings, 2 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-05 20:28 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel
  Cc: Christian Marangi

Drivers expect to call pxo/cxo_board clock as pxo/cxo.
Use clock-output-names to set the correct naming for these fixed clock
to save drivers that are migrating to parent_data and still use
parent_names.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
index 1425a4e4283f..720e27e29627 100644
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -302,12 +302,14 @@ cxo_board: cxo_board {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <25000000>;
+			clock-output-names = "cxo";
 		};
 
 		pxo_board: pxo_board {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <25000000>;
+			clock-output-names = "pxo";
 		};
 
 		sleep_clk: sleep_clk {
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 5/5] clk: qcom: gcc-ipq806x: remove cc_register_board for pxo and cxo
  2022-07-05 20:28 [PATCH 0/5] clk: qcom: Drop use of pxo/cxo_board for rpm devices Christian Marangi
                   ` (3 preceding siblings ...)
  2022-07-05 20:28 ` [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064 Christian Marangi
@ 2022-07-05 20:28 ` Christian Marangi
  4 siblings, 0 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-05 20:28 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel
  Cc: Christian Marangi

Now that these clock are defined as fixed clk in dts, we can drop the
register_board_clk for cxo_board and pxo_board in gcc_ipq806x_probe.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/clk/qcom/gcc-ipq806x.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/clk/qcom/gcc-ipq806x.c b/drivers/clk/qcom/gcc-ipq806x.c
index 718de17a1e60..883629de2751 100644
--- a/drivers/clk/qcom/gcc-ipq806x.c
+++ b/drivers/clk/qcom/gcc-ipq806x.c
@@ -3384,14 +3384,6 @@ static int gcc_ipq806x_probe(struct platform_device *pdev)
 	struct regmap *regmap;
 	int ret;
 
-	ret = qcom_cc_register_board_clk(dev, "cxo_board", "cxo", 25000000);
-	if (ret)
-		return ret;
-
-	ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 25000000);
-	if (ret)
-		return ret;
-
 	if (of_machine_is_compatible("qcom,ipq8065")) {
 		ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
 		ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  2022-07-05 20:28 ` [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks Christian Marangi
@ 2022-07-06  7:35   ` Dmitry Baryshkov
  2022-07-06  7:44   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2022-07-06  7:35 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Tue, 5 Jul 2022 at 23:56, Christian Marangi <ansuelsmth@gmail.com> wrote:
>
> Fix dtbs_check warning for new rpmcc Documentation changes and add the
> required clocks.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>  arch/arm/boot/dts/qcom-apq8064.dtsi | 2 ++
>  arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
>  arch/arm/boot/dts/qcom-msm8660.dtsi | 4 +++-
>  3 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi
> index 91adcbd54b17..6a88e616ea01 100644
> --- a/arch/arm/boot/dts/qcom-apq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-apq8064.dtsi
> @@ -853,6 +853,8 @@ rpm@108000 {
>                         rpmcc: clock-controller {
>                                 compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
>                                 #clock-cells = <1>;
> +                               clocks = <&pxo_board>, <&cxo_board>;
> +                               clock-names = "pxo", "cxo";
>                         };
>
>                         regulators {
> diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> index 4b475d98343c..1425a4e4283f 100644
> --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> @@ -773,6 +773,8 @@ rpm: rpm@108000 {
>                         rpmcc: clock-controller {
>                                 compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
>                                 #clock-cells = <1>;
> +                               clocks = <&pxo_board>;
> +                               clock-names = "pxo";
>                         };
>                 };
>
> diff --git a/arch/arm/boot/dts/qcom-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi
> index b9cded35b1cc..63a501c63cf8 100644
> --- a/arch/arm/boot/dts/qcom-msm8660.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8660.dtsi
> @@ -56,7 +56,7 @@ cxo_board {
>                         clock-frequency = <19200000>;
>                 };
>
> -               pxo_board {
> +               pxo_board: pxo_board {
>                         compatible = "fixed-clock";
>                         #clock-cells = <0>;
>                         clock-frequency = <27000000>;
> @@ -411,6 +411,8 @@ rpm: rpm@104000 {
>                         rpmcc: clock-controller {
>                                 compatible = "qcom,rpmcc-msm8660", "qcom,rpmcc";
>                                 #clock-cells = <1>;
> +                               clocks = <&pxo_board>;
> +                               clock-names = "pxo";
>                         };
>
>                         pm8901-regulators {
> --
> 2.36.1
>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc
  2022-07-05 20:28 ` [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc Christian Marangi
@ 2022-07-06  7:43   ` Krzysztof Kozlowski
  2022-07-06  8:23   ` Dmitry Baryshkov
  1 sibling, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-06  7:43 UTC (permalink / raw)
  To: Christian Marangi, Bjorn Andersson, Andy Gross, Konrad Dybcio,
	Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, linux-clk, devicetree,
	linux-kernel

On 05/07/2022 22:28, Christian Marangi wrote:
> qcom,rpmcc describe 2 different kind of device.
> Currently we have definition for rpm-smd based device but we lack
> Documentation for simple rpm based device.
> 
> Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and
> provide and additional example.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
>  1 file changed, 73 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> index 9d296b89a8d0..028eb0277495 100644
> --- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> +++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> @@ -48,16 +48,65 @@ properties:
>    '#clock-cells':
>      const: 1
>  
> -  clocks:
> -    maxItems: 1
> +  clocks: true
>  
> -  clock-names:
> -    const: xo
> +  clock-names: true

That's not correct way to describe these. Check other files, we've
already talked about this. You need min and maxItems here.

>  
>  required:
>    - compatible
>    - '#clock-cells'
>  
> +if:

allOf

> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - qcom,rpmcc-apq8060
> +          - qcom,rpmcc-ipq806x
> +          - qcom,rpmcc-msm8660
> +
> +then:
> +  properties:
> +    clocks:
> +      description: pxo clock
> +
> +    clock-names:
> +      const: pxo
> +
> +  required:
> +    - clocks
> +    - clock-names
> +
> +else:
> +  if:

No nested ifs.

> +    properties:
> +      compatible:
> +        contains:
> +          const: qcom,rpmcc-apq8064
> +  then:
> +    properties:
> +      clocks:
> +        items:
> +          - description: pxo clock
> +          - description: cxo clock
> +
> +      clock-names:
> +        items:
> +          - const: pxo
> +          - const: cxo
> +
> +    required:
> +      - clocks
> +      - clock-names
> +
> +  else:
> +    properties:
> +      clocks:
> +        description: xo clock
> +
> +      clock-names:
> +        const: xo
> +
>  additionalProperties: false
>  
>  examples:
> @@ -73,3 +122,23 @@ examples:
>              };
>          };
>      };
> +
> +  - |
> +    rpm {
> +        clock-controller {
> +            compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
> +            #clock-cells = <1>;
> +            clocks = <&pxo_board>;
> +            clock-names = "pxo";
> +        };
> +    };
> +
> +  - |
> +    rpm {
> +        clock-controller {
> +            compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
> +            #clock-cells = <1>;
> +            clocks = <&pxo_board>, <&cxo_board>;
> +            clock-names = "pxo", "cxo";
> +        };

These are the same. Provide examples only for blocks which are
significantly different.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  2022-07-05 20:28 ` [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks Christian Marangi
  2022-07-06  7:35   ` Dmitry Baryshkov
@ 2022-07-06  7:44   ` Krzysztof Kozlowski
  2022-07-06 10:20     ` Christian Marangi
  1 sibling, 1 reply; 24+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-06  7:44 UTC (permalink / raw)
  To: Christian Marangi, Bjorn Andersson, Andy Gross, Konrad Dybcio,
	Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, linux-clk, devicetree,
	linux-kernel

On 05/07/2022 22:28, Christian Marangi wrote:
> Fix dtbs_check warning for new rpmcc Documentation changes and add the
> required clocks.

There is no warning in the kernel, right? So the commit is not correct.

Only the second part of your sentence applies, but you should extend it.



Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc
  2022-07-05 20:28 ` [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc Christian Marangi
  2022-07-06  7:43   ` Krzysztof Kozlowski
@ 2022-07-06  8:23   ` Dmitry Baryshkov
  2022-07-06 10:19     ` Christian Marangi
  1 sibling, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2022-07-06  8:23 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Tue, 5 Jul 2022 at 23:56, Christian Marangi <ansuelsmth@gmail.com> wrote:
>
> qcom,rpmcc describe 2 different kind of device.
> Currently we have definition for rpm-smd based device but we lack
> Documentation for simple rpm based device.
>
> Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and
> provide and additional example.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
>  1 file changed, 73 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> index 9d296b89a8d0..028eb0277495 100644
> --- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> +++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
[,,,,]

> +
> +then:
> +  properties:
> +    clocks:
> +      description: pxo clock
> +
> +    clock-names:
> +      const: pxo
> +
> +  required:
> +    - clocks
> +    - clock-names

I don't think you can not mark these properties as required, older
schemas do not have them.

> +
> +else:
> +  if:
> +    properties:
> +      compatible:
> +        contains:
> +          const: qcom,rpmcc-apq8064
> +  then:
> +    properties:
> +      clocks:
> +        items:
> +          - description: pxo clock
> +          - description: cxo clock
[...]

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API
  2022-07-05 20:28 ` [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API Christian Marangi
@ 2022-07-06  8:27   ` Dmitry Baryshkov
  2022-07-06 10:21     ` Christian Marangi
  2022-07-06 13:26   ` Konrad Dybcio
  1 sibling, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2022-07-06  8:27 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Tue, 5 Jul 2022 at 23:56, Christian Marangi <ansuelsmth@gmail.com> wrote:
>
> Convert clk-rpm driver to parent_data API and change parent names to cxo
> and pxo instead of the board variant as pxo_board is an ancient name and
> pxo should be used instead.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/qcom/clk-rpm.c b/drivers/clk/qcom/clk-rpm.c
> index a18811c38018..d45a8b0fc97c 100644
> --- a/drivers/clk/qcom/clk-rpm.c
> +++ b/drivers/clk/qcom/clk-rpm.c
> @@ -23,6 +23,14 @@
>  #define QCOM_RPM_SCALING_ENABLE_ID                     0x2
>  #define QCOM_RPM_XO_MODE_ON                            0x2
>
> +static const struct clk_parent_data gcc_pxo[] = {
> +       { .fw_name = "pxo", .name = "pxo" },

This means that the core clock would look for the DT clock named 'pxo'
with the fallback to the global clock named 'pxo'. Fallback is
required to keep compatibility with older DT files, not having the
clocks/clock-names properties.
For all other platforms we were using as a fallback  the 'pxo_board'
clock (defined in the DT) rather than the 'pxo' (hackily injected by
the gcc driver).
I'd suggest following this pattern and using .fw_name = "pxo', .name =
"pxo_board".

Same applies to the CXO clock.

> +};
> +


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064
  2022-07-05 20:28 ` [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064 Christian Marangi
@ 2022-07-06  8:29   ` Dmitry Baryshkov
  2022-07-06 10:22     ` Christian Marangi
  2022-07-06 13:24   ` Konrad Dybcio
  1 sibling, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2022-07-06  8:29 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Tue, 5 Jul 2022 at 23:56, Christian Marangi <ansuelsmth@gmail.com> wrote:
>
> Drivers expect to call pxo/cxo_board clock as pxo/cxo.
> Use clock-output-names to set the correct naming for these fixed clock
> to save drivers that are migrating to parent_data and still use
> parent_names.

Please no. There is no reason to add these names. Let's follow the
example of other platforms.

>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> index 1425a4e4283f..720e27e29627 100644
> --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> @@ -302,12 +302,14 @@ cxo_board: cxo_board {
>                         compatible = "fixed-clock";
>                         #clock-cells = <0>;
>                         clock-frequency = <25000000>;
> +                       clock-output-names = "cxo";
>                 };
>
>                 pxo_board: pxo_board {
>                         compatible = "fixed-clock";
>                         #clock-cells = <0>;
>                         clock-frequency = <25000000>;
> +                       clock-output-names = "pxo";
>                 };
>
>                 sleep_clk: sleep_clk {
> --
> 2.36.1
>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc
  2022-07-06  8:23   ` Dmitry Baryshkov
@ 2022-07-06 10:19     ` Christian Marangi
  2022-07-06 11:58       ` Dmitry Baryshkov
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Marangi @ 2022-07-06 10:19 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Wed, Jul 06, 2022 at 11:23:46AM +0300, Dmitry Baryshkov wrote:
> On Tue, 5 Jul 2022 at 23:56, Christian Marangi <ansuelsmth@gmail.com> wrote:
> >
> > qcom,rpmcc describe 2 different kind of device.
> > Currently we have definition for rpm-smd based device but we lack
> > Documentation for simple rpm based device.
> >
> > Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and
> > provide and additional example.
> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> >  .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
> >  1 file changed, 73 insertions(+), 4 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> > index 9d296b89a8d0..028eb0277495 100644
> > --- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> > +++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> [,,,,]
> 
> > +
> > +then:
> > +  properties:
> > +    clocks:
> > +      description: pxo clock
> > +
> > +    clock-names:
> > +      const: pxo
> > +
> > +  required:
> > +    - clocks
> > +    - clock-names
> 
> I don't think you can not mark these properties as required, older
> schemas do not have them.
>

Well considering we changed rpmcc to parent_data and rpm clock require
pxo clock as parents it seems to be they should be required.

Actually no idea why this wasn't required before. Probably because this
schema described only rpm-smd and not old rpm?

> > +
> > +else:
> > +  if:
> > +    properties:
> > +      compatible:
> > +        contains:
> > +          const: qcom,rpmcc-apq8064
> > +  then:
> > +    properties:
> > +      clocks:
> > +        items:
> > +          - description: pxo clock
> > +          - description: cxo clock
> [...]
> 
> -- 
> With best wishes
> Dmitry

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  2022-07-06  7:44   ` Krzysztof Kozlowski
@ 2022-07-06 10:20     ` Christian Marangi
  2022-07-06 15:07       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Marangi @ 2022-07-06 10:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Wed, Jul 06, 2022 at 09:44:04AM +0200, Krzysztof Kozlowski wrote:
> On 05/07/2022 22:28, Christian Marangi wrote:
> > Fix dtbs_check warning for new rpmcc Documentation changes and add the
> > required clocks.
> 
> There is no warning in the kernel, right? So the commit is not correct.
>

Oh ok, the warning is generated by the new Documentation.

> Only the second part of your sentence applies, but you should extend it.
> 

Ok will reword this.

> 
> 
> Best regards,
> Krzysztof

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API
  2022-07-06  8:27   ` Dmitry Baryshkov
@ 2022-07-06 10:21     ` Christian Marangi
  0 siblings, 0 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-06 10:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Wed, Jul 06, 2022 at 11:27:34AM +0300, Dmitry Baryshkov wrote:
> On Tue, 5 Jul 2022 at 23:56, Christian Marangi <ansuelsmth@gmail.com> wrote:
> >
> > Convert clk-rpm driver to parent_data API and change parent names to cxo
> > and pxo instead of the board variant as pxo_board is an ancient name and
> > pxo should be used instead.
> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> >  drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
> >  1 file changed, 16 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/clk/qcom/clk-rpm.c b/drivers/clk/qcom/clk-rpm.c
> > index a18811c38018..d45a8b0fc97c 100644
> > --- a/drivers/clk/qcom/clk-rpm.c
> > +++ b/drivers/clk/qcom/clk-rpm.c
> > @@ -23,6 +23,14 @@
> >  #define QCOM_RPM_SCALING_ENABLE_ID                     0x2
> >  #define QCOM_RPM_XO_MODE_ON                            0x2
> >
> > +static const struct clk_parent_data gcc_pxo[] = {
> > +       { .fw_name = "pxo", .name = "pxo" },
> 
> This means that the core clock would look for the DT clock named 'pxo'
> with the fallback to the global clock named 'pxo'. Fallback is
> required to keep compatibility with older DT files, not having the
> clocks/clock-names properties.
> For all other platforms we were using as a fallback  the 'pxo_board'
> clock (defined in the DT) rather than the 'pxo' (hackily injected by
> the gcc driver).
> I'd suggest following this pattern and using .fw_name = "pxo', .name =
> "pxo_board".

We were discussing this to the lcc driver. Problematic topic, yes will
follow the pattern just to not change things.

> 
> Same applies to the CXO clock.
> 
> > +};
> > +
> 
> 
> -- 
> With best wishes
> Dmitry

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064
  2022-07-06  8:29   ` Dmitry Baryshkov
@ 2022-07-06 10:22     ` Christian Marangi
  0 siblings, 0 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-06 10:22 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Wed, Jul 06, 2022 at 11:29:09AM +0300, Dmitry Baryshkov wrote:
> On Tue, 5 Jul 2022 at 23:56, Christian Marangi <ansuelsmth@gmail.com> wrote:
> >
> > Drivers expect to call pxo/cxo_board clock as pxo/cxo.
> > Use clock-output-names to set the correct naming for these fixed clock
> > to save drivers that are migrating to parent_data and still use
> > parent_names.
> 
> Please no. There is no reason to add these names. Let's follow the
> example of other platforms.
>

Okok... just don't like the '_board' suffix but will drop...

> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> >  arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> > index 1425a4e4283f..720e27e29627 100644
> > --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
> > +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> > @@ -302,12 +302,14 @@ cxo_board: cxo_board {
> >                         compatible = "fixed-clock";
> >                         #clock-cells = <0>;
> >                         clock-frequency = <25000000>;
> > +                       clock-output-names = "cxo";
> >                 };
> >
> >                 pxo_board: pxo_board {
> >                         compatible = "fixed-clock";
> >                         #clock-cells = <0>;
> >                         clock-frequency = <25000000>;
> > +                       clock-output-names = "pxo";
> >                 };
> >
> >                 sleep_clk: sleep_clk {
> > --
> > 2.36.1
> >
> 
> 
> -- 
> With best wishes
> Dmitry

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc
  2022-07-06 10:19     ` Christian Marangi
@ 2022-07-06 11:58       ` Dmitry Baryshkov
  0 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2022-07-06 11:58 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Wed, 6 Jul 2022 at 13:35, Christian Marangi <ansuelsmth@gmail.com> wrote:
>
> On Wed, Jul 06, 2022 at 11:23:46AM +0300, Dmitry Baryshkov wrote:
> > On Tue, 5 Jul 2022 at 23:56, Christian Marangi <ansuelsmth@gmail.com> wrote:
> > >
> > > qcom,rpmcc describe 2 different kind of device.
> > > Currently we have definition for rpm-smd based device but we lack
> > > Documentation for simple rpm based device.
> > >
> > > Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and
> > > provide and additional example.
> > >
> > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > > ---
> > >  .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
> > >  1 file changed, 73 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> > > index 9d296b89a8d0..028eb0277495 100644
> > > --- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> > > +++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml
> > [,,,,]
> >
> > > +
> > > +then:
> > > +  properties:
> > > +    clocks:
> > > +      description: pxo clock
> > > +
> > > +    clock-names:
> > > +      const: pxo
> > > +
> > > +  required:
> > > +    - clocks
> > > +    - clock-names
> >
> > I don't think you can not mark these properties as required, older
> > schemas do not have them.
> >
>
> Well considering we changed rpmcc to parent_data and rpm clock require
> pxo clock as parents it seems to be they should be required.

parent_data specifies both the normal flow (.fw_name) and the fallback
(.name), so they are not required.
I actually miss 'recommended: true' in YAML for such cases.

> Actually no idea why this wasn't required before. Probably because this
> schema described only rpm-smd and not old rpm?
>
> > > +
> > > +else:
> > > +  if:
> > > +    properties:
> > > +      compatible:
> > > +        contains:
> > > +          const: qcom,rpmcc-apq8064
> > > +  then:
> > > +    properties:
> > > +      clocks:
> > > +        items:
> > > +          - description: pxo clock
> > > +          - description: cxo clock
> > [...]


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API
  2022-07-06 13:26   ` Konrad Dybcio
@ 2022-07-06 13:16     ` Christian Marangi
  0 siblings, 0 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-06 13:16 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bjorn Andersson, Andy Gross, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, linux-arm-msm, linux-clk,
	devicetree, linux-kernel

On Wed, Jul 06, 2022 at 03:26:53PM +0200, Konrad Dybcio wrote:
> 
> 
> On 5.07.2022 22:28, Christian Marangi wrote:
> > Convert clk-rpm driver to parent_data API and change parent names to cxo
> > and pxo instead of the board variant as pxo_board is an ancient name and
> > pxo should be used instead.
> > 
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> >  drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
> >  1 file changed, 16 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/clk/qcom/clk-rpm.c b/drivers/clk/qcom/clk-rpm.c
> > index a18811c38018..d45a8b0fc97c 100644
> > --- a/drivers/clk/qcom/clk-rpm.c
> > +++ b/drivers/clk/qcom/clk-rpm.c
> > @@ -23,6 +23,14 @@
> >  #define QCOM_RPM_SCALING_ENABLE_ID			0x2
> >  #define QCOM_RPM_XO_MODE_ON				0x2
> >  
> > +static const struct clk_parent_data gcc_pxo[] = {
> > +	{ .fw_name = "pxo", .name = "pxo" },
> The .name lookup should include _board, as the old DTs expect that.
> If I understand correctly though, you need to preserve both pxo and
> pxo_board, as they were separate, not sure though..
>

pxo_board is what comes first... then qcom gcc driver hacks it and
create a factor clk with 1/1 div and provide pxo.
In practice they are the same clk. But yhea I should not change the
name, will resent with .name = pxo_board and be done with it.

> Konrad
> > +};
> > +
> > +static const struct clk_parent_data gcc_cxo[] = {
> > +	{ .fw_name = "cxo", .name = "cxo" },
> > +};
> > +
> >  #define DEFINE_CLK_RPM(_platform, _name, _active, r_id)			      \
> >  	static struct clk_rpm _platform##_##_active;			      \
> >  	static struct clk_rpm _platform##_##_name = {			      \
> > @@ -32,8 +40,8 @@
> >  		.hw.init = &(struct clk_init_data){			      \
> >  			.ops = &clk_rpm_ops,				      \
> >  			.name = #_name,					      \
> > -			.parent_names = (const char *[]){ "pxo_board" },      \
> > -			.num_parents = 1,				      \
> > +			.parent_data = gcc_pxo,				      \
> > +			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
> >  		},							      \
> >  	};								      \
> >  	static struct clk_rpm _platform##_##_active = {			      \
> > @@ -44,8 +52,8 @@
> >  		.hw.init = &(struct clk_init_data){			      \
> >  			.ops = &clk_rpm_ops,				      \
> >  			.name = #_active,				      \
> > -			.parent_names = (const char *[]){ "pxo_board" },      \
> > -			.num_parents = 1,				      \
> > +			.parent_data = gcc_pxo,				      \
> > +			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
> >  		},							      \
> >  	}
> >  
> > @@ -56,8 +64,8 @@
> >  		.hw.init = &(struct clk_init_data){			      \
> >  			.ops = &clk_rpm_xo_ops,			      \
> >  			.name = #_name,					      \
> > -			.parent_names = (const char *[]){ "cxo_board" },      \
> > -			.num_parents = 1,				      \
> > +			.parent_data = gcc_cxo,				      \
> > +			.num_parents = ARRAY_SIZE(gcc_cxo),		      \
> >  		},							      \
> >  	}
> >  
> > @@ -68,8 +76,8 @@
> >  		.hw.init = &(struct clk_init_data){			      \
> >  			.ops = &clk_rpm_fixed_ops,			      \
> >  			.name = #_name,					      \
> > -			.parent_names = (const char *[]){ "pxo" },	      \
> > -			.num_parents = 1,				      \
> > +			.parent_data = gcc_pxo,				      \
> > +			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
> >  		},							      \
> >  	}
> >  

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064
  2022-07-05 20:28 ` [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064 Christian Marangi
  2022-07-06  8:29   ` Dmitry Baryshkov
@ 2022-07-06 13:24   ` Konrad Dybcio
  1 sibling, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-07-06 13:24 UTC (permalink / raw)
  To: Christian Marangi, Bjorn Andersson, Andy Gross,
	Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, linux-clk, devicetree,
	linux-kernel



On 5.07.2022 22:28, Christian Marangi wrote:
> Drivers expect to call pxo/cxo_board clock as pxo/cxo.
> Use clock-output-names to set the correct naming for these fixed clock
> to save drivers that are migrating to parent_data and still use
> parent_names.
> 
For this you'd want to call them "cxo_board" and "pxo_board",
as that's what they were named because of their node names.

Konrad
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> index 1425a4e4283f..720e27e29627 100644
> --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> @@ -302,12 +302,14 @@ cxo_board: cxo_board {
>  			compatible = "fixed-clock";
>  			#clock-cells = <0>;
>  			clock-frequency = <25000000>;
> +			clock-output-names = "cxo";
>  		};
>  
>  		pxo_board: pxo_board {
>  			compatible = "fixed-clock";
>  			#clock-cells = <0>;
>  			clock-frequency = <25000000>;
> +			clock-output-names = "pxo";
>  		};
>  
>  		sleep_clk: sleep_clk {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API
  2022-07-05 20:28 ` [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API Christian Marangi
  2022-07-06  8:27   ` Dmitry Baryshkov
@ 2022-07-06 13:26   ` Konrad Dybcio
  2022-07-06 13:16     ` Christian Marangi
  1 sibling, 1 reply; 24+ messages in thread
From: Konrad Dybcio @ 2022-07-06 13:26 UTC (permalink / raw)
  To: Christian Marangi, Bjorn Andersson, Andy Gross,
	Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, linux-clk, devicetree,
	linux-kernel



On 5.07.2022 22:28, Christian Marangi wrote:
> Convert clk-rpm driver to parent_data API and change parent names to cxo
> and pxo instead of the board variant as pxo_board is an ancient name and
> pxo should be used instead.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/qcom/clk-rpm.c b/drivers/clk/qcom/clk-rpm.c
> index a18811c38018..d45a8b0fc97c 100644
> --- a/drivers/clk/qcom/clk-rpm.c
> +++ b/drivers/clk/qcom/clk-rpm.c
> @@ -23,6 +23,14 @@
>  #define QCOM_RPM_SCALING_ENABLE_ID			0x2
>  #define QCOM_RPM_XO_MODE_ON				0x2
>  
> +static const struct clk_parent_data gcc_pxo[] = {
> +	{ .fw_name = "pxo", .name = "pxo" },
The .name lookup should include _board, as the old DTs expect that.
If I understand correctly though, you need to preserve both pxo and
pxo_board, as they were separate, not sure though..

Konrad
> +};
> +
> +static const struct clk_parent_data gcc_cxo[] = {
> +	{ .fw_name = "cxo", .name = "cxo" },
> +};
> +
>  #define DEFINE_CLK_RPM(_platform, _name, _active, r_id)			      \
>  	static struct clk_rpm _platform##_##_active;			      \
>  	static struct clk_rpm _platform##_##_name = {			      \
> @@ -32,8 +40,8 @@
>  		.hw.init = &(struct clk_init_data){			      \
>  			.ops = &clk_rpm_ops,				      \
>  			.name = #_name,					      \
> -			.parent_names = (const char *[]){ "pxo_board" },      \
> -			.num_parents = 1,				      \
> +			.parent_data = gcc_pxo,				      \
> +			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
>  		},							      \
>  	};								      \
>  	static struct clk_rpm _platform##_##_active = {			      \
> @@ -44,8 +52,8 @@
>  		.hw.init = &(struct clk_init_data){			      \
>  			.ops = &clk_rpm_ops,				      \
>  			.name = #_active,				      \
> -			.parent_names = (const char *[]){ "pxo_board" },      \
> -			.num_parents = 1,				      \
> +			.parent_data = gcc_pxo,				      \
> +			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
>  		},							      \
>  	}
>  
> @@ -56,8 +64,8 @@
>  		.hw.init = &(struct clk_init_data){			      \
>  			.ops = &clk_rpm_xo_ops,			      \
>  			.name = #_name,					      \
> -			.parent_names = (const char *[]){ "cxo_board" },      \
> -			.num_parents = 1,				      \
> +			.parent_data = gcc_cxo,				      \
> +			.num_parents = ARRAY_SIZE(gcc_cxo),		      \
>  		},							      \
>  	}
>  
> @@ -68,8 +76,8 @@
>  		.hw.init = &(struct clk_init_data){			      \
>  			.ops = &clk_rpm_fixed_ops,			      \
>  			.name = #_name,					      \
> -			.parent_names = (const char *[]){ "pxo" },	      \
> -			.num_parents = 1,				      \
> +			.parent_data = gcc_pxo,				      \
> +			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
>  		},							      \
>  	}
>  

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  2022-07-06 10:20     ` Christian Marangi
@ 2022-07-06 15:07       ` Krzysztof Kozlowski
  2022-07-06 19:10         ` Christian Marangi
  0 siblings, 1 reply; 24+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-06 15:07 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On 06/07/2022 12:20, Christian Marangi wrote:
> On Wed, Jul 06, 2022 at 09:44:04AM +0200, Krzysztof Kozlowski wrote:
>> On 05/07/2022 22:28, Christian Marangi wrote:
>>> Fix dtbs_check warning for new rpmcc Documentation changes and add the
>>> required clocks.
>>
>> There is no warning in the kernel, right? So the commit is not correct.
>>
> 
> Oh ok, the warning is generated by the new Documentation.

Patches, especially DTS, might go via different trees, so the moment DTS
is applied there might be no such warning.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  2022-07-06 15:07       ` Krzysztof Kozlowski
@ 2022-07-06 19:10         ` Christian Marangi
  2022-07-06 20:09           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Marangi @ 2022-07-06 19:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Wed, Jul 06, 2022 at 05:07:12PM +0200, Krzysztof Kozlowski wrote:
> On 06/07/2022 12:20, Christian Marangi wrote:
> > On Wed, Jul 06, 2022 at 09:44:04AM +0200, Krzysztof Kozlowski wrote:
> >> On 05/07/2022 22:28, Christian Marangi wrote:
> >>> Fix dtbs_check warning for new rpmcc Documentation changes and add the
> >>> required clocks.
> >>
> >> There is no warning in the kernel, right? So the commit is not correct.
> >>
> > 
> > Oh ok, the warning is generated by the new Documentation.
> 
> Patches, especially DTS, might go via different trees, so the moment DTS
> is applied there might be no such warning.
>

I'm still confused about this topic...
With this kind of change, I notice I sent Documentation change and then
rob bot complain about dtbs_check having warning...

So the correct way is to send Documentation change and fix dtbs_check
warning in the same commit OR keep what I'm doing with sending
Documentation changes and fix DTS in a separate commit?

I assume separate patch was the way to go but now I'm not sure
anymore...

> Best regards,
> Krzysztof

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  2022-07-06 19:10         ` Christian Marangi
@ 2022-07-06 20:09           ` Krzysztof Kozlowski
  2022-07-06 20:38             ` Christian Marangi
  0 siblings, 1 reply; 24+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-06 20:09 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On 06/07/2022 21:10, Christian Marangi wrote:
> On Wed, Jul 06, 2022 at 05:07:12PM +0200, Krzysztof Kozlowski wrote:
>> On 06/07/2022 12:20, Christian Marangi wrote:
>>> On Wed, Jul 06, 2022 at 09:44:04AM +0200, Krzysztof Kozlowski wrote:
>>>> On 05/07/2022 22:28, Christian Marangi wrote:
>>>>> Fix dtbs_check warning for new rpmcc Documentation changes and add the
>>>>> required clocks.
>>>>
>>>> There is no warning in the kernel, right? So the commit is not correct.
>>>>
>>>
>>> Oh ok, the warning is generated by the new Documentation.
>>
>> Patches, especially DTS, might go via different trees, so the moment DTS
>> is applied there might be no such warning.
>>
> 
> I'm still confused about this topic...
> With this kind of change, I notice I sent Documentation change and then
> rob bot complain about dtbs_check having warning...
> 
> So the correct way is to send Documentation change and fix dtbs_check
> warning in the same commit OR keep what I'm doing with sending
> Documentation changes and fix DTS in a separate commit?

Binding is almost always separate from DTS and always separate from
driver. The order depends on what you're doing. If you bring ABI break
change to bindings, then the order does not matter, because each order
will be non-bisectable. Because you broke ABI. That's the case in this
patchset.

For other cases, usually bindings patches should be the first in patchset.

How it goes via maintainer trees is not your problem here. Patches might
go together or might go separate.

Anyway it was not the topic of my comment. Comment was about not
specific commit msg which does not fit the Linux kernel process and does
not fit git history once applied by maintainer. It fits even less when
backported to stable kernels, which you commit msg encourages to do.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
  2022-07-06 20:09           ` Krzysztof Kozlowski
@ 2022-07-06 20:38             ` Christian Marangi
  0 siblings, 0 replies; 24+ messages in thread
From: Christian Marangi @ 2022-07-06 20:38 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	linux-clk, devicetree, linux-kernel

On Wed, Jul 06, 2022 at 10:09:05PM +0200, Krzysztof Kozlowski wrote:
> On 06/07/2022 21:10, Christian Marangi wrote:
> > On Wed, Jul 06, 2022 at 05:07:12PM +0200, Krzysztof Kozlowski wrote:
> >> On 06/07/2022 12:20, Christian Marangi wrote:
> >>> On Wed, Jul 06, 2022 at 09:44:04AM +0200, Krzysztof Kozlowski wrote:
> >>>> On 05/07/2022 22:28, Christian Marangi wrote:
> >>>>> Fix dtbs_check warning for new rpmcc Documentation changes and add the
> >>>>> required clocks.
> >>>>
> >>>> There is no warning in the kernel, right? So the commit is not correct.
> >>>>
> >>>
> >>> Oh ok, the warning is generated by the new Documentation.
> >>
> >> Patches, especially DTS, might go via different trees, so the moment DTS
> >> is applied there might be no such warning.
> >>
> > 
> > I'm still confused about this topic...
> > With this kind of change, I notice I sent Documentation change and then
> > rob bot complain about dtbs_check having warning...
> > 
> > So the correct way is to send Documentation change and fix dtbs_check
> > warning in the same commit OR keep what I'm doing with sending
> > Documentation changes and fix DTS in a separate commit?
> 
> Binding is almost always separate from DTS and always separate from
> driver. The order depends on what you're doing. If you bring ABI break
> change to bindings, then the order does not matter, because each order
> will be non-bisectable. Because you broke ABI. That's the case in this
> patchset.
> 
> For other cases, usually bindings patches should be the first in patchset.
> 
> How it goes via maintainer trees is not your problem here. Patches might
> go together or might go separate.
> 
> Anyway it was not the topic of my comment. Comment was about not
> specific commit msg which does not fit the Linux kernel process and does
> not fit git history once applied by maintainer. It fits even less when
> backported to stable kernels, which you commit msg encourages to do.
>

It was a more generic question so sorry for the OT.

Will reword the commit description, thanks again for the clarification
about this generic topic.

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-07-06 20:38 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05 20:28 [PATCH 0/5] clk: qcom: Drop use of pxo/cxo_board for rpm devices Christian Marangi
2022-07-05 20:28 ` [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc Christian Marangi
2022-07-06  7:43   ` Krzysztof Kozlowski
2022-07-06  8:23   ` Dmitry Baryshkov
2022-07-06 10:19     ` Christian Marangi
2022-07-06 11:58       ` Dmitry Baryshkov
2022-07-05 20:28 ` [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks Christian Marangi
2022-07-06  7:35   ` Dmitry Baryshkov
2022-07-06  7:44   ` Krzysztof Kozlowski
2022-07-06 10:20     ` Christian Marangi
2022-07-06 15:07       ` Krzysztof Kozlowski
2022-07-06 19:10         ` Christian Marangi
2022-07-06 20:09           ` Krzysztof Kozlowski
2022-07-06 20:38             ` Christian Marangi
2022-07-05 20:28 ` [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API Christian Marangi
2022-07-06  8:27   ` Dmitry Baryshkov
2022-07-06 10:21     ` Christian Marangi
2022-07-06 13:26   ` Konrad Dybcio
2022-07-06 13:16     ` Christian Marangi
2022-07-05 20:28 ` [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064 Christian Marangi
2022-07-06  8:29   ` Dmitry Baryshkov
2022-07-06 10:22     ` Christian Marangi
2022-07-06 13:24   ` Konrad Dybcio
2022-07-05 20:28 ` [PATCH 5/5] clk: qcom: gcc-ipq806x: remove cc_register_board for pxo and cxo Christian Marangi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.