linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aisheng Dong <aisheng.dong@nxp.com>
To: Rob Herring <robh+dt@kernel.org>
Cc: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	"sboyd@kernel.org" <sboyd@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Peng Fan <peng.fan@nxp.com>
Subject: RE: [PATCH V3 4/5] dt-bindings: mmc: fsl-imx-esdhc: add clock bindings
Date: Sat, 6 Mar 2021 04:53:13 +0000	[thread overview]
Message-ID: <AM6PR04MB4966E330D7E51E3403050E1D80959@AM6PR04MB4966.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CAL_JsqKK8t6XUqTuOKPzOviJbysqWqga_mdxWE0P0N4ejTgG=A@mail.gmail.com>

> 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

  reply	other threads:[~2021-03-06  4:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR04MB4966E330D7E51E3403050E1D80959@AM6PR04MB4966.eurprd04.prod.outlook.com \
    --to=aisheng.dong@nxp.com \
    --cc=adrian.hunter@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).