From: netdev-bot+sashiko@kernel.org
To: mail@birger-koblitz.de
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk,
andrew@lunn.ch, hkallweit1@gmail.com, linux-usb@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
neuromoments@gmail.com
Subject: Re: [PATCH net-next v12 12/15] ax88179_178a: Add ethtool get_drvinfo
Date: Thu, 17 Sep 2026 21:25:05 +0000 [thread overview]
Message-ID: <178968030501.22033.322532364708711574@kernel.org> (raw)
In-Reply-To: <20260916-ax88179a-v12-12-60c04c9924a2@birger-koblitz.de>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider:
Critical: 0 · High: 0 · Medium: 0 · Low: 2
- [Low] ax88179a_get_drvinfo()
(drivers/net/usb/ax88179a_devices.c:221-233) formats the ethtool…
- [Low] When a bootloader-window read fails in ax88179a_bind()
(ax88179_read_cmd() < 0 at…
--
ax88179_178a: Add ethtool get_drvinfo
This adds ax88179a_get_drvinfo() and wires it into ax88179a_ethtool_ops so
that ethtool -i reports the cached firmware version bytes for AX88179A and
newer chips. It calls usbnet_get_drvinfo() first and then overwrites
info->fw_version with the four cached bytes.
> diff --git a/drivers/net/usb/ax88179a_devices.c b/drivers/net/usb/ax88179a_devices.c
> index ff41d20c219d4..6225b88681e62 100644
> --- a/drivers/net/usb/ax88179a_devices.c
> +++ b/drivers/net/usb/ax88179a_devices.c
> @@ -218,6 +218,20 @@ static int ax88179a_resume(struct usb_interface *intf)
> return usbnet_resume(intf);
> }
>
> +static void ax88179a_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
> +{
> + struct ax88179_data *priv = netdev2data(net);
> +
> + /* Inherit standard device info */
> + usbnet_get_drvinfo(net, info);
> + if (priv->chip_version < AX_VERSION_AX88179A)
> + return;
> +
> + snprintf(info->fw_version, sizeof(info->fw_version), "%d.%d.%d.%d",
> + priv->fw_version[0], priv->fw_version[1],
> + priv->fw_version[2], priv->fw_version[3]);
> +}
[Severity: Low]
Is the fourth component here ever read from the device?
The only writer of fw_version[] is the loop in ax88179a_bind():
for (int i = 0; i < 3; i++) {
ret = ax88179_read_cmd(dev, AX88179A_ACCESS_BL, (0xFD + i),
1, 1, &ax179_data->fw_version[i]);
if (ret < 0)
ax179_data->fw_version[i] = 0xff;
}
That fills fw_version[0..2] only, and the container comes from
kzalloc_obj(*ax179_data), so fw_version[3] is always 0.
Grepping fw_version[ over drivers/net/usb/ finds no other assignment, so
the last component of the string exported through ETHTOOL_GDRVINFO is a
constant 0 rather than something read from the chip.
Should the loop read a fourth bootloader register, or should the format
string print three components? The declaration in
drivers/net/usb/ax88179_lib.h:
u8 fw_version[4];
the read loop, and this new format string currently disagree about how
many bytes the firmware version has, and this patch is what turns that
disagreement into a user-visible string. The same mismatch is still
present at the end of the series (cfe9f4be1c4a5ee15cf890112026b94028566314).
[Severity: Low]
What does userspace see when the bootloader-window reads fail?
In ax88179a_bind(), a failed ax88179_read_cmd() stores a sentinel and the
error is not propagated, so bind continues:
if (ret < 0)
ax179_data->fw_version[i] = 0xff;
With this change, ethtool -i then reports "255.255.255.0" as if the chip
had answered the vendor request. Before this patch the sentinel only
appeared in the netdev_info() line at bind time, where the surrounding log
gave context.
Would it be preferable to leave info->fw_version as set by
usbnet_get_drvinfo() when the reads failed, or to track a "version unknown"
state, rather than formatting the sentinel bytes? This is unchanged at the
end of the series (cfe9f4be1c4a5ee15cf890112026b94028566314).
> +
> static void ax88179a_bulkin_config(struct usbnet *dev, u8 link_sts, u8 speed, bool full_duplex)
> {
> struct ax88179_data *ax179_data = dev->driver_priv;
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260916-ax88179a-v12-0-60c04c9924a2%40birger-koblitz.de
next prev parent reply other threads:[~2026-09-17 21:25 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 3:23 [PATCH net-next v12 00/15] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-09-16 3:24 ` [PATCH net-next v12 01/15] phylink: Add phylink_mac_interrupt Birger Koblitz
2026-09-17 21:24 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 02/15] phylib: Add support for PHYs with broken forced mode Birger Koblitz
2026-09-17 21:24 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 03/15] ax88179_178a: Fix endianness of pause watermark register Birger Koblitz
2026-09-17 21:24 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 04/15] ax88179_178a: Split driver into library and device specific code Birger Koblitz
2026-09-17 21:24 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 05/15] ax88179_178a: Add netdev2data() convenience function Birger Koblitz
2026-09-17 21:24 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 06/15] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-09-17 21:24 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 07/15] ax88179_178a: Add EEE configuration support for AX88179A MACs Birger Koblitz
2026-09-17 21:24 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 08/15] ax88179_178a: Add EEE configuration support for AX88179A PHYs Birger Koblitz
2026-09-17 21:24 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 09/15] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-09-17 21:25 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 10/15] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-09-17 21:25 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 11/15] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279 Birger Koblitz
2026-09-17 21:25 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 12/15] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-09-17 21:25 ` netdev-bot+sashiko [this message]
2026-09-16 3:24 ` [PATCH net-next v12 13/15] ax88179_178a: Update driver name and information Birger Koblitz
2026-09-17 21:25 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 14/15] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-09-17 21:25 ` netdev-bot+sashiko
2026-09-16 3:24 ` [PATCH net-next v12 15/15] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-09-17 21:25 ` 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=178968030501.22033.322532364708711574@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--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®