linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Halaney <ahalaney@redhat.com>
To: krzysztof.kozlowski+dt@linaro.org
Cc: linux-kernel@vger.kernel.org, agross@kernel.org,
	andersson@kernel.org, konrad.dybcio@linaro.org,
	robh+dt@kernel.org, mturquette@baylibre.com,
	richardcochran@gmail.com, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	netdev@vger.kernel.org, bmasney@redhat.com, echanude@redhat.com,
	ncai@quicinc.com, jsuraj@qti.qualcomm.com, hisunil@quicinc.com,
	sboyd@kernel.org
Subject: Re: [PATCH v5 3/3] arm64: dts: qcom: sa8540p-ride: Add ethernet nodes
Date: Mon, 24 Apr 2023 09:42:40 -0500	[thread overview]
Message-ID: <20230424144240.h7mykl65fae6ygss@halaney-x13s> (raw)
In-Reply-To: <20230414145844.wyg6pt623pzqwh5l@halaney-x13s>

Hey Krzysztof,

Some advice below would be appreciated. I discussed offline with Bjorn
between the two approaches below but it sounded like ultimately we'd
defer to your preference here!

On Fri, Apr 14, 2023 at 09:58:44AM -0500, Andrew Halaney wrote:
> On Thu, Apr 13, 2023 at 03:05:26PM -0700, Stephen Boyd wrote:
> > Quoting Andrew Halaney (2023-04-13 14:01:27)
> > > On Thu, Apr 13, 2023 at 01:47:19PM -0700, Stephen Boyd wrote:
> > > > Quoting Andrew Halaney (2023-04-13 12:15:41)
> > > > >  arch/arm64/boot/dts/qcom/sa8540p-ride.dts | 179 ++++++++++++++++++++++
> > > > >  1 file changed, 179 insertions(+)
> > > > > 
> > > > > diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> > > > > index 40db5aa0803c..650cd54f418e 100644
> > > > > --- a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> > > > > +++ b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> > > > > @@ -28,6 +28,65 @@ aliases {
> > > > >         chosen {
> > > > >                 stdout-path = "serial0:115200n8";
> > > > >         };
> > > > > +
> > > > > +       mtl_rx_setup: rx-queues-config {
> > > > 
> > > > Is there a reason why this isn't a child of an ethernet node?
> > > > 
> > > > 
> > > 
> > > I debated if it was more appropriate to:
> > > 
> > >     1. make a duplicate in each ethernet node (ethernet0/1)
> > >     2. Put it in one and reference from both
> > >     3. have it floating around independent like this, similar to what is
> > >        done in sa8155p-adp.dts[0]
> > > 
> > > I chose 3 as it seemed cleanest, but if there's a good argument for a
> > > different approach I'm all ears!
> > 
> > I wonder if it allows the binding checker to catch bad properties by
> > having it under the ethernet node? That's the only thing I can think of
> > that may be improved, but I'll let binding reviewers comment here.
> > 
> 
> Thanks, I was curious so I played around to answer the question via
> testing, and you're right... rx-queues-config/tx-queues-config aren't
> evaluated unless they sit under the node with the compatible (i.e. it
> doesn't just follow the phandle and evaluate). That makes sense to me I
> suppose.
> 
> So, I guess, would maintainers prefer to see option (1) or (2) above? I
> want that thing evaluated.
> 
> Option 1., above, has duplicated configuration, but is probably a more accurate
> representation of the hardware description.
> 
> Option 2., above, doesn't duplicate rx-queues-config/tx-queues-config,
> but is a weirder representation of hardware description, and only
> complains once (which is fine since it's shared) when the binding checker
> runs (i.e. only the etherent parent containing rx-queues-config yells).
> 

For what it is worth, I prefer option 1 above :)

> In the below example you can see what I mean by the "only complains
> once" comment as well as illustration that the patchset as is doesn't
> allow rx-queues-config/tx-queues-config to be validated by dt-binding
> checks:
> 
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] % # Purposely introduce a dt-binding error on top of the current patchset                                                                                          :(
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] % git diff                                                                                                                                                         :(
> diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> index 650cd54f418e..ecb0000db4e2 100644
> --- a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> +++ b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> @@ -54,7 +54,7 @@ queue2 {
>  
>                 queue3 {
>                         snps,avb-algorithm;
> -                       snps,map-to-dma-channel = <0x3>;
> +                       snps,map-to-dma-channel = "not-correct";
>                         snps,priority = <0xc>;
>                 };
>         };
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] % make CHECK_DTBS=y DT_SCHEMA_FILES=/net/qcom,ethqos.yaml qcom/sa8540p-ride.dtb
>   DTC_CHK arch/arm64/boot/dts/qcom/sa8540p-ride.dtb
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] % # That should have failed
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] % # Move the whole node under ethernet0, have ethernet1 reference via phandle only still
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] % git diff | cat
> diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> index 650cd54f418e..451246936731 100644
> --- a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> +++ b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts
> @@ -29,35 +29,6 @@ chosen {
>  		stdout-path = "serial0:115200n8";
>  	};
>  
> -	mtl_rx_setup: rx-queues-config {
> -		snps,rx-queues-to-use = <1>;
> -		snps,rx-sched-sp;
> -
> -		queue0 {
> -			snps,dcb-algorithm;
> -			snps,map-to-dma-channel = <0x0>;
> -			snps,route-up;
> -			snps,priority = <0x1>;
> -		};
> -
> -		queue1 {
> -			snps,dcb-algorithm;
> -			snps,map-to-dma-channel = <0x1>;
> -			snps,route-ptp;
> -		};
> -
> -		queue2 {
> -			snps,avb-algorithm;
> -			snps,map-to-dma-channel = <0x2>;
> -			snps,route-avcp;
> -		};
> -
> -		queue3 {
> -			snps,avb-algorithm;
> -			snps,map-to-dma-channel = <0x3>;
> -			snps,priority = <0xc>;
> -		};
> -	};
>  
>  	mtl_tx_setup: tx-queues-config {
>  		snps,tx-queues-to-use = <1>;
> @@ -223,6 +194,36 @@ &ethernet0 {
>  
>  	status = "okay";
>  
> +	mtl_rx_setup: rx-queues-config {
> +		snps,rx-queues-to-use = <1>;
> +		snps,rx-sched-sp;
> +
> +		queue0 {
> +			snps,dcb-algorithm;
> +			snps,map-to-dma-channel = <0x0>;
> +			snps,route-up;
> +			snps,priority = <0x1>;
> +		};
> +
> +		queue1 {
> +			snps,dcb-algorithm;
> +			snps,map-to-dma-channel = <0x1>;
> +			snps,route-ptp;
> +		};
> +
> +		queue2 {
> +			snps,avb-algorithm;
> +			snps,map-to-dma-channel = <0x2>;
> +			snps,route-avcp;
> +		};
> +
> +		queue3 {
> +			snps,avb-algorithm;
> +			snps,map-to-dma-channel = "not-correct";
> +			snps,priority = <0xc>;
> +		};
> +	};
> +
>  	mdio {
>  		compatible = "snps,dwmac-mdio";
>  		#address-cells = <1>;
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] % make CHECK_DTBS=y DT_SCHEMA_FILES=/net/qcom,ethqos.yaml qcom/sa8540p-ride.dtb
>   DTC_CHK arch/arm64/boot/dts/qcom/sa8540p-ride.dtb
> /home/ahalaney/git/redhat/stmmac/arch/arm64/boot/dts/qcom/sa8540p-ride.dtb: ethernet@20000: rx-queues-config:queue3:snps,map-to-dma-channel:0: [1852797997, 1668248178, 1701016576] is too long
> 	From schema: /home/ahalaney/git/redhat/stmmac/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> /home/ahalaney/git/redhat/stmmac/arch/arm64/boot/dts/qcom/sa8540p-ride.dtb: ethernet@20000: Unevaluated properties are not allowed ('max-speed', 'mdio', 'phy-handle', 'phy-mode', 'power-domains', 'rx-fifo-depth', 'rx-queues-config', 'snps,mtl-rx-config', 'snps,mtl-tx-config', 'snps,pbl', 'snps,tso', 'tx-fifo-depth' were unexpected)
> 	From schema: /home/ahalaney/git/redhat/stmmac/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] % # That warned as expected, since snps,dwmac.yaml failed on rx-queues-config it warns, \
> 									and since part of the schema failed its not inherited (hence the Unevaluated properties warning following) \
> 									also note how only ethernet0 (@20000) is evaluating rx-queues-config since that's where the rx-queues-config node lives
> (dtschema) ahalaney@halaney-x13s ~/git/redhat/stmmac (git)-[stmmac] %
> 
> Thanks for the review!
>  - Andrew


      reply	other threads:[~2023-04-24 14:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 19:15 [PATCH v5 0/3] Add EMAC3 support for sa8540p-ride (devicetree/clk bits) Andrew Halaney
2023-04-13 19:15 ` [PATCH v5 1/3] clk: qcom: gcc-sc8280xp: Add EMAC GDSCs Andrew Halaney
2023-04-13 19:15 ` [PATCH v5 2/3] arm64: dts: qcom: sc8280xp: Add ethernet nodes Andrew Halaney
2023-04-13 19:15 ` [PATCH v5 3/3] arm64: dts: qcom: sa8540p-ride: " Andrew Halaney
2023-04-13 20:47   ` Stephen Boyd
2023-04-13 21:01     ` Andrew Halaney
2023-04-13 22:05       ` Stephen Boyd
2023-04-14 14:58         ` Andrew Halaney
2023-04-24 14:42           ` Andrew Halaney [this message]

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=20230424144240.h7mykl65fae6ygss@halaney-x13s \
    --to=ahalaney@redhat.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bmasney@redhat.com \
    --cc=devicetree@vger.kernel.org \
    --cc=echanude@redhat.com \
    --cc=hisunil@quicinc.com \
    --cc=jsuraj@qti.qualcomm.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=ncai@quicinc.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.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).