Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Birger Koblitz" <mail@birger-koblitz.de>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH net-next v2 1/2] net: usb: ax88179: Make receiving FCS on AX88179A configurable
Date: Mon, 30 Nov 2026 07:41:17 +0000	[thread overview]
Message-ID: <sashiko-outbox-240608@kernel.org> (raw)
In-Reply-To: <20261129-fcs-v2-1-f60d6b105a15@birger-koblitz.de>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] net: usb: ax88179: uninitialized data->rxctl in
  ax88179_set_multicast()
--

commit e000200e67ab77b29e1c0198583dac095b6053c5
Author: Birger Koblitz <mail@birger-koblitz.de>

net: usb: ax88179: Make receiving FCS on AX88179A configurable

This commit updates ax88179_set_multicast() to start from data->rxctl and
only set AX_RX_CTL_DROPCRCERR on AX88179A when NETIF_F_RXFCS or
NETIF_F_RXALL is enabled.

> 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 starting from data->rxctl break packet reception on AX88179 and
AX88178A devices by leaving AX_RX_CTL_START and AX_RX_CTL_AB cleared?

Unlike ax88179a_reset(), ax88179_reset() writes AX_RX_CTL from a local
tmp16 buffer without storing the initial value in ax179_data->rxctl:

drivers/net/usb/ax88179_178a.c:ax88179_reset() {
    ...
	/* Configure RX control register => start operation */
	*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);
    ...
}

When the interface is brought up or RX mode is updated on AX88179 or
AX88178A, data->rxctl is still 0, so ax88179_set_multicast() (and later
ax88179_link_reset()) programs AX_RX_CTL without AX_RX_CTL_START or
AX_RX_CTL_AB, disabling the MAC receiver and broadcast reception.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129-fcs-v2-0-f60d6b105a15@birger-koblitz.de?part=1

  reply	other threads:[~2026-11-30  7:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  7:40 [PATCH net-next v2 0/2] net: usb: ax88179: Support NETIF_F_RXFCS and NETIF_F_RXALL on AX88179A Birger Koblitz
2026-11-29  7:40 ` [PATCH net-next v2 1/2] net: usb: ax88179: Make receiving FCS on AX88179A configurable Birger Koblitz
2026-11-30  7:41   ` sashiko-bot [this message]
2026-11-30  8:35   ` netdev-bot+sashiko
2026-11-29  7:40 ` [PATCH net-next v2 2/2] net: usb: ax88179: Support NETIF_F_RXFCS and NETIF_F_RXALL on AX88179A Birger Koblitz
2026-11-30  7:41   ` sashiko-bot
2026-11-30  8:35   ` 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=sashiko-outbox-240608@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mail@birger-koblitz.de \
    --cc=sashiko-reviews@lists.linux.dev \
    /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