linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/5] imx esdhc dt/driver update
@ 2021-02-25  3:09 peng.fan
  2021-02-25  3:10 ` [PATCH V3 1/5] dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings peng.fan
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: peng.fan @ 2021-02-25  3:09 UTC (permalink / raw)
  To: sboyd, robh+dt, shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, ulf.hansson, adrian.hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

V3:
 Patch 1, drop unneeded pinctrl-0/1/2
 Patch 2 is new to avoid break dt bindings check
V2:
 patch 1, 2, 3 is new
 patch 4 is not changed
 https://patchwork.kernel.org/project/linux-arm-kernel/cover/1611198593-16287-1-git-send-email-peng.fan@nxp.com/

Peng Fan (5):
  dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings
  dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names
  arm64: dts: imx8qxp: correct usdhc clock-names sequence
  dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
  mmc: sdhci-esdhc-imx: validate pinctrl before use it

 .../bindings/clock/imx8qxp-lpcg.yaml          |  6 +++---
 .../bindings/mmc/fsl-imx-esdhc.yaml           | 20 +++++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8qxp.dtsi    | 18 ++++++++---------
 drivers/mmc/host/sdhci-esdhc-imx.c            |  2 +-
 4 files changed, 33 insertions(+), 13 deletions(-)

-- 
2.30.0


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

* [PATCH V3 1/5] dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings
  2021-02-25  3:09 [PATCH V3 0/5] imx esdhc dt/driver update peng.fan
@ 2021-02-25  3:10 ` peng.fan
  2021-02-25  3:10 ` [PATCH V3 2/5] dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names peng.fan
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: peng.fan @ 2021-02-25  3:10 UTC (permalink / raw)
  To: sboyd, robh+dt, shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, ulf.hansson, adrian.hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add pinctrl bindings for fsl-imx-esdhc yaml

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
index 802c9df23752..a7fbd8cc1e38 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
@@ -103,6 +103,15 @@ properties:
       Only eMMC HS400 mode need to take care of this property.
     default: 0
 
+  pinctrl-names:
+    minItems: 1
+    maxItems: 4
+    items:
+      - const: default
+      - const: state_100mhz
+      - const: state_200mhz
+      - const: sleep
+
 required:
   - compatible
   - reg
-- 
2.30.0


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

* [PATCH V3 2/5] dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names
  2021-02-25  3:09 [PATCH V3 0/5] imx esdhc dt/driver update peng.fan
  2021-02-25  3:10 ` [PATCH V3 1/5] dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings peng.fan
@ 2021-02-25  3:10 ` peng.fan
  2021-03-06 20:39   ` Rob Herring
  2021-02-25  3:10 ` [PATCH V3 3/5] arm64: dts: imx8qxp: correct usdhc clock-names sequence peng.fan
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: peng.fan @ 2021-02-25  3:10 UTC (permalink / raw)
  To: sboyd, robh+dt, shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, ulf.hansson, adrian.hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Align with all other i.MX using the mmc controller, align
the clock-names.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml b/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml
index 940486ef1051..0f6fe365ebf3 100644
--- a/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml
+++ b/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml
@@ -107,8 +107,8 @@ examples:
         interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>;
         reg = <0x5b010000 0x10000>;
         clocks = <&sdhc0_lpcg IMX_LPCG_CLK_4>,
-                 <&sdhc0_lpcg IMX_LPCG_CLK_0>,
-                 <&sdhc0_lpcg IMX_LPCG_CLK_5>;
-        clock-names = "ipg", "per", "ahb";
+                 <&sdhc0_lpcg IMX_LPCG_CLK_5>,
+                 <&sdhc0_lpcg IMX_LPCG_CLK_0>;
+        clock-names = "ipg", "ahb", "per";
         power-domains = <&pd IMX_SC_R_SDHC_0>;
     };
-- 
2.30.0


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

* [PATCH V3 3/5] arm64: dts: imx8qxp: correct usdhc clock-names sequence
  2021-02-25  3:09 [PATCH V3 0/5] imx esdhc dt/driver update peng.fan
  2021-02-25  3:10 ` [PATCH V3 1/5] dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings peng.fan
  2021-02-25  3:10 ` [PATCH V3 2/5] dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names peng.fan
@ 2021-02-25  3:10 ` peng.fan
  2021-02-25  3:10 ` [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings peng.fan
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: peng.fan @ 2021-02-25  3:10 UTC (permalink / raw)
  To: sboyd, robh+dt, shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, ulf.hansson, adrian.hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Per dt-bindings, the clock-names sequence should be ipg ahb per to pass
dtbs_check.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
index e46faac1fe71..1d522de7b017 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
@@ -366,9 +366,9 @@ usdhc1: mmc@5b010000 {
 			interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>;
 			reg = <0x5b010000 0x10000>;
 			clocks = <&conn_lpcg IMX_CONN_LPCG_SDHC0_IPG_CLK>,
-				 <&conn_lpcg IMX_CONN_LPCG_SDHC0_PER_CLK>,
-				 <&conn_lpcg IMX_CONN_LPCG_SDHC0_HCLK>;
-			clock-names = "ipg", "per", "ahb";
+				 <&conn_lpcg IMX_CONN_LPCG_SDHC0_HCLK>,
+				 <&conn_lpcg IMX_CONN_LPCG_SDHC0_PER_CLK>;
+			clock-names = "ipg", "ahb", "per";
 			power-domains = <&pd IMX_SC_R_SDHC_0>;
 			status = "disabled";
 		};
@@ -378,9 +378,9 @@ usdhc2: mmc@5b020000 {
 			interrupts = <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH>;
 			reg = <0x5b020000 0x10000>;
 			clocks = <&conn_lpcg IMX_CONN_LPCG_SDHC1_IPG_CLK>,
-				 <&conn_lpcg IMX_CONN_LPCG_SDHC1_PER_CLK>,
-				 <&conn_lpcg IMX_CONN_LPCG_SDHC1_HCLK>;
-			clock-names = "ipg", "per", "ahb";
+				 <&conn_lpcg IMX_CONN_LPCG_SDHC1_HCLK>,
+				 <&conn_lpcg IMX_CONN_LPCG_SDHC1_PER_CLK>;
+			clock-names = "ipg", "ahb", "per";
 			power-domains = <&pd IMX_SC_R_SDHC_1>;
 			fsl,tuning-start-tap = <20>;
 			fsl,tuning-step= <2>;
@@ -392,9 +392,9 @@ usdhc3: mmc@5b030000 {
 			interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>;
 			reg = <0x5b030000 0x10000>;
 			clocks = <&conn_lpcg IMX_CONN_LPCG_SDHC2_IPG_CLK>,
-				 <&conn_lpcg IMX_CONN_LPCG_SDHC2_PER_CLK>,
-				 <&conn_lpcg IMX_CONN_LPCG_SDHC2_HCLK>;
-			clock-names = "ipg", "per", "ahb";
+				 <&conn_lpcg IMX_CONN_LPCG_SDHC2_HCLK>,
+				 <&conn_lpcg IMX_CONN_LPCG_SDHC2_PER_CLK>;
+			clock-names = "ipg", "ahb", "per";
 			power-domains = <&pd IMX_SC_R_SDHC_2>;
 			status = "disabled";
 		};
-- 
2.30.0


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

* [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
  2021-02-25  3:09 [PATCH V3 0/5] imx esdhc dt/driver update peng.fan
                   ` (2 preceding siblings ...)
  2021-02-25  3:10 ` [PATCH V3 3/5] arm64: dts: imx8qxp: correct usdhc clock-names sequence peng.fan
@ 2021-02-25  3:10 ` peng.fan
  2021-03-04 22:48   ` Rob Herring
  2021-03-05 14:09   ` Aisheng Dong
  2021-02-25  3:10 ` [PATCH V3 5/5] mmc: sdhci-esdhc-imx: validate pinctrl before use it peng.fan
  2021-03-02 10:39 ` [PATCH V3 0/5] imx esdhc dt/driver update Ulf Hansson
  5 siblings, 2 replies; 15+ messages in thread
From: peng.fan @ 2021-02-25  3:10 UTC (permalink / raw)
  To: sboyd, robh+dt, shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, ulf.hansson, adrian.hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add clock bindings for fsl-imx-esdhc yaml

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 .../devicetree/bindings/mmc/fsl-imx-esdhc.yaml        | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
index a7fbd8cc1e38..369471814496 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
@@ -103,6 +103,17 @@ properties:
       Only eMMC HS400 mode need to take care of this property.
     default: 0
 
+  clocks:
+    maxItems: 3
+    description:
+      Handle clocks for the sdhc controller.
+
+  clock-names:
+    items:
+      - const: ipg
+      - const: ahb
+      - const: per
+
   pinctrl-names:
     minItems: 1
     maxItems: 4
-- 
2.30.0


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

* [PATCH V3 5/5] mmc: sdhci-esdhc-imx: validate pinctrl before use it
  2021-02-25  3:09 [PATCH V3 0/5] imx esdhc dt/driver update peng.fan
                   ` (3 preceding siblings ...)
  2021-02-25  3:10 ` [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings peng.fan
@ 2021-02-25  3:10 ` peng.fan
  2021-03-02 10:39 ` [PATCH V3 0/5] imx esdhc dt/driver update Ulf Hansson
  5 siblings, 0 replies; 15+ messages in thread
From: peng.fan @ 2021-02-25  3:10 UTC (permalink / raw)
  To: sboyd, robh+dt, shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, ulf.hansson, adrian.hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

When imx_data->pinctrl is not a valid pointer, pinctrl_lookup_state
will trigger kernel panic.

When we boot Dual OS on Jailhouse hypervisor, we let the 1st Linux to
configure pinmux ready for the 2nd OS, so the 2nd OS not have pinctrl
settings.

Similar to this commit b62eee9f804e ("mmc: sdhci-esdhc-imx: no fail when no pinctrl available").

Reviewed-by: Bough Chen <haobo.chen@nxp.com>
Reviewed-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index a20459744d21..94327988da91 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1488,7 +1488,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
 
 	mmc_of_parse_voltage(np, &host->ocr_mask);
 
-	if (esdhc_is_usdhc(imx_data)) {
+	if (esdhc_is_usdhc(imx_data) && !IS_ERR(imx_data->pinctrl)) {
 		imx_data->pins_100mhz = pinctrl_lookup_state(imx_data->pinctrl,
 						ESDHC_PINCTRL_STATE_100MHZ);
 		imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl,
-- 
2.30.0


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

* Re: [PATCH V3 0/5] imx esdhc dt/driver update
  2021-02-25  3:09 [PATCH V3 0/5] imx esdhc dt/driver update peng.fan
                   ` (4 preceding siblings ...)
  2021-02-25  3:10 ` [PATCH V3 5/5] mmc: sdhci-esdhc-imx: validate pinctrl before use it peng.fan
@ 2021-03-02 10:39 ` Ulf Hansson
  2021-03-03  3:00   ` Peng Fan (OSS)
  5 siblings, 1 reply; 15+ messages in thread
From: Ulf Hansson @ 2021-03-02 10:39 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: Stephen Boyd, Rob Herring, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, dl-linux-imx, Adrian Hunter, linux-clk, DTML,
	Linux ARM, Linux Kernel Mailing List, linux-mmc, Peng Fan

On Thu, 25 Feb 2021 at 04:22, <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> V3:
>  Patch 1, drop unneeded pinctrl-0/1/2
>  Patch 2 is new to avoid break dt bindings check
> V2:
>  patch 1, 2, 3 is new
>  patch 4 is not changed
>  https://patchwork.kernel.org/project/linux-arm-kernel/cover/1611198593-16287-1-git-send-email-peng.fan@nxp.com/
>
> Peng Fan (5):
>   dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings
>   dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names
>   arm64: dts: imx8qxp: correct usdhc clock-names sequence
>   dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
>   mmc: sdhci-esdhc-imx: validate pinctrl before use it
>
>  .../bindings/clock/imx8qxp-lpcg.yaml          |  6 +++---
>  .../bindings/mmc/fsl-imx-esdhc.yaml           | 20 +++++++++++++++++++
>  arch/arm64/boot/dts/freescale/imx8qxp.dtsi    | 18 ++++++++---------
>  drivers/mmc/host/sdhci-esdhc-imx.c            |  2 +-
>  4 files changed, 33 insertions(+), 13 deletions(-)
>
> --
> 2.30.0
>

Applied patch 1, 4 and 5, thanks!

Kind regards
Uffe

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

* RE: [PATCH V3 0/5] imx esdhc dt/driver update
  2021-03-02 10:39 ` [PATCH V3 0/5] imx esdhc dt/driver update Ulf Hansson
@ 2021-03-03  3:00   ` Peng Fan (OSS)
  2021-03-08  0:51     ` Shawn Guo
  0 siblings, 1 reply; 15+ messages in thread
From: Peng Fan (OSS) @ 2021-03-03  3:00 UTC (permalink / raw)
  To: Ulf Hansson, Peng Fan (OSS), shawnguo
  Cc: Stephen Boyd, Rob Herring, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, dl-linux-imx, Adrian Hunter, linux-clk, DTML,
	Linux ARM, Linux Kernel Mailing List, linux-mmc

Hi Shawn,

> Subject: Re: [PATCH V3 0/5] imx esdhc dt/driver update
> 
> On Thu, 25 Feb 2021 at 04:22, <peng.fan@oss.nxp.com> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > V3:
> >  Patch 1, drop unneeded pinctrl-0/1/2
> >  Patch 2 is new to avoid break dt bindings check
> > V2:
> >  patch 1, 2, 3 is new
> >  patch 4 is not changed
> >
> >
> > Peng Fan (5):
> >   dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings
> >   dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names
> >   arm64: dts: imx8qxp: correct usdhc clock-names sequence
> >   dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
> >   mmc: sdhci-esdhc-imx: validate pinctrl before use it
> >
> >  .../bindings/clock/imx8qxp-lpcg.yaml          |  6 +++---
> >  .../bindings/mmc/fsl-imx-esdhc.yaml           | 20
> +++++++++++++++++++
> >  arch/arm64/boot/dts/freescale/imx8qxp.dtsi    | 18 ++++++++---------
> >  drivers/mmc/host/sdhci-esdhc-imx.c            |  2 +-
> >  4 files changed, 33 insertions(+), 13 deletions(-)
> >
> > --
> > 2.30.0
> >
> 
> Applied patch 1, 4 and 5, thanks!


Would you pick patch 2,3?

Thanks,
Peng.

> 
> Kind regards
> Uffe

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

* Re: [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
  2021-02-25  3:10 ` [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings peng.fan
@ 2021-03-04 22:48   ` Rob Herring
  2021-03-05  0:38     ` Peng Fan
  2021-03-05 14:09   ` Aisheng Dong
  1 sibling, 1 reply; 15+ messages in thread
From: Rob Herring @ 2021-03-04 22:48 UTC (permalink / raw)
  To: peng.fan
  Cc: Stephen Boyd, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, NXP Linux Team, Ulf Hansson, Adrian Hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc,
	Peng Fan

On Wed, Feb 24, 2021 at 9:23 PM <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> Add clock bindings for fsl-imx-esdhc yaml
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../devicetree/bindings/mmc/fsl-imx-esdhc.yaml        | 11 +++++++++++
>  1 file changed, 11 insertions(+)

Looks like this landed in linux-next and introduces warnings:

/builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.example.dt.yaml:
mmc@5b010000: clock-names:1: 'ahb' was expected
 From schema: /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
/builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.example.dt.yaml:
mmc@5b010000: clock-names:2: 'per' was expected
 From schema: /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml

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

* RE: [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
  2021-03-04 22:48   ` Rob Herring
@ 2021-03-05  0:38     ` Peng Fan
  0 siblings, 0 replies; 15+ messages in thread
From: Peng Fan @ 2021-03-05  0:38 UTC (permalink / raw)
  To: Rob Herring, Peng Fan (OSS)
  Cc: Stephen Boyd, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, dl-linux-imx, Ulf Hansson, Adrian Hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc

Hi Rob,

> Subject: Re: [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock
> bindings
> 
> On Wed, Feb 24, 2021 at 9:23 PM <peng.fan@oss.nxp.com> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Add clock bindings for fsl-imx-esdhc yaml
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  .../devicetree/bindings/mmc/fsl-imx-esdhc.yaml        | 11
> +++++++++++
> >  1 file changed, 11 insertions(+)
> 
> Looks like this landed in linux-next and introduces warnings:

Patch 2,3 has not been picked by Shawn. After patch 2, 3 picked up,
there will be no warnings.

Thanks,
Peng.

> 
> /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/clo
> ck/imx8qxp-lpcg.example.dt.yaml:
> mmc@5b010000: clock-names:1: 'ahb' was expected  From schema:
> /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/m
> mc/fsl-imx-esdhc.yaml
> /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/clo
> ck/imx8qxp-lpcg.example.dt.yaml:
> mmc@5b010000: clock-names:2: 'per' was expected  From schema:
> /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/m
> mc/fsl-imx-esdhc.yaml

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

* RE: [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
  2021-02-25  3:10 ` [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings peng.fan
  2021-03-04 22:48   ` Rob Herring
@ 2021-03-05 14:09   ` Aisheng Dong
  2021-03-05 14:14     ` Rob Herring
  1 sibling, 1 reply; 15+ messages in thread
From: Aisheng Dong @ 2021-03-05 14:09 UTC (permalink / raw)
  To: Peng Fan (OSS), sboyd, robh+dt, shawnguo, s.hauer
  Cc: kernel, festevam, dl-linux-imx, ulf.hansson, adrian.hunter,
	linux-clk, devicetree, linux-arm-kernel, linux-kernel, linux-mmc,
	Peng Fan

Hi Rob,

> From: Peng Fan (OSS) <peng.fan@oss.nxp.com>
> Sent: Thursday, February 25, 2021 11:10 AM
> 
> From: Peng Fan <peng.fan@nxp.com>
> 
> Add clock bindings for fsl-imx-esdhc yaml
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../devicetree/bindings/mmc/fsl-imx-esdhc.yaml        | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> index a7fbd8cc1e38..369471814496 100644
> --- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> +++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> @@ -103,6 +103,17 @@ properties:
>        Only eMMC HS400 mode need to take care of this property.
>      default: 0
> 
> +  clocks:
> +    maxItems: 3
> +    description:
> +      Handle clocks for the sdhc controller.
> +
> +  clock-names:
> +    items:
> +      - const: ipg
> +      - const: ahb
> +      - const: per

One question:
The side effect of this patch is that it imposes a forced order of clk names
In DT which actually was not needed.

Do we really have to do that?

Or any other better approach to allow a random order to match the DT
usage better?

Regards
Aisheng

> +
>    pinctrl-names:
>      minItems: 1
>      maxItems: 4
> --
> 2.30.0


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

* Re: [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
  2021-03-05 14:09   ` Aisheng Dong
@ 2021-03-05 14:14     ` Rob Herring
  2021-03-06  4:53       ` Aisheng Dong
  0 siblings, 1 reply; 15+ messages in thread
From: Rob Herring @ 2021-03-05 14:14 UTC (permalink / raw)
  To: Aisheng Dong
  Cc: Peng Fan (OSS),
	sboyd, shawnguo, s.hauer, kernel, festevam, dl-linux-imx,
	ulf.hansson, adrian.hunter, linux-clk, devicetree,
	linux-arm-kernel, linux-kernel, linux-mmc, Peng Fan

On Fri, Mar 5, 2021 at 8:09 AM Aisheng Dong <aisheng.dong@nxp.com> wrote:
>
> Hi Rob,
>
> > From: Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > Sent: Thursday, February 25, 2021 11:10 AM
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Add clock bindings for fsl-imx-esdhc yaml
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  .../devicetree/bindings/mmc/fsl-imx-esdhc.yaml        | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > index a7fbd8cc1e38..369471814496 100644
> > --- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > +++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > @@ -103,6 +103,17 @@ properties:
> >        Only eMMC HS400 mode need to take care of this property.
> >      default: 0
> >
> > +  clocks:
> > +    maxItems: 3
> > +    description:
> > +      Handle clocks for the sdhc controller.
> > +
> > +  clock-names:
> > +    items:
> > +      - const: ipg
> > +      - const: ahb
> > +      - const: per
>
> One question:
> The side effect of this patch is that it imposes a forced order of clk names
> In DT which actually was not needed.
>
> Do we really have to do that?

Yes.

> Or any other better approach to allow a random order to match the DT
> usage better?

Why do you need random order?

We can not enforce the order, but we only do that when there's
multiple optional entries.

Rob

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

* RE: [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
  2021-03-05 14:14     ` Rob Herring
@ 2021-03-06  4:53       ` Aisheng Dong
  0 siblings, 0 replies; 15+ messages in thread
From: Aisheng Dong @ 2021-03-06  4:53 UTC (permalink / raw)
  To: Rob Herring
  Cc: Peng Fan (OSS),
	sboyd, shawnguo, s.hauer, kernel, festevam, dl-linux-imx,
	ulf.hansson, adrian.hunter, linux-clk, devicetree,
	linux-arm-kernel, linux-kernel, linux-mmc, Peng Fan

> From: Rob Herring <robh+dt@kernel.org>
> Sent: Friday, March 5, 2021 10:14 PM
> 
> On Fri, Mar 5, 2021 at 8:09 AM Aisheng Dong <aisheng.dong@nxp.com>
> wrote:
> >
> > Hi Rob,
> >
> > > From: Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > > Sent: Thursday, February 25, 2021 11:10 AM
> > >
> > > From: Peng Fan <peng.fan@nxp.com>
> > >
> > > Add clock bindings for fsl-imx-esdhc yaml
> > >
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > ---
> > >  .../devicetree/bindings/mmc/fsl-imx-esdhc.yaml        | 11
> +++++++++++
> > >  1 file changed, 11 insertions(+)
> > >
> > > diff --git
> > > a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > > b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > > index a7fbd8cc1e38..369471814496 100644
> > > --- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > > +++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > > @@ -103,6 +103,17 @@ properties:
> > >        Only eMMC HS400 mode need to take care of this property.
> > >      default: 0
> > >
> > > +  clocks:
> > > +    maxItems: 3
> > > +    description:
> > > +      Handle clocks for the sdhc controller.
> > > +
> > > +  clock-names:
> > > +    items:
> > > +      - const: ipg
> > > +      - const: ahb
> > > +      - const: per
> >
> > One question:
> > The side effect of this patch is that it imposes a forced order of clk
> > names In DT which actually was not needed.
> >
> > Do we really have to do that?
> 
> Yes.
> 
> > Or any other better approach to allow a random order to match the DT
> > usage better?
> 
> Why do you need random order?
> 

Thanks for the feedback.
I thought the DT itself supports the random order of strings/names in
a property and the OF API in kernel can also handle the random name order properly.
That means DT binding don't enforce the order of names when people writing DTS.
e.g.
Order1: clock-names = "ipg", "per", "ahb"
can function the same as:
Order2: clock-names = "ipg", "ahb", "per";

However, the schema in this patch enforced the name order which caused dt binding check fail.
https://lore.kernel.org/linux-arm-kernel/CAL_JsqKAOUKnVLvu-VNeDVg0ShXPy56wxhCQv38+rO2k961v+g@mail.gmail.com/#t

And this seems like a common issue in kernel DT because DT supports random name order before.
If we have to fix it, should we need fix them all in kernel?

And finally, If all the names property are fixed by dt schema definition, the driver
may also work without it by using index.

> We can not enforce the order, but we only do that when there's multiple
> optional entries.

Understood, probably this is the simplest way to do a accurate DT schema checking.

Regards
Aisheng

> 
> Rob

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

* Re: [PATCH V3 2/5] dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names
  2021-02-25  3:10 ` [PATCH V3 2/5] dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names peng.fan
@ 2021-03-06 20:39   ` Rob Herring
  0 siblings, 0 replies; 15+ messages in thread
From: Rob Herring @ 2021-03-06 20:39 UTC (permalink / raw)
  To: peng.fan
  Cc: Peng Fan, s.hauer, sboyd, festevam, linux-imx, linux-arm-kernel,
	robh+dt, adrian.hunter, kernel, linux-clk, ulf.hansson,
	linux-mmc, shawnguo, devicetree, linux-kernel

On Thu, 25 Feb 2021 11:10:01 +0800, peng.fan@oss.nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Align with all other i.MX using the mmc controller, align
> the clock-names.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH V3 0/5] imx esdhc dt/driver update
  2021-03-03  3:00   ` Peng Fan (OSS)
@ 2021-03-08  0:51     ` Shawn Guo
  0 siblings, 0 replies; 15+ messages in thread
From: Shawn Guo @ 2021-03-08  0:51 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: Ulf Hansson, Stephen Boyd, Rob Herring, Sascha Hauer,
	Sascha Hauer, Fabio Estevam, dl-linux-imx, Adrian Hunter,
	linux-clk, DTML, Linux ARM, Linux Kernel Mailing List, linux-mmc

On Wed, Mar 03, 2021 at 03:00:57AM +0000, Peng Fan (OSS) wrote:
> Hi Shawn,
> 
> > Subject: Re: [PATCH V3 0/5] imx esdhc dt/driver update
> > 
> > On Thu, 25 Feb 2021 at 04:22, <peng.fan@oss.nxp.com> wrote:
> > >
> > > From: Peng Fan <peng.fan@nxp.com>
> > >
> > > V3:
> > >  Patch 1, drop unneeded pinctrl-0/1/2
> > >  Patch 2 is new to avoid break dt bindings check
> > > V2:
> > >  patch 1, 2, 3 is new
> > >  patch 4 is not changed
> > >
> > >
> > > Peng Fan (5):
> > >   dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings
> > >   dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names
> > >   arm64: dts: imx8qxp: correct usdhc clock-names sequence
> > >   dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
> > >   mmc: sdhci-esdhc-imx: validate pinctrl before use it
> > >
> > >  .../bindings/clock/imx8qxp-lpcg.yaml          |  6 +++---
> > >  .../bindings/mmc/fsl-imx-esdhc.yaml           | 20
> > +++++++++++++++++++
> > >  arch/arm64/boot/dts/freescale/imx8qxp.dtsi    | 18 ++++++++---------
> > >  drivers/mmc/host/sdhci-esdhc-imx.c            |  2 +-
> > >  4 files changed, 33 insertions(+), 13 deletions(-)
> > >
> > > --
> > > 2.30.0
> > >
> > 
> > Applied patch 1, 4 and 5, thanks!
> 
> 
> Would you pick patch 2,3?

Done.

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

end of thread, other threads:[~2021-03-08  0:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25  3:09 [PATCH V3 0/5] imx esdhc dt/driver update peng.fan
2021-02-25  3:10 ` [PATCH V3 1/5] dt-bindings: mmc: fsl-imx-esdhc: add pinctrl bindings peng.fan
2021-02-25  3:10 ` [PATCH V3 2/5] dt-bindings: clock: imx8qxp-lpcg: correct the example clock-names peng.fan
2021-03-06 20:39   ` Rob Herring
2021-02-25  3:10 ` [PATCH V3 3/5] arm64: dts: imx8qxp: correct usdhc clock-names sequence peng.fan
2021-02-25  3:10 ` [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings peng.fan
2021-03-04 22:48   ` Rob Herring
2021-03-05  0:38     ` Peng Fan
2021-03-05 14:09   ` Aisheng Dong
2021-03-05 14:14     ` Rob Herring
2021-03-06  4:53       ` Aisheng Dong
2021-02-25  3:10 ` [PATCH V3 5/5] mmc: sdhci-esdhc-imx: validate pinctrl before use it peng.fan
2021-03-02 10:39 ` [PATCH V3 0/5] imx esdhc dt/driver update Ulf Hansson
2021-03-03  3:00   ` Peng Fan (OSS)
2021-03-08  0:51     ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).