From: Krzysztof Kozlowski <krzk@kernel.org>
To: Lukasz Majewski <lukma@denx.de>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
davem@davemloft.net, Andrew Lunn <andrew+netdev@lunn.ch>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
devicetree@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Richard Cochran <richardcochran@gmail.com>,
netdev@vger.kernel.org,
Maxime Chevallier <maxime.chevallier@bootlin.com>
Subject: Re: [PATCH 2/5] dt-bindings: net: Add MTIP L2 switch description (fec,mtip-switch.yaml)
Date: Tue, 25 Mar 2025 13:24:16 +0100 [thread overview]
Message-ID: <bf6d066c-f0dd-471a-bb61-9132476b515a@kernel.org> (raw)
In-Reply-To: <20250325131507.692804cd@wsk>
On 25/03/2025 13:15, Lukasz Majewski wrote:
> Hi Krzysztof,
>
>> On 25/03/2025 12:57, Lukasz Majewski wrote:
>>> This patch provides description of the MTIP L2 switch available in
>>> some NXP's SOCs - imx287, vf610.
>>>
>>> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>>> ---
>>> .../bindings/net/fec,mtip-switch.yaml | 160
>>> ++++++++++++++++++
>>
>> Use compatible as filename.
>
> I've followed the fsl,fec.yaml as an example. This file has description
> for all the device tree sources from fec_main.c
That's a 14 year old binding, so clear antipattern.
>
> I've considered adding the full name - e.g. fec,imx287-mtip-switch.yaml
> but this driver could (and probably will) be extended to vf610.
Unless you add vf610 now, this should follow the compatible name.
>
> So what is the advised way to go?
>
>>
>>> 1 file changed, 160 insertions(+)
>>> create mode 100644
>>> Documentation/devicetree/bindings/net/fec,mtip-switch.yaml
>>>
>>> diff --git
>>> a/Documentation/devicetree/bindings/net/fec,mtip-switch.yaml
>>> b/Documentation/devicetree/bindings/net/fec,mtip-switch.yaml new
>>> file mode 100644 index 000000000000..cd85385e0f79 --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/net/fec,mtip-switch.yaml
>>> @@ -0,0 +1,160 @@
>>> +# SPDX-License-Identifier: GPL-2.0-only
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/net/fsl,mtip-switch.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Freescale MTIP Level 2 (L2) switch
>>> +
>>> +maintainers:
>>> + - Lukasz Majewski <lukma@denx.de>
>>> +
>>
>> description?
>
> Ok.
>
>>
>>> +allOf:
>>> + - $ref: ethernet-controller.yaml#
>>> +
>>> +properties:
>>> + compatible:
>>> + oneOf:
>>
>> Drop, you have only one variant.
>
> Ok, for imx287 this can be dropped, and then extended with vf610.
>
>>
>>> + - enum:
>>> + - imx287-mtip-switch
>>
>> This wasn't tested. Except whitespace errors, above compatible does
>> not have format of compatible. Please look at other NXP bindings.
>>
>> Missing blank line.
>>
>>> + reg:
>>> + maxItems: 1
>>> +
>>> + interrupts:
>>> + maxItems: 3
>>
>> Need to list items instead.
>>
>>> +
>>> + clocks:
>>> + maxItems: 4
>>> + description:
>>> + The "ipg", for MAC ipg_clk_s, ipg_clk_mac_s that are for
>>> register accessing.
>>> + The "ahb", for MAC ipg_clk, ipg_clk_mac that are bus clock.
>>> + The "ptp"(option), for IEEE1588 timer clock that requires
>>> the clock.
>>> + The "enet_out"(option), output clock for external device,
>>> like supply clock
>>> + for PHY. The clock is required if PHY clock source from SOC.
>>>
>>
>> Same problems. This binding does not look at all as any other
>> binding. I finish review here, but the code has similar trivial
>> issues all the way, including incorrect indentation. Start from well
>> reviewed existing binding or example-schema.
>
> As I've stated above - this code is reduced copy of fsl,fec.yaml...
Don't take the worst, old code with all the anti-patterns we point out
on each review, as an example.
Take the most recent, well reviewed binding as an example. Or
example-schema.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-03-25 12:24 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 11:57 [PATCH 0/5] net: mtip: Add support for MTIP imx287 L2 switch driver Lukasz Majewski
2025-03-25 11:57 ` [PATCH 1/5] MAINTAINERS: Add myself as the MTIP L2 switch maintainer (IMX SoCs: imx287) Lukasz Majewski
2025-03-25 12:01 ` Krzysztof Kozlowski
2025-03-25 12:15 ` Lukasz Majewski
2025-03-25 11:57 ` [PATCH 2/5] dt-bindings: net: Add MTIP L2 switch description (fec,mtip-switch.yaml) Lukasz Majewski
2025-03-25 12:04 ` Krzysztof Kozlowski
2025-03-25 12:15 ` Lukasz Majewski
2025-03-25 12:24 ` Krzysztof Kozlowski [this message]
2025-03-25 12:39 ` Lukasz Majewski
2025-03-25 12:43 ` Krzysztof Kozlowski
2025-03-25 14:27 ` Lukasz Majewski
2025-03-25 13:25 ` Rob Herring (Arm)
2025-03-25 15:05 ` Andrew Lunn
2025-03-25 15:11 ` Krzysztof Kozlowski
2025-03-25 16:12 ` Lukasz Majewski
2025-03-26 13:43 ` Lukasz Majewski
2025-03-26 14:15 ` Krzysztof Kozlowski
2025-03-26 15:24 ` Andrew Lunn
2025-03-25 11:57 ` [PATCH 3/5] arm: dts: Adjust the 'reg' range for imx287 L2 switch description Lukasz Majewski
2025-03-25 12:04 ` Krzysztof Kozlowski
2025-03-25 12:19 ` Lukasz Majewski
2025-03-25 11:57 ` [PATCH 4/5] arm: dts: imx287: Provide description for MTIP L2 switch Lukasz Majewski
2025-03-25 15:14 ` Andrew Lunn
2025-03-25 16:16 ` Lukasz Majewski
2025-03-25 11:57 ` [PATCH 5/5] net: mtip: The L2 switch driver for imx287 Lukasz Majewski
2025-03-25 12:11 ` Krzysztof Kozlowski
2025-03-25 13:28 ` Lukasz Majewski
2025-03-25 14:36 ` Krzysztof Kozlowski
2025-03-25 15:34 ` Andrew Lunn
2025-03-25 16:38 ` Lukasz Majewski
2025-03-25 17:13 ` Krzysztof Kozlowski
2025-03-25 17:30 ` Lukasz Majewski
2025-03-25 14:51 ` [PATCH 0/5] net: mtip: Add support for MTIP imx287 L2 switch driver Rob Herring (Arm)
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=bf6d066c-f0dd-471a-bb61-9132476b515a@kernel.org \
--to=krzk@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukma@denx.de \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@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
all inboxes | Powered by JetHome®