From: netdev-bot+sashiko@kernel.org
To: florian.fainelli@broadcom.com
Cc: netdev@vger.kernel.org, nb@tipi-net.de,
bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch,
hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com
Subject: Re: [PATCH net-next v2 1/4] net: phy: broadcom: Report failed ECD pairs as unspecified
Date: Sun, 06 Dec 2026 00:07:32 +0000 [thread overview]
Message-ID: <179651565297.3148.5448830779665771796@kernel.org> (raw)
In-Reply-To: <20261204233633.3790143-2-florian.fainelli@broadcom.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
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] bcm_phy_cable_test_report_pair() only checks for the engine-
failure marker BCM54XX_ECD_LENGTH_RESULTS_FAILED (0x47ae) on pairs…
- [Low] The patch fixes behaviour in the shared Broadcom ECD result
handler but has no Fixes: tag.
--
net: phy: broadcom: Report failed ECD pairs as unspecified
This adds a BCM54XX_ECD_LENGTH_RESULTS_FAILED (0x47ae) sentinel for the
ECD length registers. It also merges the per-pair result and length
reporting into a new helper, bcm_phy_cable_test_report_pair(). When a
pair's length register reads 0x47ae, the pair is reported as UNSPEC and no
fault length is emitted.
> The ECD engine can return the saturated value 0x47ae in a pair's
> length register when the measurement fails. The shared result
> handler currently reports it as a fault distance of 18350 cm.
[Severity: Low]
Should this patch have a Fixes: tag?
The code in bcm_phy_report_length() that passed 0x47ae straight to
ethnl_cable_test_fault_length() came from this commit:
Fixes: 11ecf8c55b91 ("net: phy: broadcom: add cable test support")
At this point in the tree, BCM54140 is the only user of the shared handler,
through bcm_phy_cable_test_get_status_rdb() in drivers/net/phy/bcm54140.c.
BCM54210E only starts using it later in the series.
If BCM54140 can return 0x47ae, this fixes hardware that is already
supported. If the failure only shows up on BCM54210E, could the commit
message say so?
> diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c
> index b64beade8dd93..4911dc8210cdd 100644
> --- a/drivers/net/phy/bcm-phy-lib.c
> +++ b/drivers/net/phy/bcm-phy-lib.c
> @@ -722,21 +722,26 @@ static bool bcm_phy_distance_valid(int result)
> return false;
> }
>
> -static int bcm_phy_report_length(struct phy_device *phydev, int pair)
> +static void bcm_phy_cable_test_report_pair(struct phy_device *phydev,
> + u8 pair, int fault)
> {
> - int val;
> + int code = bcm_phy_cable_test_report_trans(fault);
> + int len = -ENODATA;
>
> - val = __bcm_phy_read_exp(phydev,
> - BCM54XX_EXP_ECD_PAIR_A_LENGTH_RESULTS + pair);
> - if (val < 0)
> - return val;
> + if (bcm_phy_distance_valid(fault))
> + len = __bcm_phy_read_exp(phydev,
> + BCM54XX_EXP_ECD_PAIR_A_LENGTH_RESULTS +
> + pair);
>
> - if (val == BCM54XX_ECD_LENGTH_RESULTS_INVALID)
> - return 0;
> + /* The fault type is not valid either when the engine failed */
> + if (len == BCM54XX_ECD_LENGTH_RESULTS_FAILED)
> + code = ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC;
[Severity: Medium]
Can a failed pair still be reported as OK here?
The comment says the fault type is not valid when the engine fails. The
length register is the only failure indicator used, and it is only read
when bcm_phy_distance_valid(fault) is true. That means the nibble has to
be OPEN, SAME_SHORT or CROSS_SHORT:
static bool bcm_phy_distance_valid(int result)
{
switch (result) {
case BCM54XX_ECD_FAULT_TYPE_OPEN:
case BCM54XX_ECD_FAULT_TYPE_SAME_SHORT:
case BCM54XX_ECD_FAULT_TYPE_CROSS_SHORT:
return true;
}
return false;
}
Suppose a failed run leaves a pair's nibble as BCM54XX_ECD_FAULT_TYPE_OK:
- len stays -ENODATA.
- The 0x47ae check never fires.
- bcm_phy_cable_test_report_trans() returns
ETHTOOL_A_CABLE_RESULT_CODE_OK.
User space then sees a healthy pair instead of UNSPEC. INVALID, BUSY and
unknown nibbles already map to UNSPEC, so OK appears to be the only case
affected.
The new header definition also describes 0x47ae as an ECD failure without
tying it to any fault type:
#define BCM54XX_ECD_LENGTH_RESULTS_FAILED 0x47ae /* saturated, ECD failure */
Would it make sense to read the length register for OK pairs as well, and
check for the sentinel before trusting the decoded nibble? If the hardware
only reports 0x47ae together with an OPEN or SHORT code, could the commit
message and the comment say that?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204233633.3790143-1-florian.fainelli%40broadcom.com
next prev parent reply other threads:[~2026-12-06 0:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 23:36 [PATCH net-next v2 0/4] net: phy: Cable tests for BCM54210E Florian Fainelli
2026-12-04 23:36 ` [PATCH net-next v2 1/4] net: phy: broadcom: Report failed ECD pairs as unspecified Florian Fainelli
2026-12-06 0:07 ` netdev-bot+sashiko [this message]
2026-12-04 23:36 ` [PATCH net-next v2 2/4] net: phy: broadcom: Implement cable test initialization for BCM54210E Florian Fainelli
2026-12-06 0:07 ` netdev-bot+sashiko
2026-12-04 23:36 ` [PATCH net-next v2 3/4] net: phy: broadcom: Wire-up cable tests " Florian Fainelli
2026-12-06 0:07 ` netdev-bot+sashiko
2026-12-04 23:36 ` [PATCH net-next v2 4/4] net: phy: broadcom: Recover BCM54210E from aborted cable tests Florian Fainelli
2026-12-06 0:07 ` 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=179651565297.3148.5448830779665771796@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.