From: netdev-bot+sashiko@kernel.org
To: mail@birger-koblitz.de
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, linux@armlinux.org.uk, andrew@lunn.ch,
hkallweit1@gmail.com, chenhuacai@kernel.org, kernel@xen0n.name,
edumazet@kernel.org, linux-usb@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
loongarch@lists.linux.dev, neuromoments@gmail.com,
beganovic.emir@gmail.com
Subject: Re: [PATCH net-next v21 08/13] ax88179_178a: Add AX179A/AX279 multicast configuration
Date: Mon, 16 Nov 2026 02:07:02 +0000 [thread overview]
Message-ID: <179479482220.3136.14070184395975500303@kernel.org> (raw)
In-Reply-To: <20261114-ax88179a-v21-8-c2d34410bcbe@birger-koblitz.de>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
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 hooks ax88179_set_multicast() up as
.ndo_set_rx_mode for the AX88179A/AX88772D/AX88279 family…
- [Low] The patch is titled "Add AX179A/AX279 multicast configuration",
but it changes ax88179_set_multicast() in…
--
ax88179_178a: Add AX179A/AX279 multicast configuration
This commit changes ax88179_set_multicast() to build the RX_CTL value in
a local variable. The value now always includes AX_RX_CTL_DROPCRCERR,
and AX_RX_CTL_IPE is added only when data->ip_align is set. The commit
also hooks ax88179_set_multicast() up as .ndo_set_rx_mode for the
AX88179A family netdev ops.
> diff --git a/drivers/net/usb/ax88179_lib.c b/drivers/net/usb/ax88179_lib.c
> index fa6423f51849e..f27b073e1bccb 100644
> --- a/drivers/net/usb/ax88179_lib.c
> +++ b/drivers/net/usb/ax88179_lib.c
> @@ -319,16 +319,21 @@ int ax88179_set_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom, u8
> void ax88179_set_multicast(struct net_device *net)
> {
[ ... ]
> - data->rxctl = (AX_RX_CTL_START | AX_RX_CTL_AB | AX_RX_CTL_IPE);
> + rxctl = (AX_RX_CTL_START | AX_RX_CTL_AB | AX_RX_CTL_DROPCRCERR);
> + if (data->ip_align)
> + rxctl |= AX_RX_CTL_IPE;
[Severity: Low]
ax88179_set_multicast() is shared code. The legacy AX88179/AX88178A
driver in ax88179_178a.c also uses it as .ndo_set_rx_mode. ip_align is
always 1 for those chips, so IPE does not change for them. The only
change on legacy hardware is that DROPCRCERR now stays set after every
open and every RX mode change.
Before this patch, the START|AB|IPE value cleared the DROPCRCERR bit
that ax88179_reset() programs. With the bit kept set, the chip drops
bad-CRC frames before they reach ax88179_rx_fixup(). They are then no
longer counted here:
drivers/net/usb/ax88179_178a.c:ax88179_rx_fixup() {
...
if ((*pkt_hdr & (AX_RXHDR_CRC_ERR | AX_RXHDR_DROP_ERR)) ||
pkt_len < 2 + ETH_HLEN) {
dev->net->stats.rx_errors++;
...
}
The subject only names AX179A/AX279. Could the commit message say that
the legacy chips are affected too, and that their rx_errors accounting
changes?
The commit message also says:
"make sure that AX_RX_CTL_DROPCRCERR is also set to be consistent
with the initial configuration in ax88179_reset()"
That is only partly true. ax88179_reset() and ax88179a_reset() both set
AX_RX_CTL_AP, and this function still clears it.
The comment in ax88179a_bind() points to a different reason, a
requirement of the AX88279:
/* The AX88279 requires both the AX_RX_CTL_IPE and AX_RX_CTL_DROPCRCERR
* bits set in AX_RX_CTL for creating correct RX-URBs. AX_RX_CTL_DROPCRCERR
* is anyway set for all chips, make sure AX_RX_CTL_IPE is set via ip_align.
Would it be clearer to split the legacy behaviour change into its own
patch, or to describe it in the commit message? This also appears to be
unchanged at the end of the series.
[ ... ]
> diff --git a/drivers/net/usb/ax88179a_devices.c b/drivers/net/usb/ax88179a_devices.c
> index 4207d2cc2b865..a6b0a3f47118c 100644
> --- a/drivers/net/usb/ax88179a_devices.c
> +++ b/drivers/net/usb/ax88179a_devices.c
> @@ -678,6 +678,7 @@ static const struct net_device_ops ax88179a_netdev_ops = {
> .ndo_set_mac_address = ax88179_set_mac_addr,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_eth_ioctl = ax88179a_mii_ioctl,
> + .ndo_set_rx_mode = ax88179_set_multicast,
[Severity: Medium]
This hook makes ax88179_set_multicast() a second writer of AX_RX_CTL on
the AX88179A/AX88772D/AX88279 family. What serializes it with
ax88179a_mac_link_up()?
ax88179_set_multicast() is called from __dev_set_rx_mode() with only
netif_addr_lock_bh() held. It stores data->rxctl with WRITE_ONCE(),
always with AX_RX_CTL_START set, and then submits an async control URB
through ax88179_write_cmd_async().
ax88179a_mac_link_up() runs from the phylink_resolve() worker with
phy->lock and pl->state_mutex held. It takes medium_status_mutex around
its final write. It holds neither RTNL nor addr_list_lock, and
ax88179_set_multicast() never takes medium_status_mutex:
drivers/net/usb/ax88179a_devices.c:ax88179a_mac_link_up() {
...
/* Stop RX/TX for link configuration */
ax88179_write_u16(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, AX_RX_CTL_STOP);
ax88179_write_u8(dev, AX_ACCESS_MAC, AX88179A_MAC_PATH, 1, 0);
...
mutex_lock(&ax179_data->medium_status_mutex);
...
ax88179_write_u16(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, READ_ONCE(ax179_data->rxctl));
mutex_unlock(&ax179_data->medium_status_mutex);
...
}
Could an update be lost in this sequence?
phylink_resolve() worker
ax88179a_mac_link_up()
READ_ONCE(ax179_data->rxctl) returns the old value
dev_set_promiscuity()
ax88179_set_multicast()
WRITE_ONCE(data->rxctl, rxctl with PRO)
async AX_RX_CTL URB completes
ax88179_write_u16(..., AX_RX_CTL, 2, <old value>)
The hardware would then be missing PRO/AM/AMALL even though
data->rxctl says they are set. This would last until the next RX mode
change or link flap. Enabling promisc, adding the device to a bridge or
starting tcpdump while a link-up is being processed could all trigger
it.
The ordering also looks open. Suppose an async START|AB|DROPCRCERR
write is submitted after the AX_RX_CTL_STOP write but before the final
restore. RX would be turned back on while the RX CDC and bulk-in
settings for the new speed are only partly programmed. What the
hardware does with START set while MAC_PATH is 0 isn't documented, so
this part is less certain.
The WRITE_ONCE()/READ_ONCE() pair prevents torn reads. It does not
make "read rxctl, then program the register" atomic with respect to the
other writer.
Before this patch these devices had no ndo_set_rx_mode. AX_RX_CTL was
only written from the reset, link_up, unbind and suspend paths. This
also appears to be unchanged at the end of the series.
> .ndo_set_features = ax88179a_set_features,
> .ndo_vlan_rx_add_vid = ax88179a_vlan_rx_add_vid,
> .ndo_vlan_rx_kill_vid = ax88179a_vlan_rx_kill_vid,
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261114-ax88179a-v21-0-c2d34410bcbe%40birger-koblitz.de
next prev parent reply other threads:[~2026-11-16 2:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 10:50 [PATCH net-next v21 00/13] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-11-14 10:50 ` [PATCH net-next v21 01/13] phylink: Add phylink_mac_interrupt Birger Koblitz
2026-11-16 2:06 ` netdev-bot+sashiko
2026-11-14 10:50 ` [PATCH net-next v21 02/13] phylib: Add support for PHYs with broken forced mode Birger Koblitz
2026-11-16 2:06 ` netdev-bot+sashiko
2026-11-14 10:50 ` [PATCH net-next v21 03/13] ax88179_178a: Split driver into library and device specific code Birger Koblitz
2026-11-16 2:06 ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 04/13] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-11-16 2:06 ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 05/13] ax88179_178a: Add EEE configuration support for AX88179A MACs Birger Koblitz
2026-11-14 10:51 ` [PATCH net-next v21 06/13] ax88179_178a: Add EEE configuration support for AX88179A PHYs Birger Koblitz
2026-11-16 2:06 ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 07/13] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-11-16 2:07 ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 08/13] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-11-16 2:07 ` netdev-bot+sashiko [this message]
2026-11-14 10:51 ` [PATCH net-next v21 09/13] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279 Birger Koblitz
2026-11-16 2:07 ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 10/13] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-11-16 2:07 ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 11/13] ax88179_178a: Update driver name and information Birger Koblitz
2026-11-16 2:07 ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 12/13] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-11-16 2:07 ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 13/13] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-11-16 2:07 ` netdev-bot+sashiko
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=179479482220.3136.14070184395975500303@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=beganovic.emir@gmail.com \
--cc=chenhuacai@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=kernel@xen0n.name \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=loongarch@lists.linux.dev \
--cc=mail@birger-koblitz.de \
--cc=netdev@vger.kernel.org \
--cc=neuromoments@gmail.com \
--cc=pabeni@redhat.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®