On 30/11/2026 9:35 am, netd…@kernel.org wrote:> Thank you for your contribution! Sashiko AI review found 5 potential
> issue(s) to consider. > > Critical: 0 · High: 1 · Medium: 0 · Low: 4 (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). > > - [High] Legacy AX88179/AX88178A adapters > (drivers/net/usb/ax88179_178a.c) stop receiving after ifup. > - [Low] In this patch alone, the new `net->features & (NETIF_F_RXFCS | > NETIF_F_RXALL)` test in `ax88179_set_multicast()` can never be true. > - [Low] In this patch, `ax88179a_reset()` still sets AX_RX_CTL_DROPCRCERR > unconditionally in `data->rxctl` and in the hardware. > - [Low] The comment in `ax88179a_bind()` says 'AX_RX_CTL_DROPCRCERR is > anyway set for all chips'. > - [Low] Moving `ax88179_set_multicast()` from rebuilding rxctl to a read- > modify-write of `data->rxctl` also silently keeps AX_RX_CTL_AP… > > Pre-existing issues: > - [Low] Three writers of AX_RX_CTL do not share a lock. > > -- > > net: usb: ax88179: Make receiving FCS on AX88179A configurable > > This commit changes ax88179_set_multicast() to start from the cached > data->rxctl value. Before, it built the value from a fixed > START | AB | DROPCRCERR seed. With this patch, AX_RX_CTL_DROPCRCERR is > set on AX88179A only when NETIF_F_RXFCS or NETIF_F_RXALL is enabled, and > is always set on the other chips. >
>> diff --git a/drivers/net/usb/ax88179_lib.c b/drivers/net/usb/ax88179_lib.c >> index 821ee9cd8ded1..6a0023e6153dc 100644 >> --- a/drivers/net/usb/ax88179_lib.c >> +++ b/drivers/net/usb/ax88179_lib.c >> @@ -352,14 +352,19 @@ void ax88179_set_multicast(struct net_device *net) >> struct usbnet *dev = netdev_priv(net); >> u8 *m_filter = ((u8 *)dev->data); >> struct ax88179_data *data; >> - u16 rxctl = 0; >> + u16 rxctl; >> data = dev->driver_priv; >> - rxctl = (AX_RX_CTL_START | AX_RX_CTL_AB | AX_RX_CTL_DROPCRCERR); >> + rxctl = READ_ONCE(data->rxctl); >> + rxctl &= ~(AX_RX_CTL_IPE | AX_RX_CTL_DROPCRCERR | AX_RX_CTL_PRO | >> + AX_RX_CTL_AMALL | AX_RX_CTL_AM);
> > [Severity: High] > Does this stop RX on the legacy AX88179/AX88178A devices handled by > ax88179_178a.c? > > The new code assumes data->rxctl already holds AX_RX_CTL_START and > AX_RX_CTL_AB. The legacy driver never stores anything in that field. > ax88179_bind() allocates ax179_data with kzalloc_obj(), so rxctl starts > at 0. ax88179_reset() programs the register only from a stack buffer: > > drivers/net/usb/ax88179_178a.c:ax88179_reset() { > ... > *tmp16 = AX_RX_CTL_DROPCRCERR | AX_RX_CTL_IPE | AX_RX_CTL_START | > AX_RX_CTL_AP | AX_RX_CTL_AMALL | AX_RX_CTL_AB; > ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, tmp16); > ... > } > > On ifup the sequence is: > > __dev_open() > usbnet_open() > ax88179_reset() /* START written to hardware only */ > dev_set_rx_mode() > ax88179_set_multicast() /* starts from data->rxctl == 0 */ > > The value written to AX_RX_CTL and cached in data->rxctl then has > neither AX_RX_CTL_START nor AX_RX_CTL_AB set. > > ax88179_link_reset() writes that cached value again on every link-up: > > drivers/net/usb/ax88179_178a.c:ax88179_link_reset() { > ... > mode = 0; > ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, &mode); > ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, > &ax179_data->rxctl); > ... > } > > Wouldn't the receiver then stay disabled? > > If so, this statement in the commit message would not hold: > > "For the older AX88179, the behaviour does not change." > > The follow-up patch "net: usb: ax88179: Support NETIF_F_RXFCS and > NETIF_F_RXALL on AX88179A" does not touch ax88179_178a.c, so this > appears to remain at the end of the series. >
I will change this so that the behavior for the legacy AX88179 devices stays unchanged.
> [Severity: Low] > Is it intended that AX_RX_CTL_AP now survives every rx_mode update on > AX88179A/AX88772D/AX88279? > > ax88179a_reset() puts AP into data->rxctl: > > drivers/net/usb/ax88179a_devices.c:ax88179a_reset() { > ... > rxctl = AX_RX_CTL_DROPCRCERR | AX_RX_CTL_START | AX_RX_CTL_AP | > AX_RX_CTL_AMALL | AX_RX_CTL_AB; > ... > WRITE_ONCE(ax179_data->rxctl, rxctl); > ax88179_write_u16(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, rxctl); > } > > Before this patch, the first ndo_set_rx_mode call rebuilt the value, > which cleared AP. The new clear mask leaves AP set, and > ax88179a_mac_link_up() writes it again on each link-up. > > This changes the RX filter programming beyond the FCS change, and the > commit message does not mention it. At the end of the series, > ax88179a_reset() still sets AP and the mask is the same. >
>> + >> if (data->ip_align) >> rxctl |= AX_RX_CTL_IPE; >> - >> + if (net->features & (NETIF_F_RXFCS | NETIF_F_RXALL) || >> + data->chip_version != AX_VERSION_AX88179A) >> + rxctl |= AX_RX_CTL_DROPCRCERR;
> > [Severity: Low] > Can the NETIF_F_RXFCS | NETIF_F_RXALL test ever be true with only this > patch applied? > > ax88179a_bind() does not add either feature to hw_features. Neither > ax88179a_set_features() nor ax88179_set_features() reprograms AX_RX_CTL > when these features change. ax88179a_rx_fixup() also still drops > errored frames, so RXALL would not deliver them. > > The follow-up patch "net: usb: ax88179: Support NETIF_F_RXFCS and > NETIF_F_RXALL on AX88179A" adds the hw_features bits, the set_features > handling and the rx_fixup changes. This only affects this patch when > applied on its own. >
Will not change.
> [Severity: Low] > ax88179a_reset() still sets AX_RX_CTL_DROPCRCERR unconditionally, in > both data->rxctl and the hardware (see the ax88179a_reset() snippet > above). > > Nothing calls ndo_set_rx_mode after ax88179a_resume()->ax88179a_reset(). > Wouldn't AX88179A/AX88772D go back to appending the FCS after a resume? > ax88179a_mac_link_up() would then write that value again on each > link-up. > > The follow-up patch "net: usb: ax88179: Support NETIF_F_RXFCS and > NETIF_F_RXALL on AX88179A" makes DROPCRCERR conditional in > ax88179a_reset(). That makes the reset/resume path match > ax88179_set_multicast(). >
Will not change.
> [Severity: Low] > This isn't a bug, but this change makes the comment in ax88179a_bind() > stale: > > /* 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. > > DROPCRCERR is no longer set on AX88179A unless RXFCS or RXALL is > enabled. The follow-up patch in the series rewrites this comment. >
>> if (net->flags & IFF_PROMISC) { >> rxctl |= AX_RX_CTL_PRO; >> } else if (net->flags & IFF_ALLMULTI ||
>
Will not change.
> [Severity: Low] > This is a pre-existing issue and was not introduced by this patch. > ax88179_set_multicast() ends with: > > WRITE_ONCE(data->rxctl, rxctl); > ax88179_write_cmd_async(dev, AX_ACCESS_MAC, AX_RX_CTL, > 2, 2, &data->rxctl); > > It runs under netif_addr_lock only. There are two other writers of > AX_RX_CTL: > > ax88179a_mac_link_up() writes a READ_ONCE() snapshot synchronously, > under medium_status_mutex. > > ax88179a_reset() on the resume path does its own WRITE_ONCE() and a > synchronous write. > > These three writers don't share a lock. Can AX_RX_CTL end up holding an > older value than the cached data->rxctl? >
Will not change.