From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH net-next v16 07/12] net: Document PCS subsystem
Date: Fri, 18 Sep 2026 00:45:24 +0000 [thread overview]
Message-ID: <20260918004524.7D8421F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260916235200.20712-8-ansuelsmth@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] phylink: validate_mac_and_pcs incorrectly validates missing required PCS
--
commit cc21dbb17c411b60be48a08479995c35804697fd
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. It also updates the
sfp-phylink migration guide.
> diff --git a/Documentation/networking/pcs.rst b/Documentation/networking/pcs.rst
> new file mode 100644
> index 0000000000000..2cae702319484
> --- /dev/null
> +++ b/Documentation/networking/pcs.rst
> @@ -0,0 +1,234 @@
[ ... ]
> +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 ``-ENODEV``
> +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: Medium]
Does the phylink logic actually handle this correctly and keep the instance
in a fail condition?
Looking at phylink_validate_mac_and_pcs() in drivers/net/phy/phylink.c, if a
PCS is missing during phylink_create() due to late attach, it appears to
bypass the pcs_validate restrictions:
} else if (test_bit(state->interface, pl->config->pcs_interfaces)) {
struct phylink_pcs *tmp;
list_for_each_entry(tmp, &pl->pcs_list, list) {
if (!phylink_validate_pcs_interface(tmp, state->interface)) {
pcs = tmp;
break;
}
}
}
if (pcs) {
...
If it falls through without returning -EINVAL, pl->supported receives the full
MAC capabilities.
Because pl->supported is never recalculated when the PCS attaches later, the
advertised link modes remain too broad.
This could lead to incorrect auto-negotiation masks and potential link
configuration failures observable via ethtool.
Should this function return -EINVAL if pcs is NULL but the interface requires
a PCS, rather than silently falling through to MAC validation?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916235200.20712-1-ansuelsmth@gmail.com?part=7
next prev parent reply other threads:[~2026-09-18 0:45 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 23:51 [PATCH net-next v16 00/12] net: pcs: Introduce support for fwnode PCS Christian Marangi
2026-09-16 23:51 ` [PATCH net-next v16 01/12] net: phylink: keep and use MAC supported_interfaces in phylink struct Christian Marangi
2026-09-16 23:51 ` [PATCH net-next v16 02/12] net: phylink: introduce internal phylink PCS handling Christian Marangi
2026-09-18 0:45 ` sashiko-bot
2026-09-16 23:51 ` [PATCH net-next v16 03/12] net: pcs: implement Firmware node support for PCS driver Christian Marangi
2026-09-18 0:45 ` sashiko-bot
2026-09-16 23:51 ` [PATCH net-next v16 04/12] net: phylink: save phylink instance fwnode on phylink_create Christian Marangi
2026-09-16 23:51 ` [PATCH net-next v16 05/12] net: phylink: support PCS provider release Christian Marangi
2026-09-18 0:45 ` sashiko-bot
2026-09-16 23:51 ` [PATCH net-next v16 06/12] net: phylink: support late PCS provider attach Christian Marangi
2026-09-18 0:45 ` sashiko-bot
2026-09-16 23:51 ` [PATCH net-next v16 07/12] net: Document PCS subsystem Christian Marangi
2026-09-18 0:45 ` sashiko-bot [this message]
2026-09-16 23:51 ` [PATCH net-next v16 08/12] MAINTAINERS: add myself as PCS subsystem maintainer Christian Marangi
2026-09-16 23:51 ` [PATCH net-next v16 09/12] net: phylink: add .pcs_link_down PCS OP Christian Marangi
2026-09-16 23:51 ` [PATCH net-next v16 10/12] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS Christian Marangi
2026-09-24 22:17 ` Rob Herring (Arm)
2026-09-16 23:51 ` [PATCH net-next v16 11/12] net: pcs: airoha: add PCS driver for Airoha AN7581 SoC Christian Marangi
2026-09-18 0:45 ` sashiko-bot
2026-09-16 23:51 ` [PATCH net-next v16 12/12] net: airoha: add phylink support Christian Marangi
2026-09-21 20:59 ` [PATCH net-next v16 00/12] net: pcs: Introduce support for fwnode PCS Jakub Kicinski
2026-09-22 10:12 ` Christian Marangi (Ansuel)
2026-09-22 12:49 ` Maxime Chevallier
2026-09-22 13:26 ` Coia Prant
2026-09-23 0:25 ` Jakub Kicinski
2026-09-23 8:31 ` Christian Marangi (Ansuel)
2026-09-24 3:11 ` Jakub Kicinski
2026-09-24 8:03 ` Maxime Chevallier
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=20260918004524.7D8421F00893@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