Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v6 06/12] net: Document PCS subsystem
Date: Wed, 10 Jun 2026 16:16:21 +0000	[thread overview]
Message-ID: <20260610161621.E3B621F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260609151212.29469-7-ansuelsmth@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Late PCS registration handling is structurally broken and causes `phylink_create` to fail permanently.
- [Low] Multiple grammatical and spelling errors in the PCS subsystem documentation.
--

commit 84279427a07ae5692e53d4ed76f418a074b2aea9
Author: Christian Marangi <ansuelsmth@gmail.com>

net: Document PCS subsystem
    
This commit adds extensive documentation of the new PCS subsystem and the
fwnode implementation with producer/consumer API.

> diff --git a/Documentation/networking/pcs.rst b/Documentation/networking/pcs.rst
> new file mode 100644
> index 0000000000000..9436ba43cebdf
> --- /dev/null
> +++ b/Documentation/networking/pcs.rst

[ ... ]

> +Looking up PCS Devices (fwnode implementation)
> +-----------------------------------------------
> +
> +The lookup of a PCS device follows the common producer/consumer implementation
> +used by similar subsystem with a ``#pcs-cells`` on the producer and a
> +``pcs-handle`` property on the consumer::

[Severity: Low]
This isn't a bug, but there are a few minor grammatical and spelling errors in
the newly added documentation. Should "subsystem" be "subsystems" here?

Additionally, a few other minor typos are present in this document:
- "The fwnode implementation expose" -> "exposes"
- "should be used to relase them" -> "release"
- "takes three arg" -> "takes three arguments"

[ ... ]

> +Late PCS registration handling
> +------------------------------
> +
> +It's possible that a PCS becomes available after the MAC finished probing.
> +Contrary to the usual producer/consumer implementation, when a PCS is not
> +registered and can't be found, the fwnode parser helper returns ``-EINVAL``
> +instead of ``-EPROBE_DEFER``.
> +
> +This is to prevent race condition with particular devices that register
> +MAC and PCS with USB or PCIe and require the MAC to be registered before
> +the PCS.
> +
> +The phylink logic correctly handle this special case and keep the phylink
> +instance in a fail condition.

[Severity: High]
Is this description of the failure state accurate with the current
implementation?

Looking at phylink_create() in drivers/net/phy/phylink.c, if a PCS is
missing, it appears to abort the creation entirely:

phylink_create() {
    ...
    ret = phylink_fill_available_pcs(pl, config);
    if (ret) {
        kfree(pl);
        return ERR_PTR(ret);
    }
    ...
}

Similarly, if fwnode_phylink_pcs_parse() in drivers/net/pcs/pcs.c cannot
find a PCS, it returns an error:

fwnode_phylink_pcs_parse() {
    ...
    pcs = fwnode_pcs_get(fwnode, i);
    if (IS_ERR(pcs))
        return PTR_ERR(pcs);
    ...
}

If this error propagates up through the MAC driver's fill_available_pcs()
callback to phylink_fill_available_pcs(), wouldn't phylink_create()
immediately free the phylink instance and return the error before the late
registration notifier is ever registered?

Could you clarify how the instance is kept in a fail condition if it gets
freed during phylink_create()?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260609151212.29469-1-ansuelsmth@gmail.com?part=6

  reply	other threads:[~2026-06-10 16:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 15:11 [PATCH net-next v6 00/12] net: pcs: Introduce support for fwnode PCS Christian Marangi
2026-06-09 15:11 ` [PATCH net-next v6 01/12] net: phylink: keep and use MAC supported_interfaces in phylink struct Christian Marangi
2026-06-10 16:16   ` sashiko-bot
2026-06-09 15:11 ` [PATCH net-next v6 02/12] net: phylink: introduce internal phylink PCS handling Christian Marangi
2026-06-10 16:16   ` sashiko-bot
2026-06-09 15:11 ` [PATCH net-next v6 03/12] net: phylink: add phylink_release_pcs() to externally release a PCS Christian Marangi
2026-06-10 16:16   ` sashiko-bot
2026-06-09 15:12 ` [PATCH net-next v6 04/12] net: pcs: implement Firmware node support for PCS driver Christian Marangi
2026-06-10 16:16   ` sashiko-bot
2026-06-09 15:12 ` [PATCH net-next v6 05/12] net: phylink: support late PCS provider attach Christian Marangi
2026-06-10 16:16   ` sashiko-bot
2026-06-09 15:12 ` [PATCH net-next v6 06/12] net: Document PCS subsystem Christian Marangi
2026-06-10 16:16   ` sashiko-bot [this message]
2026-06-09 15:12 ` [PATCH net-next v6 07/12] MAINTAINERS: add myself as PCS subsystem maintainer Christian Marangi
2026-06-09 15:12 ` [PATCH net-next v6 08/12] of: property: fw_devlink: Add support for "pcs-handle" Christian Marangi
2026-06-09 15:12 ` [PATCH net-next v6 09/12] net: phylink: add .pcs_link_down PCS OP Christian Marangi
2026-06-10 16:16   ` sashiko-bot
2026-06-09 15:12 ` [PATCH net-next v6 10/12] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS Christian Marangi
2026-06-10 16:16   ` sashiko-bot
2026-06-09 15:12 ` [PATCH net-next v6 11/12] net: pcs: airoha: add PCS driver for Airoha AN7581 SoC Christian Marangi
2026-06-10 16:16   ` sashiko-bot
2026-06-09 15:12 ` [PATCH net-next v6 12/12] net: airoha: add phylink support Christian Marangi
2026-06-09 15:29   ` Lorenzo Bianconi
2026-06-09 23:51     ` Christian Marangi
2026-06-10 16:16   ` sashiko-bot

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=20260610161621.E3B621F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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