All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Selvamani Rajagopal" <Selvamani.Rajagopal@onsemi.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v10 11/11] net: phy: ncn26000: Support for loopback
Date: Sat, 07 Nov 2026 23:19:12 +0000	[thread overview]
Message-ID: <sashiko-outbox-203387@kernel.org> (raw)
In-Reply-To: <20261106-s2500-mac-phy-support-v10-11-31b5a69b85b7@onsemi.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] net: phy: ncn26000: ncn26000_config_aneg() clears
  BMCR_LOOPBACK in MII_BMCR
--

commit a6fa19dd96a071675ca905f2adbb2958359bdcce
Author: Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>

net: phy: ncn26000: Support for loopback

This commit introduces a generic genphy_loopback_no_speed() helper that
toggles BMCR_LOOPBACK in MII_BMCR without setting speed, and wires it as
the .set_loopback callback for the S2500 and TI DP83867 PHY drivers.

> diff --git a/drivers/net/phy/ncn26000.c b/drivers/net/phy/ncn26000.c
> index 0006e157917df..c115af6eda33d 100644
> --- a/drivers/net/phy/ncn26000.c
> +++ b/drivers/net/phy/ncn26000.c
> @@ -176,6 +176,7 @@ static struct phy_driver ncn26000_driver[] = {
>  		.config_init           = ncn26000_config_init,
>  		.config_aneg           = ncn26000_config_aneg,
>  		.read_status           = ncn26000_read_status,
> +		.set_loopback          = genphy_loopback_no_speed,
>  		.set_plca_cfg          = ncn26000_c45_plca_set_cfg,
>  		.get_plca_cfg          = genphy_c45_plca_get_cfg,
>  		.get_plca_status       = genphy_c45_plca_get_status,

[Severity: Medium]
Does ncn26000_config_aneg() clear BMCR_LOOPBACK when phy_config_aneg() runs
while PHY loopback is enabled?

drivers/net/phy/ncn26000.c:ncn26000_config_aneg() {
	...
	// bring up the link
	return phy_write(phydev, MII_BMCR, NCN26000_BCMR_LINK_CTRL_BIT);
}

genphy_loopback_no_speed() sets BMCR_LOOPBACK in MII_BMCR, but any
subsequent phy_config_aneg() call (for example when phy_state_machine()
processes PHY_UP) overwrites the entire MII_BMCR register via phy_write().
This disables hardware loopback while phydev->loopback_enabled remains
true, causing loopback selftest frames to be transmitted onto the line
instead of looping back.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261106-s2500-mac-phy-support-v10-0-31b5a69b85b7@onsemi.com?part=11

  reply	other threads:[~2026-11-07 23:19 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 23:18 [PATCH net-next v10 00/11] Support for onsemi's S2500 10Base-T1S MAC-PHY Selvamani Rajagopal
2026-11-06 23:18 ` Selvamani Rajagopal via B4 Relay
2026-11-06 23:18 ` [PATCH net-next v10 01/11] dt-bindings: net: add onsemi's S2500 Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-06 23:18 ` [PATCH net-next v10 02/11] Documentation: networking: Add timestamp related APIs to OA TC6 framework Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-08  0:15   ` netdev-bot+sashiko
2026-11-06 23:18 ` [PATCH net-next v10 03/11] net: ethernet: oa_tc6: Move oa_tc6.c to its own directory Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-06 23:18 ` [PATCH net-next v10 04/11] net: ethernet: oa_tc6: Move constant definitions to header file Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-08  0:15   ` netdev-bot+sashiko
2026-11-06 23:18 ` [PATCH net-next v10 05/11] net: ethernet: oa_tc6: Support for hardware timestamp Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-07 23:19   ` sashiko-bot
2026-11-08  0:15   ` netdev-bot+sashiko
2026-11-09  3:11     ` Selvamani Rajagopal
2026-11-06 23:18 ` [PATCH net-next v10 06/11] net: ethernet: oa_tc6: Support for vendor specific MMS Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-07 23:19   ` sashiko-bot
2026-11-08  0:15   ` netdev-bot+sashiko
2026-11-08 19:42     ` Selvamani Rajagopal
2026-11-06 23:18 ` [PATCH net-next v10 07/11] net: phy: ncn26000: Enable enhanced noise immunity Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-06 23:18 ` [PATCH net-next v10 08/11] onsemi: s2500: Add driver support for S2500 MAC-PHY Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-07 23:19   ` sashiko-bot
2026-11-08  0:15   ` netdev-bot+sashiko
2026-11-09  7:21     ` Selvamani Rajagopal
2026-11-06 23:18 ` [PATCH net-next v10 09/11] onsemi: s2500: Added selftest support to onsemi's S2500 driver Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-06 23:18 ` [PATCH net-next v10 10/11] net: phy: ncn26000: Support for onsemi's S2500 internal phy Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-08  0:15   ` netdev-bot+sashiko
2026-11-06 23:18 ` [PATCH net-next v10 11/11] net: phy: ncn26000: Support for loopback Selvamani Rajagopal
2026-11-06 23:18   ` Selvamani Rajagopal via B4 Relay
2026-11-07 23:19   ` sashiko-bot [this message]
2026-11-08  0:15   ` netdev-bot+sashiko
2026-11-09  1:48     ` Selvamani Rajagopal

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=sashiko-outbox-203387@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Selvamani.Rajagopal@onsemi.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 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.