From: Stephen Hemminger <stephen@networkplumber.org>
To: Ashok Kumar Natarajan <ashokkumar.natarajan@amd.com>
Cc: <dev@dpdk.org>, <Selwin.Sebastian@amd.com>
Subject: Re: [PATCH v4 2/3] net/axgbe: add support for marvell m88e1512 PHY
Date: Fri, 27 Feb 2026 15:25:30 -0800 [thread overview]
Message-ID: <20260227152530.55efde7f@phoenix.local> (raw)
In-Reply-To: <20260227084431.709-1-ashokkumar.natarajan@amd.com>
On Fri, 27 Feb 2026 14:14:29 +0530
Ashok Kumar Natarajan <ashokkumar.natarajan@amd.com> wrote:
> @@ -2556,6 +2922,21 @@ static int axgbe_phy_init(struct axgbe_port *pdata)
> }
>
> phy_data->phy_cdr_delay = AXGBE_CDR_DELAY_INIT;
> +
> + ret = axgbe_get_phy_id(pdata);
> + if (ret) {
> + PMD_DRV_LOG_LINE(ERR, "failed to get PHY id");
> + return ret;
> + }
> +
> + PMD_DRV_LOG_LINE(DEBUG, "PHY ID = 0x%x", phy_data->phy_id);
> +
> + if (phy_data->phy_id == M88E1512_E_PHY_ID) {
> + ret = axgbe_m88e1512_init(pdata);
> + if (ret)
> + return ret;
> + }
> +
> return 0;
> }
AI was confused and thinks that there may be an issue here:
Patch 2/3: net/axgbe: add support for marvell m88e1512 PHY
Error — axgbe_get_phy_id() called unconditionally in axgbe_phy_init() (potential regression)
This is the most significant finding in the series. axgbe_get_phy_id() is inserted at the end of axgbe_phy_init() without any guard on port mode:

c
phy_data->phy_cdr_delay = AXGBE_CDR_DELAY_INIT;
+
+ ret = axgbe_get_phy_id(pdata);
+ if (ret) {
+ PMD_DRV_LOG_LINE(ERR, "failed to get PHY id");
+ return ret;
+ }
axgbe_phy_init() is called for all port modes — SFP, backplane, 10GBASE-T, etc. For port modes that have no external PHY, axgbe_phy_read() will attempt a Clause 22 MDIO read on phy_data->mdio_addr and likely timeout (-ETIMEDOUT), causing the entire PHY init to fail. This is a regression for devices that previously worked.
The M88E1512-specific init block below already checks phy_data->phy_id, but the axgbe_get_phy_id() call itself must not fail for non-1000BASE-T ports.
Fix: Gate the PHY ID read (and subsequent M88E1512 init) on the port mode:

c
if (phy_data->port_mode == AXGBE_PORT_MODE_1000BASE_T) {
ret = axgbe_get_phy_id(pdata);
if (ret) {
PMD_DRV_LOG_LINE(ERR, "failed to get PHY id");
return ret;
}
if (phy_data->phy_id == M88E1512_E_PHY_ID) {
ret = axgbe_m88e1512_init(pdata);
if (ret)
return ret;
}
}
This is consistent with how axgbe_phy_link_status() in the same patch correctly guards the external PHY check with if (phy_data->port_mode == AXGBE_PORT_MODE_1000BASE_T).
Confidence: High (~90%). The MDIO read will go through hardware I/O regardless of whether a PHY exists at the address.
next prev parent reply other threads:[~2026-02-27 23:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 12:52 [PATCH 1/3] net/axgbe: Add external PHY read/write functions Ashok Kumar Natarajan
2026-02-16 12:52 ` [PATCH 2/3] net/axgbe: Add support for Marvell M88E1512 PHY Ashok Kumar Natarajan
2026-02-16 16:29 ` Stephen Hemminger
2026-02-25 12:47 ` [PATCH v2 2/3] net/axgbe: add support for marvell m88e1512 PHY Ashok Kumar Natarajan
2026-02-26 16:47 ` [PATCH v3 " Ashok Kumar Natarajan
2026-02-27 8:44 ` [PATCH v4 " Ashok Kumar Natarajan
2026-02-27 23:25 ` Stephen Hemminger [this message]
2026-02-28 14:39 ` [PATCH v5 " Ashok Kumar Natarajan
2026-02-16 12:52 ` [PATCH 3/3] net/axgbe: Add support for 100Mbps link speed Ashok Kumar Natarajan
2026-02-25 12:49 ` [PATCH v2 3/3] net/axgbe: add " Ashok Kumar Natarajan
2026-02-26 16:49 ` [PATCH v3 3/3] net/axgbe: fix 100M SGMII mode Ashok Kumar Natarajan
2026-02-27 8:45 ` [PATCH v4 " Ashok Kumar Natarajan
2026-02-28 14:40 ` [PATCH v5 " Ashok Kumar Natarajan
2026-02-17 0:27 ` [PATCH 1/3] net/axgbe: Add external PHY read/write functions Stephen Hemminger
2026-02-25 12:44 ` [PATCH v2 1/3] net/axgbe: add " Ashok Kumar Natarajan
2026-02-25 23:09 ` Stephen Hemminger
2026-02-26 17:09 ` Natarajan, Ashok Kumar
2026-02-26 16:46 ` [PATCH v3 " Ashok Kumar Natarajan
2026-02-26 19:09 ` Stephen Hemminger
2026-02-27 8:43 ` [PATCH v4 " Ashok Kumar Natarajan
2026-02-28 14:37 ` [PATCH v5 " Ashok Kumar Natarajan
2026-02-28 16:41 ` Stephen Hemminger
2026-03-01 4:35 ` Natarajan, Ashok Kumar
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=20260227152530.55efde7f@phoenix.local \
--to=stephen@networkplumber.org \
--cc=Selwin.Sebastian@amd.com \
--cc=ashokkumar.natarajan@amd.com \
--cc=dev@dpdk.org \
/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