From: Stephen Hemminger <stephen@networkplumber.org>
To: Zaiyu Wang <zaiyuwang@trustnetic.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH 0/2] ngbe PHY interrupt configuration
Date: Fri, 27 Nov 2026 09:47:22 -0800 [thread overview]
Message-ID: <20261127094722.44f08014@phoenix.local> (raw)
In-Reply-To: <A3DA76B5B04DDFD1+20261125111142.12226-1-zaiyuwang@trustnetic.com>
On Wed, 25 Nov 2026 19:11:03 +0800
Zaiyu Wang <zaiyuwang@trustnetic.com> wrote:
> Two PHYs have interrupt-related configuration issues, each fixed by an
> independent patch in this series.
>
> Zaiyu Wang (2):
> net/ngbe: mask unused internal PHY interrupts
> net/ngbe: fix YT8531S-CA interrupt in combo mode
>
> drivers/net/ngbe/base/ngbe_phy_rtl.c | 2 ++
> drivers/net/ngbe/base/ngbe_phy_yt.c | 17 +++++++++++++++++
> 2 files changed, 19 insertions(+)
>
AI review spotted some issues here.
Subject: Re: [PATCH 2/2] net/ngbe: fix YT8531S-CA interrupt in combo mode
Series applies to main and builds with -Dwerror=true. Patch 1/2 has
no findings.
[PATCH 2/2] net/ngbe: fix YT8531S-CA interrupt in combo mode
Warning: the new block runs for every YT PHY in every chip mode, not
only YT8531S-CA in UTP_FIBER_TO_RGMII mode.
ngbe_write_phy_reg_ext_yt(hw, YT_SPEC_CONF, 0,
YT_SPEC_CONF_8531SH_CA);
...
ngbe_write_phy_reg_ext_yt(hw, YT_MISC, 0, 0x10d);
ngbe_init_phy_yt() is the init_hw hook for both ngbe_phy_yt8521s and
ngbe_phy_yt8521s_sfi, so UTP-only (mode 0), fiber-to-RGMII (mode 1)
and SGMII (mode 4) boards now get the 8531SH-CA config, and
YT_MISC = 0x10d sets YT_MISC_FIBER_PRIO on UTP-only parts. The
existing YT_SPEC_CONF write in ngbe_setup_phy_link_yt() is limited
to the mode 2 branch. Gate the new code the same way:
rte_spinlock_lock(&hw->phy_lock);
ngbe_read_phy_reg_ext_yt(hw, YT_CHIP, 0, &value);
if ((value & YT_CHIP_MODE_MASK) == YT_CHIP_MODE_SEL(2)) {
ngbe_write_phy_reg_ext_yt(hw, YT_SPEC_CONF, 0,
YT_SPEC_CONF_8531SH_CA);
...
}
rte_spinlock_unlock(&hw->phy_lock);
Warning: YT_INTR is not a stable way to identify the part.
ngbe_read_phy_reg_mdi(hw, YT_INTR, 0, &value);
if (value != 0x31 && value != 0x32) {
YT_INTR is the interrupt enable register, and this same function
writes YT_INTR_ENA_MASK | YT_SDS_INTR_ENA_MASK (0x0c0c) to it when
hw->lsc is set. ngbe_dev_start() calls phy.init_hw() on every start,
so on a stop/start cycle with LSC enabled the read returns 0x0c0c
unless something resets the PHY in between, and a 0x31/0x32 part
then gets the extra config. If a chip ID or revision register
exists, use it; otherwise decide once at first init and cache the
result in hw.
Also say what 0x31/0x32 identify, and give 0xa071, 0x52, 0x51, 0x57
and the 0x10d value names or at least a comment. As written,
nobody can tell from the code or the commit message which parts are
excluded or why.
Review-Result: WARNING
prev parent reply other threads:[~2026-11-27 17:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 11:11 [PATCH 0/2] ngbe PHY interrupt configuration Zaiyu Wang
2026-11-27 17:47 ` Stephen Hemminger [this message]
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=20261127094722.44f08014@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=zaiyuwang@trustnetic.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox