From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
To: Rob Herring <robh@kernel.org>
Cc: Serge Semin <fancer.lancer@gmail.com>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
Jose Abreu <joabreu@synopsys.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Johan Hovold <johan@kernel.org>,
Maxime Ripard <mripard@kernel.org>,
Joao Pinto <jpinto@synopsys.com>, Lars Persson <larper@axis.com>,
Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
Vyacheslav Mitrofanov
<Vyacheslav.Mitrofanov@baikalelectronics.ru>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
<netdev@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 03/25] dt-bindings: net: dwmac: Fix the TSO property declaration
Date: Wed, 16 Dec 2020 11:59:34 +0300 [thread overview]
Message-ID: <20201216085934.tlp5axhauyshb2st@mobilestation> (raw)
In-Reply-To: <20201215172240.GA4047815@robh.at.kernel.org>
On Tue, Dec 15, 2020 at 11:22:40AM -0600, Rob Herring wrote:
> On Mon, Dec 14, 2020 at 12:15:53PM +0300, Serge Semin wrote:
> > Indeed the STMMAC driver doesn't take the vendor-specific compatible
> > string into account to parse the "snps,tso" boolean property. It just
> > makes sure the node is compatible with DW MAC 4.x, 5.x and DW xGMAC
> > IP-cores. Fix the conditional statement so the TSO-property would be
> > evaluated for the compatibles having the corresponding IP-core version.
> >
> > While at it move the whole allOf-block from the tail of the binding file
> > to the head of it, as it's normally done in the most of the DT schemas.
> >
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> >
> > ---
> >
> > Note this won't break the bindings description, since the "snps,tso"
> > property isn't parsed by the Allwinner SunX GMAC glue driver, but only
> > by the generic platform DT-parser.
>
> But still should be valid for Allwinner?
I don't know. It seems to me that even the original driver developer
didn't know what DW MAC IP has been used to create the Allwinner
EMAC, since in the cover letter to the original patch he said:
"During the development, it appeared that in fact the hardware was
a modified version of some dwmac." (See https://lwn.net/Articles/721459/)
Most likely Maxime Ripard also didn't know that when he was converting
the legacy bindings to the DT schema.
What I do know the TSO is supported by the driver only for IP-cores with
version higher than 4.00. (See the stmmac_probe_config_dt() method
implementation). Version is determined by checking whether the DT
device node compatible property having the "snps,dwmac-*" or
"snps,dwxgmac" strings. Allwinner EMAC nodes aren't defined with
those strings, so they won't have the TSO property parsed and set.
>
> > ---
> > .../devicetree/bindings/net/snps,dwmac.yaml | 52 +++++++++----------
> > 1 file changed, 24 insertions(+), 28 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > index e084fbbf976e..0dd543c6c08e 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > @@ -37,6 +37,30 @@ select:
> > required:
> > - compatible
> >
> > +allOf:
> > + - $ref: "ethernet-controller.yaml#"
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + enum:
> > + - snps,dwmac-4.00
> > + - snps,dwmac-4.10a
> > + - snps,dwmac-4.20a
> > + - snps,dwmac-5.10a
> > + - snps,dwxgmac
> > + - snps,dwxgmac-2.10
> > +
> > + required:
> > + - compatible
> > + then:
> > + properties:
> > + snps,tso:
> > + $ref: /schemas/types.yaml#definitions/flag
> > + description:
> > + Enables the TSO feature otherwise it will be managed by
> > + MAC HW capability register.
>
> BTW, I prefer that properties are defined unconditionally, and then
> restricted in conditional schemas (or ones that include this schema).
Are you saying that it's ok to have all the properties unconditionally
defined in some generic schema and then being un-defined (like redefined
to a false-schema) in a schema including (allOf-ing) it?
>
> > +
> > properties:
> >
> > # We need to include all the compatibles from schemas that will
> > @@ -314,34 +338,6 @@ dependencies:
> > snps,reset-active-low: ["snps,reset-gpio"]
> > snps,reset-delay-us: ["snps,reset-gpio"]
> >
> > -allOf:
> > - - $ref: "ethernet-controller.yaml#"
> > - - if:
> > - properties:
> > - compatible:
> > - contains:
> > - enum:
> > - - allwinner,sun7i-a20-gmac
>
> This does not have a fallback, so snps,tso is no longer validated. I
> didn't check the rest.
Until the DT node is having a compatible string with the DW MAC
IP-core version the property won't be checked by the driver anyway.
AFAICS noone really knows what IP was that. So most likely the
allwinner emacs have been added to this conditional schema by
mistake...
-Sergey
>
> > - - allwinner,sun8i-a83t-emac
> > - - allwinner,sun8i-h3-emac
> > - - allwinner,sun8i-r40-emac
> > - - allwinner,sun8i-v3s-emac
> > - - allwinner,sun50i-a64-emac
> > - - snps,dwmac-4.00
> > - - snps,dwmac-4.10a
> > - - snps,dwmac-4.20a
> > - - snps,dwxgmac
> > - - snps,dwxgmac-2.10
> > - - st,spear600-gmac
> > -
> > - then:
> > - properties:
> > - snps,tso:
> > - $ref: /schemas/types.yaml#definitions/flag
> > - description:
> > - Enables the TSO feature otherwise it will be managed by
> > - MAC HW capability register.
> > -
> > additionalProperties: true
> >
> > examples:
> > --
> > 2.29.2
> >
next prev parent reply other threads:[~2020-12-16 9:00 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-14 9:15 [PATCH 00/25] net: stmmac: Fix clocks/reset-related procedures Serge Semin
2020-12-14 9:15 ` [PATCH 01/25] dt-bindings: net: dwmac: Validate PBL for all IP-cores Serge Semin
2020-12-15 17:14 ` Rob Herring
2020-12-14 9:15 ` [PATCH 02/25] dt-bindings: net: dwmac: Extend number of PBL values Serge Semin
2020-12-15 17:14 ` Rob Herring
2020-12-14 9:15 ` [PATCH 03/25] dt-bindings: net: dwmac: Fix the TSO property declaration Serge Semin
2020-12-15 17:22 ` Rob Herring
2020-12-16 8:59 ` Serge Semin [this message]
2020-12-14 9:15 ` [PATCH 04/25] dt-bindings: net: dwmac: Refactor snps,*-config properties Serge Semin
2020-12-14 14:30 ` Rob Herring
2020-12-15 8:54 ` Serge Semin
2020-12-15 14:08 ` Rob Herring
2020-12-16 6:24 ` Serge Semin
2020-12-14 9:15 ` [PATCH 05/25] dt-bindings: net: dwmac: Elaborate stmmaceth/pclk description Serge Semin
2020-12-15 17:30 ` Rob Herring
2020-12-14 9:15 ` [PATCH 06/25] dt-bindings: net: dwmac: Add Tx/Rx clock sources Serge Semin
2020-12-15 17:32 ` Rob Herring
2020-12-16 6:02 ` Serge Semin
2020-12-15 17:32 ` Rob Herring
2020-12-14 9:15 ` [PATCH 07/25] dt-bindings: net: dwmac: Detach Generic DW MAC bindings Serge Semin
2020-12-15 17:50 ` Rob Herring
2020-12-16 9:10 ` Serge Semin
2020-12-14 9:15 ` [PATCH 08/25] net: stmmac: Add snps,*-config sub-nodes support Serge Semin
2020-12-14 9:15 ` [PATCH 09/25] net: stmmac: dwmac-rk: Cleanup STMMAC DT-config in remove cb Serge Semin
2020-12-14 9:16 ` [PATCH 10/25] net: stmmac: dwmac-sti: " Serge Semin
2020-12-14 9:16 ` [PATCH 11/25] net: stmmac: dwmac-stm32: " Serge Semin
2020-12-14 9:16 ` [PATCH 12/25] net: stmmac: Directly call reverse methods in stmmac_probe_config_dt() Serge Semin
2020-12-14 9:16 ` [PATCH 13/25] net: stmmac: Fix clocks left enabled on glue-probes failure Serge Semin
2020-12-14 9:16 ` [PATCH 14/25] net: stmmac: Use optional clock request method to get stmmaceth Serge Semin
2020-12-14 9:16 ` [PATCH 15/25] net: stmmac: Use optional clock request method to get pclk Serge Semin
2020-12-14 9:16 ` [PATCH 16/25] net: stmmac: Use optional clock request method to get ptp_clk Serge Semin
2020-12-14 9:16 ` [PATCH 17/25] net: stmmac: Use optional reset control API to work with stmmaceth Serge Semin
2020-12-14 9:16 ` [PATCH 18/25] net: stmmac: dwc-qos: Cleanup STMMAC platform data clock pointers Serge Semin
2020-12-14 9:16 ` [PATCH 19/25] net: stmmac: dwc-qos: Use dev_err_probe() for probe errors handling Serge Semin
2020-12-14 9:16 ` [PATCH 20/25] net: stmmac: Add Tx/Rx platform clocks support Serge Semin
2020-12-14 9:16 ` [PATCH 21/25] net: stmmac: dwc-qos: Discard Tx/Rx clocks request Serge Semin
2020-12-14 9:16 ` [PATCH 22/25] net: stmmac: dwmac-imx: Discard Tx clock request Serge Semin
2020-12-14 9:16 ` [PATCH 23/25] net: stmmac: Call stmmaceth clock as system clock in warn-message Serge Semin
2020-12-14 9:16 ` [PATCH 24/25] net: stmmac: Use pclk to set MDC clock frequency Serge Semin
2020-12-14 9:16 ` [PATCH 25/25] net: stmmac: dwc-qos: Save master/slave clocks in the plat-data Serge Semin
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=20201216085934.tlp5axhauyshb2st@mobilestation \
--to=sergey.semin@baikalelectronics.ru \
--cc=Alexey.Malahov@baikalelectronics.ru \
--cc=Pavel.Parkhomenko@baikalelectronics.ru \
--cc=Vyacheslav.Mitrofanov@baikalelectronics.ru \
--cc=alexandre.torgue@st.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=joabreu@synopsys.com \
--cc=johan@kernel.org \
--cc=jpinto@synopsys.com \
--cc=kuba@kernel.org \
--cc=larper@axis.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=mripard@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=robh@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