mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: dong100@mucse.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	yaojun@mucse.com
Subject: Re: [PATCH net-next v3 3/5] net: rnpgbe: Support copper link configuration
Date: Wed, 25 Nov 2026 06:36:03 +0000	[thread overview]
Message-ID: <179558856322.3135.5490844008487521629@kernel.org> (raw)
In-Reply-To: <C0071FBC8B693BE4+20261124060602.411328-1-dong100@mucse.com>

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

Critical: 0 · High: 0 · Medium: 1 · 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).

- [Medium] This patch adds kernel-doc to mucse_mbx_set_link()
  (drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c, lines 216-218):…

--

net: rnpgbe: Support copper link configuration

This commit adds set_link_ksettings support for copper ports in the
rnpgbe driver. Copper ports can now configure autonegotiation, advertised
modes, forced 10/100 Mb/s speed and duplex, and MDI/MDI-X selection.
Requests to change the media type reported by firmware are rejected, and
PHY_LINK_SET now uses the event-coalescing mailbox transport.

> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c
> index 469818b83d70f..70eef8ed7f5cc 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c
> @@ -210,7 +210,12 @@ int mucse_mbx_get_macaddr(struct mucse_hw *hw, int pfvfnum,
>   * @duplex: forced duplex mode when autonegotiation is disabled
>   * @mdix_ctrl: MDI/MDI-X control mode
>   *
> - * Firmware ignores @speed, @duplex when @autoneg is true.
> + * Firmware ignores @speed and @duplex when @autoneg is true, and
> + * @advertising when @autoneg is false.
> + *
> + * Firmware acknowledges the request when it consumes it. If the ACK
> + * wait times out, firmware will not apply the request later, so the
> + * previous link configuration remains valid.

[Severity: Medium]
Does anything on the driver side enforce this guarantee?

The request is already fully posted to firmware before the ACK wait
starts. In mucse_write_mbx_pf_coalesce_event():

	for (int i = 0; i < size_in_words; i++)
		mbx_data_wr32(mbx, MUCSE_MBX_FWPF_SHM + i * 4,
			      le32_to_cpu(msg[i]));

	hw->mbx.fw_ack = mucse_mbx_get_fwack(mbx);
	mucse_mbx_inc_pf_req(hw);
	mucse_release_mbx_lock_pf(hw, true);

mucse_write_mbx_coalesce_event() then calls mucse_poll_for_ack(), which
gives up after mbx->timeout_us (4 seconds).

On -ETIMEDOUT, neither mucse_write_mbx_coalesce_event() nor
mucse_mbx_set_link() clears the SHM payload, rolls back the PF request
counter or withdraws the request.

What stops slow firmware from seeing the incremented request counter and
applying PHY_LINK_SET after the poll has already returned an error?

The new runtime caller relies on this comment. rnpgbe_set_link_ksettings()
updates the cached configuration only on success:

	err = mucse_mbx_set_link(&mucse->hw, advertising, autoneg,
				 autoneg ? 0 : cmd->base.speed,
				 autoneg ? 0 : cmd->base.duplex, mdix);
	if (!err) {
		mucse->hw.mdix_ctrl = mdix;
		mucse->hw.link_config.advertising = advertising;
		...

Suppose firmware applies the request late. ethtool -s would have returned
an error, but the PHY would be running the new autoneg, forced
speed/duplex or MDI-X setting. rnpgbe_get_link_ksettings() would keep
reporting the old advertising, speed, duplex, autoneg and
eth_tp_mdix_ctrl values.

There is also a related case. The late ACK for the timed-out request
could arrive after the next PF command has sampled hw->mbx.fw_ack. Could
mucse_check_for_ack_pf() then count it as the ACK for that new command?

Before this patch, PHY_LINK_SET was only sent from probe through
rnpgbe_setup_default_link(), and a failure there aborts probe. With this
patch it can be sent at runtime while firmware is busy with link events.

The kernel-doc for rnpgbe_init_link_config() already says that firmware
can be held up completing forced 10 Mb/s link setup. A slow ACK seems
most likely in that window.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/6C54E9FB2E95869E%2B20261124060436.410989-1-dong100%40mucse.com

  reply	other threads:[~2026-11-25  6:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  6:04 [PATCH net-next v3 0/5] net: rnpgbe: Add basic management and statistics Dong Yibo
2026-11-24  6:05 ` [PATCH net-next v3 1/5] net: rnpgbe: Add basic ethtool support Dong Yibo
2026-11-24  6:05 ` [PATCH net-next v3 2/5] net: rnpgbe: Report link settings through ethtool Dong Yibo
2026-11-25  6:36   ` netdev-bot+sashiko
2026-11-25  7:09     ` Yibo Dong
2026-11-24  6:06 ` [PATCH net-next v3 3/5] net: rnpgbe: Support copper link configuration Dong Yibo
2026-11-25  6:36   ` netdev-bot+sashiko [this message]
2026-11-25  7:31     ` Yibo Dong
2026-11-24  6:06 ` [PATCH net-next v3 4/5] net: rnpgbe: Allow changing the primary MAC address Dong Yibo
2026-11-25  6:36   ` netdev-bot+sashiko
2026-11-24  6:06 ` [PATCH net-next v3 5/5] net: rnpgbe: Add hardware and queue statistics Dong Yibo
2026-11-25  6:36   ` netdev-bot+sashiko
2026-11-25  7:36     ` Yibo Dong

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=179558856322.3135.5490844008487521629@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dong100@mucse.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yaojun@mucse.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

all inboxes | Powered by JetHome®