* [PATCH 0/2] ngbe PHY interrupt configuration
@ 2026-11-25 11:11 Zaiyu Wang
2026-11-27 17:47 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Zaiyu Wang @ 2026-11-25 11:11 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang
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(+)
--
2.55.0.windows.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 0/2] ngbe PHY interrupt configuration
2026-11-25 11:11 [PATCH 0/2] ngbe PHY interrupt configuration Zaiyu Wang
@ 2026-11-27 17:47 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2026-11-27 17:47 UTC (permalink / raw)
To: Zaiyu Wang; +Cc: dev
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-27 17:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 11:11 [PATCH 0/2] ngbe PHY interrupt configuration Zaiyu Wang
2026-11-27 17:47 ` Stephen Hemminger
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.