Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: jiawenwu@trustnetic.com
Cc: netdev@vger.kernel.org, mengyuanlou@net-swift.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk,
	jacob.e.keller@intel.com, kees@kernel.org,
	zhaochenguang@kylinos.cn, aleksandr.loktionov@intel.com,
	u.kleine-koenig@baylibre.com, rmk+kernel@armlinux.org.uk,
	maciej.fijalkowski@intel.com, horms@kernel.org
Subject: Re: [PATCH net v3 3/3] net: txgbe: keep MAC enabled for AML devices that support NCSI
Date: Wed, 14 Oct 2026 02:59:09 +0000	[thread overview]
Message-ID: <179194674956.434549.1230595205361313006@kernel.org> (raw)
In-Reply-To: <20261013020626.5548-5-jiawenwu@trustnetic.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 0 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] This patch has no effect on any txgbe device.

--

net: txgbe: keep MAC enabled for AML devices that support NCSI

This patch makes txgbe_mac_link_down_aml() leave MAC Tx and Rx enabled
when wx->ncsi_enabled is set. In that case it also stops txgbe_down()
from disabling the TX laser on AML 10G/25G devices. The goal is to keep
BMC pass-through working after the host interface goes down.

> 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);
> +	}

[Severity: High]
Is wx->ncsi_enabled ever set for txgbe devices?

Under drivers/net/ethernet/wangxun/, the only assignment seems to be in
ngbe:

drivers/net/ethernet/wangxun/ngbe/ngbe_main.c:ngbe_init_type_code() {
    ...
	wx->ncsi_enabled = (ncsi_mask == WX_NCSI_SUP ||
			   type_mask == NGBE_SUBID_OCP_CARD) ? 1 : 0;
    ...
}

txgbe_sw_init(), txgbe_init_type_code() and wx_sw_init() don't appear to
set it. struct wx lives in the netdev private area from
devm_alloc_etherdev_mqs(), which is zeroed, so the field would stay
false.

If that's right, on AML NCSI boards this path still clears
TXGBE_AML_MAC_TX_CFG_TE and WX_MAC_RX_CFG_RE:

txgbe_close()
  txgbe_down()
    phylink_stop()
      txgbe_mac_link_down_aml()

The new check in txgbe_down() would also still assert TX_DISABLE:

	case wx_mac_aml:
		phylink_stop(wx->phylink);
		if (!wx->ncsi_enabled) {
			/* Disable TX laser */
			wr32m(wx, WX_GPIO_DR, TXGBE_GPIOBIT_1, TXGBE_GPIOBIT_1);
		}

Wouldn't BMC pass-through still break on "ip link set dev X down", just
as it did before this patch?

An earlier commit in this series, "net: libwx: keep NGBE OCP cards MAC
enabled", seems to say the same thing: "'wx->ncsi_enabled' ... is not
assigned in TXGBE, so we use an explicit subsystem device ID mask in libwx
now".

Earlier on the same down path, txgbe_disable_device() checks the
subsystem ID directly:

	if (!(((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP) ||
	      ((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);
	}

So txgbe_disable_device() leaves MAC Tx on for NCSI SKUs, and then
txgbe_mac_link_down_aml() turns it off. That check also covers
WX_WOL_SUP. A test on ncsi_enabled alone would skip WX_WOL_SUP even if
the field were set.

Should txgbe_sw_init() set wx->ncsi_enabled from
subsystem_device_id & WX_NCSI_MASK, the way ngbe does? Or should these
checks use the subsystem ID test directly?

The SP-side patch in this series, "net: txgbe: keep MAC enabled for SP
devices that support NCSI", appears to rely on the same field in
txgbe_phy.c.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261013020626.5548-2-jiawenwu%40trustnetic.com

      reply	other threads:[~2026-10-14  2:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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:09   ` netdev-bot+sinfo
2026-10-13  2:13     ` Jiawen Wu
2026-10-13  2:06 ` [PATCH net v3 1/3] net: wangxun: " 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-14  2:59   ` netdev-bot+sashiko
2026-10-13  2:06 ` [PATCH net v3 3/3] net: txgbe: keep MAC enabled for AML " Jiawen Wu
2026-10-14  2:59   ` netdev-bot+sashiko [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=179194674956.434549.1230595205361313006@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maciej.fijalkowski@intel.com \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=zhaochenguang@kylinos.cn \
    /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