* [PATCH v3 1/3] net: libwx: keep NGBE OCP cards MAC enabled
2026-10-13 2:06 [PATCH net v3 0/3] net: wangxun: keep MAC enabled for NCSI devices Jiawen Wu
@ 2026-10-13 2:06 ` Jiawen Wu
2026-10-13 2:09 ` netdev-bot+sinfo
2026-10-13 2:06 ` [PATCH net v3 1/3] net: wangxun: " Jiawen Wu
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Jiawen Wu @ 2026-10-13 2:06 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, Jacob Keller,
Kees Cook, Chenguang Zhao, Aleksandr Loktionov,
Uwe Kleine-König (The Capable Hub), Russell King (Oracle),
Maciej Fijalkowski, Simon Horman, Jiawen Wu
OCP mezzanine cards are NCSI capable by design, so the NCSI semantics do
apply to them, and they need the MAC receiver to keep running for
out-of-band management. The inline test does not cover the OCP card
type, so on such a card that does not have the NCSI bit set the receiver
was turned off on every path reaching wx_disable_rx(), and management
traffic was dropped.
'wx->ncsi_enabled' is the correct value for NGBE to determine whether
MAC RX/TX should be kept enabled. But it is not assigned in TXGBE, so we
use an explicit subsystem device ID mask in libwx now. We will merge
TXGBE and NGBE into unified 'wx->ncsi_enabled' as soon as possible.
Fixes: 02338c484ab6 ("net: ngbe: Initialize sw info and register netdev")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/libwx/wx_hw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
index 113552586be7..76813b651fd8 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
@@ -1314,7 +1314,8 @@ void wx_disable_rx(struct wx *wx)
wr32(wx, WX_RDB_PB_CTL, rxctrl);
if (!(((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP) ||
- ((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP))) {
+ ((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP) ||
+ (wx->mac.type == wx_mac_em && (wx->subsystem_device_id & 0xFF) == 0x40))) {
/* disable mac receiver */
wr32m(wx, WX_MAC_RX_CFG,
WX_MAC_RX_CFG_RE, 0);
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v3 1/3] net: libwx: keep NGBE OCP cards MAC enabled
2026-10-13 2:06 ` [PATCH v3 1/3] net: libwx: keep NGBE OCP cards MAC enabled Jiawen Wu
@ 2026-10-13 2:09 ` netdev-bot+sinfo
2026-10-13 2:13 ` Jiawen Wu
0 siblings, 1 reply; 7+ messages in thread
From: netdev-bot+sinfo @ 2026-10-13 2:09 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, Jacob Keller,
Kees Cook, Chenguang Zhao, Aleksandr Loktionov,
Uwe Kleine-König (The Capable Hub), Russell King (Oracle),
Maciej Fijalkowski, Simon Horman
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by code inspection). If it was triggered please include
the symptoms, like the stack trace or error messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v3 1/3] net: libwx: keep NGBE OCP cards MAC enabled
2026-10-13 2:09 ` netdev-bot+sinfo
@ 2026-10-13 2:13 ` Jiawen Wu
0 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2026-10-13 2:13 UTC (permalink / raw)
To: netdev-bot+sinfo
Cc: netdev, 'Mengyuan Lou', 'Andrew Lunn',
'David S. Miller', 'Eric Dumazet',
'Jakub Kicinski', 'Paolo Abeni',
'Russell King', 'Jacob Keller',
'Kees Cook', 'Chenguang Zhao',
'Aleksandr Loktionov',
'Uwe Kleine-König (The Capable Hub)',
'Russell King (Oracle)', 'Maciej Fijalkowski',
'Simon Horman'
On Tue, Oct 13, 2026 10:09 AM, netdev-bot+sinfo@kernel.org wrote:
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
>
> - Whether the issue was actually triggered, or is only theoretical
> (e.g. found by code inspection). If it was triggered please include
> the symptoms, like the stack trace or error messages.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account. If the series needs another revision for
> other reasons, please include the information in the commit messages
> then.
>
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.
Sorry this patch was accidentally sent in the V3 series, it should be dropped.
I've changed its status to superseded in patchwork.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net v3 1/3] net: wangxun: keep NGBE OCP cards MAC enabled
2026-10-13 2:06 [PATCH net v3 0/3] net: wangxun: keep MAC enabled for NCSI devices Jiawen Wu
2026-10-13 2:06 ` [PATCH v3 1/3] net: libwx: keep NGBE OCP cards MAC enabled Jiawen Wu
@ 2026-10-13 2:06 ` Jiawen Wu
2026-10-13 2:06 ` [PATCH net v3 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI Jiawen Wu
2026-10-13 2:06 ` [PATCH net v3 3/3] net: txgbe: keep MAC enabled for AML " Jiawen Wu
3 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2026-10-13 2:06 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, Jacob Keller,
Kees Cook, Chenguang Zhao, Aleksandr Loktionov,
Uwe Kleine-König (The Capable Hub), Russell King (Oracle),
Maciej Fijalkowski, Simon Horman, Jiawen Wu
OCP mezzanine cards are NCSI capable by design, so the NCSI semantics do
apply to them, and they need the MAC receiver to keep running for
out-of-band management. The inline test does not cover the OCP card
type, so on such a card that does not have the NCSI bit set the receiver
was turned off on every path reaching wx_disable_rx(), and management
traffic was dropped.
'wx->ncsi_enabled' is the correct value for NGBE to determine whether
MAC RX/TX should be kept enabled. Use 'wx->ncsi_enabled' instead of
open-coding the subsystem ID check, and initialize it for txgbe as well
so that both drivers share the same condition. No functional change for
TXGBE.
Fixes: 02338c484ab6 ("net: ngbe: Initialize sw info and register netdev")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/libwx/wx_hw.c | 2 +-
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
index 113552586be70..1c0c59436890f 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
@@ -1313,7 +1313,7 @@ void wx_disable_rx(struct wx *wx)
rxctrl &= ~WX_RDB_PB_CTL_RXEN;
wr32(wx, WX_RDB_PB_CTL, rxctrl);
- if (!(((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP) ||
+ if (!(wx->ncsi_enabled ||
((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP))) {
/* disable mac receiver */
wr32m(wx, WX_MAC_RX_CFG,
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
index eb91c4f28ecd4..a60a711e8e1b4 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
@@ -267,7 +267,7 @@ static void txgbe_disable_device(struct wx *wx)
wx_set_all_vfs(wx);
}
- if (!(((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP) ||
+ if (!(wx->ncsi_enabled ||
((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP))) {
/* disable mac transmiter */
wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
@@ -381,6 +381,8 @@ static void txgbe_init_type_code(struct wx *wx)
wx->media_type = wx_media_unknown;
break;
}
+
+ wx->ncsi_enabled = ((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP);
}
/**
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net v3 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI
2026-10-13 2:06 [PATCH net v3 0/3] net: wangxun: keep MAC enabled for NCSI devices Jiawen Wu
2026-10-13 2:06 ` [PATCH v3 1/3] net: libwx: keep NGBE OCP cards MAC enabled Jiawen Wu
2026-10-13 2:06 ` [PATCH net v3 1/3] net: wangxun: " Jiawen Wu
@ 2026-10-13 2:06 ` Jiawen Wu
2026-10-13 2:06 ` [PATCH net v3 3/3] net: txgbe: keep MAC enabled for AML " Jiawen Wu
3 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2026-10-13 2:06 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, Jacob Keller,
Kees Cook, Chenguang Zhao, Aleksandr Loktionov,
Uwe Kleine-König (The Capable Hub), Russell King (Oracle),
Maciej Fijalkowski, Simon Horman, Jiawen Wu
SP devices using NCSI require the MAC transmitter and optical Tx to
remain enabled when the host interface is down.
Skip disabling MAC Tx in mac_link_down() for NCSI devices. Keep the
data-path shutdown in mac_prepare() for PCS reconfiguration, and
re-enable MAC Tx in mac_finish() without waiting for host link-up.
txgbe_down() still performs a LAN reset through txgbe_reset_hw() after
the MAC is left enabled. This does not clear MAC Tx on NCSI devices,
because the NCSI firmware protects the MAC configuration from the LAN
reset, so no further re-enable is needed on the down path.
Keep TX_DISABLE deasserted while an NCSI host interface is down.
Retain normal SFP GPIO handling while the interface is up, including
transmit fault recovery.
TX_DISABLE is driven by the SFP core, which asserts it at probe and
whenever the upstream is stopped by phylink_stop(). Neither the SFP
core nor phylink provides a way to keep the transmitter enabled while
the interface is down.
Therefore, handle this in the GPIO controller: requests to assert
TX_DISABLE are ignored while WX_STATE_DOWN is set on an NCSI device.
WX_STATE_DOWN is set before phylink_stop() in txgbe_down() and cleared
before phylink_start() in txgbe_up_complete(), so requests made while
the interface is up, including TX fault recovery, still reach the
hardware.
While the interface is down, the SFP core considers TX_DISABLE
asserted although the line is driven low. This does not affect the
SFP state machine, which stays in SFP_S_DOWN until the upstream is
started again and then deasserts TX_DISABLE itself.
Fixes: 08f08f9390e4 ("net: txgbe: Support phylink MAC layer")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index dc9f243146580..589ad5d2f17b3 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -182,7 +182,8 @@ static void txgbe_mac_link_down(struct phylink_config *config,
{
struct wx *wx = phylink_to_wx(config);
- wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
+ if (!wx->ncsi_enabled)
+ wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
wx->speed = SPEED_UNKNOWN;
if (test_bit(WX_STATE_PTP_RUNNING, wx->state))
@@ -253,6 +254,10 @@ static int txgbe_mac_finish(struct phylink_config *config, unsigned int mode,
txgbe_enable_sec_tx_path(wx);
wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, WX_MAC_RX_CFG_RE);
+ /* NCSI requires MAC Tx to be enabled even if the host link stays down. */
+ if (wx->ncsi_enabled)
+ wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, WX_MAC_TX_CFG_TE);
+
return 0;
}
@@ -368,6 +373,11 @@ static int txgbe_gpio_direction_out(struct gpio_chip *chip, unsigned int offset,
unsigned long flags;
u32 set;
+ /* Keep the NCSI transmitter enabled while the host interface is down. */
+ if (wx->ncsi_enabled && BIT(offset) == TXGBE_GPIOBIT_1 &&
+ test_bit(WX_STATE_DOWN, wx->state))
+ val = 0;
+
set = val ? BIT(offset) : 0;
raw_spin_lock_irqsave(&wx->gpio_lock, flags);
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net v3 3/3] net: txgbe: keep MAC enabled for AML devices that support NCSI
2026-10-13 2:06 [PATCH net v3 0/3] net: wangxun: keep MAC enabled for NCSI devices Jiawen Wu
` (2 preceding siblings ...)
2026-10-13 2:06 ` [PATCH net v3 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI Jiawen Wu
@ 2026-10-13 2:06 ` Jiawen Wu
3 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2026-10-13 2:06 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, Jacob Keller,
Kees Cook, Chenguang Zhao, Aleksandr Loktionov,
Uwe Kleine-König (The Capable Hub), Russell King (Oracle),
Maciej Fijalkowski, Simon Horman, Jiawen Wu
AML devices using NCSI require MAC Tx and Rx to remain enabled after
the host link goes down. However, mac_link_down() disables both paths
unconditionally. On AML 10G/25G devices, txgbe_down() also disables the
TX laser when the host interface is closed, blocking BMC pass-through
transmission even if MAC Tx remains enabled.
Skip disabling MAC Tx and Rx in mac_link_down() when ncsi_enabled is
set. Also keep the TX laser enabled for these devices in txgbe_down().
Fixes: 343929799ace ("net: txgbe: Support to handle GPIO IRQs for AML devices")
Fixes: 6f8b4c01a8cd ("net: txgbe: Implement PHYLINK for AML 25G/10G devices")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c | 6 ++++--
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
index 26d0cfc58ee2c..9f1ce3e2e3a4d 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
@@ -458,8 +458,10 @@ static void txgbe_mac_link_down_aml(struct phylink_config *config,
{
struct wx *wx = phylink_to_wx(config);
- wr32m(wx, TXGBE_AML_MAC_TX_CFG, TXGBE_AML_MAC_TX_CFG_TE, 0);
- wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, 0);
+ if (!wx->ncsi_enabled) {
+ wr32m(wx, TXGBE_AML_MAC_TX_CFG, TXGBE_AML_MAC_TX_CFG_TE, 0);
+ wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, 0);
+ }
wx->speed = SPEED_UNKNOWN;
if (test_bit(WX_STATE_PTP_RUNNING, wx->state))
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
index a60a711e8e1b4..7f0cef24ec28b 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
@@ -295,8 +295,10 @@ void txgbe_down(struct wx *wx)
break;
case wx_mac_aml:
phylink_stop(wx->phylink);
- /* Disable TX laser */
- wr32m(wx, WX_GPIO_DR, TXGBE_GPIOBIT_1, TXGBE_GPIOBIT_1);
+ if (!wx->ncsi_enabled) {
+ /* Disable TX laser */
+ wr32m(wx, WX_GPIO_DR, TXGBE_GPIOBIT_1, TXGBE_GPIOBIT_1);
+ }
break;
case wx_mac_sp:
phylink_stop(wx->phylink);
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread