mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Switch <kyle.switch@motor-comm.com>
To: netdev-bot+sashiko@kernel.org
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, andrew@lunn.ch,
	hkallweit1@gmail.com, linux@armlinux.org.uk,
	Frank.Sae@motor-comm.com, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	ming.xu@motor-comm.com, xiaolin.xu@motor-comm.com,
	jianmin.wang@motor-comm.com
Subject: Re: [PATCH net-next v29 RESEND 1/3] dt-bindings: net: Document Motorcomm YT8824 PHY package
Date: Fri, 4 Dec 2026 15:01:13 +0800	[thread overview]
Message-ID: <23370ff0-5ad4-4592-ac04-1ccd8cae904f@motor-comm.com> (raw)
In-Reply-To: <179629856189.3146.749241867829105903@kernel.org>


On 12/3/26 19:49, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 3 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 2
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml
>    contradicts itself about the package reg in 10g-qxgmii (external) mode.
> - [Low] The commit message says the new `motorcomm,package-mode` property
>    describes 'whether the package operates in internal or external mode',…
> - [Low] motorcomm,yt8824.yaml says the hardware fixes the member PHY MDIO
>    addresses: 4..7 in internal mode (lines 25-28), and base..base+3…
>
> --
>
> dt-bindings: net: Document Motorcomm YT8824 PHY package
>
> This commit adds a devicetree binding for the Motorcomm YT8824, a package
> of four PHYs built on top of ethernet-phy-package.yaml. It adds a new
> motorcomm,package-mode property and defines the package reg as the address
> of the shared top extended register block. It also adds a maintainer and
> the new binding file to the MOTORCOMM PHY DRIVER section in MAINTAINERS.
>
>> diff --git a/Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml b/Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml
>> new file mode 100644
>> index 0000000000000..1065e5382670f
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml
>> @@ -0,0 +1,100 @@
> [ ... ]
>
>> +  motorcomm,package-mode:
>> +    description: |
>> +      PHY package can be configured in 2 modes:
>> +      - internal: YT8824 is embedded in the switch, using
>> +        an internal interface to the MAC. The member PHYs are
>> +        fixed at MDIO addresses 4..7 and the shared top
>> +        extended register block is at address 9.
>> +      - 10g-qxgmii: YT8824 is a standalone external PHY,
>> +        connected via 10G QXGMII. The member PHYs start at
>> +        the base MDIO address and the shared top extended
>> +        register block is at base + 4.
>> +    $ref: /schemas/types.yaml#/definitions/string
>> +    enum: [ internal, 10g-qxgmii ]
>> +
>> +  reg:
>> +    description:
>> +      The absolute MDIO address of the YT8824 shared top extended
>> +      register block.
>> +      For internal mode, this is fixed at 9;
>> +      For external mode, it is the base MDIO address of the four
>> +      member PHYs plus 4, where base is typically 0x0.
>> +      Note that this is NOT the reg of the first member PHY.
> [Severity: Low]
> This isn't a bug, but the wording here doesn't match the enum. The commit
> message says the property is meant:
>
>    "to describe whether the package operates in internal or external mode."
>
> This reg description also says "For external mode". The enum values are
> internal and 10g-qxgmii, so there is no external value.
>
> The driver later in the series checks these strings against phy_modes() in
> yt8824_phy_package_probe_once():
>
> 	} else if (phy_mode_check(mode, PHY_INTERFACE_MODE_10G_QXGMII)) {
> 		package_mode = PHY_INTERFACE_MODE_10G_QXGMII;
>
> So the property looks like a host interface selector, not an
> internal/external switch. Could the commit message and the reg description
> say that, or say 10g-qxgmii mode instead of external mode?
The next version will uniformly adopt the internal and 10G-QXGMII approach.
>> +
>> +required:
>> +  - compatible
>> +  - motorcomm,package-mode
>> +  - reg
>> +
>> +allOf:
>> +  - if:
>> +      properties:
>> +        motorcomm,package-mode:
>> +          const: internal
>> +    then:
>> +      properties:
>> +        reg:
>> +          const: 9
> [Severity: Low]
> The mode description says the member PHYs are fixed at MDIO addresses 4..7
> in internal mode. In 10g-qxgmii mode they are at base..base+3, which is
> reg - 4 .. reg - 1. Should the schema also constrain the child
> ethernet-phy@N nodes?
>
> The children only get the generic pattern from ethernet-phy-package.yaml:
>
> patternProperties:
>    ^ethernet-phy@[a-f0-9]+$:
>      $ref: ethernet-phy.yaml#
>
> As a result, an internal mode DT with member PHYs at 0..3 or 10..13 still
> passes dt_binding_check.
>
> realtek,rtl8224-package.yaml uses the same base schema and limits the child
> reg range relative to the package reg:
>
>    - if:
>        properties:
>          reg: { const: 4 }
>      then:
>        patternProperties:
>          "^ethernet-phy@[a-f0-9]+$":
>            properties:
>              reg: { minimum: 4, maximum: 7 }
>
> Would a similar per-mode child reg constraint work here?
will added  in next patch.
>> +  - if:
>> +      properties:
>> +        motorcomm,package-mode:
>> +          const: 10g-qxgmii
>> +    then:
>> +      properties:
>> +        reg:
>> +          const: 4
> [Severity: Medium]
> Does this conditional match the reg description above? The mode
> description says that in 10g-qxgmii mode the member PHYs start at a base
> MDIO address and the top block is at base + 4. The reg description adds
> "where base is typically 0x0". With reg pinned to const 4, only base 0
> passes dt_binding_check and dtbs_check.
>
> Some boards may put a standalone YT8824 at a non-zero base. Two examples
> are members at 8..11 with the top block at 12, or two YT8824 packages on
> one MDIO bus. The schema would reject these, even though the text
> describes that layout as valid.
>
> The only way to get such a DT to validate would be to write reg = <4>.
> But the driver later in the series uses the package reg directly as the
> top block address. Both ytphy_read_top_ext() and ytphy_write_top_ext() do
> this:
>
> drivers/net/phy/motorcomm.c:ytphy_read_top_ext() {
>      ...
>      ret = __phy_package_write(phydev, 0, YTPHY_PAGE_SELECT, regnum);
>      ...
>      return __phy_package_read(phydev, 0, YTPHY_PAGE_DATA);
> }
>
> With that workaround, every shared top block access would go to the wrong
> MDIO address.
>
> If the hardware always puts the external base at 0, should the "typically"
> and "base + 4" text be changed? If not, could the constraint be relaxed,
> for example to minimum: 4 and maximum: 31?
The next version will fix this by adopting the minimum: 4 and maximum: 
31 approach.
> [ ... ]
>

  reply	other threads:[~2026-12-04  7:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 10:52 [PATCH net-next v29 RESEND 0/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy Kyle Switch
2026-12-02 10:52 ` [PATCH net-next v29 RESEND 1/3] dt-bindings: net: Document Motorcomm YT8824 PHY package Kyle Switch
2026-12-03 11:49   ` netdev-bot+sashiko
2026-12-04  7:01     ` Kyle Switch [this message]
2026-12-02 10:52 ` [PATCH net-next v29 RESEND 2/3] net: phy: Add support for Template Control register for PMA Kyle Switch
2026-12-03 11:49   ` netdev-bot+sashiko
2026-12-04  7:30     ` Kyle Switch
2026-12-02 10:52 ` [PATCH net-next v29 RESEND 3/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy Kyle Switch
2026-12-03 11:49   ` netdev-bot+sashiko

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=23370ff0-5ad4-4592-ac04-1ccd8cae904f@motor-comm.com \
    --to=kyle.switch@motor-comm.com \
    --cc=Frank.Sae@motor-comm.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jianmin.wang@motor-comm.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ming.xu@motor-comm.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=xiaolin.xu@motor-comm.com \
    /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®