🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16901

Re: [PATCH net-next v21 10/13] ax88179_178a: Add ethtool get_drvinfo

#16901
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 02:07
85 lines
10973 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The new ax88179a_get_drvinfo()
  (drivers/net/usb/ax88179a_devices.c:247-249) prints…

--

ax88179_178a: Add ethtool get_drvinfo

This commit adds ax88179a_get_drvinfo() as the get_drvinfo ethtool
callback for AX88179A-based devices. It reports the firmware version
that was read from the device at bind time.

> diff --git a/drivers/net/usb/ax88179a_devices.c b/drivers/net/usb/ax88179a_devices.c
> index 01d6a35f68b2c..69095110e7043 100644
> --- a/drivers/net/usb/ax88179a_devices.c
> +++ b/drivers/net/usb/ax88179a_devices.c
> @@ -235,6 +235,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]
What does ethtool -i report here if one of the firmware version reads
failed at bind time?

ax88179a_bind() stores 0xff in any byte whose AX88179A_ACCESS_BL read
returns an error:

drivers/net/usb/ax88179a_devices.c:ax88179a_bind() {
    ...
	for (int i = 0; i < 3; i++) {
		ret = ax88179_read_cmd(dev, AX88179A_ACCESS_BL, AX88179A_SW_VERSION + i,
				       1, 1, &ax179_data->fw_version[i]);
		if (ret < 0)
			ax179_data->fw_version[i] = 0xff;
	}
	ret = ax88179_read_cmd(dev, AX88179A_ACCESS_BL, AX88179A_SW_REVISION,
			       1, 1, &ax179_data->fw_version[3]);
	if (ret < 0)
		ax179_data->fw_version[3] = 0xff;
    ...
}

The only check in ax88179a_get_drvinfo() is the chip_version one, and
chip_version was read successfully just before these reads. So if the BL
access stalls or hits a transient USB error, the ethtool fw_version field
would show something like "255.255.255.255" or "1.2.255.3". Userspace has
no way to tell that apart from a real firmware version.

This also overwrites the dev->driver_info->description string that
usbnet_get_drvinfo() has just written into info->fw_version.

The 0xff marker itself comes from the earlier commit "ax88179_178a: Add
HW support for AX179A-based chips". This patch is what exposes it
through the ethtool uAPI.

Could the driver record whether the reads succeeded, or skip the
snprintf() when any byte holds the 0xff marker, so that the usbnet
default is kept?

> +}
> +

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261114-ax88179a-v21-0-c2d34410bcbe%40birger-koblitz.de
Technical Details
Message-ID: <179479482548.3136.14472959825841932397@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363994-linux-kernel-netdev=dewy.ru
References: <20261114-ax88179a-v21-10-c2d34410bcbe@birger-koblitz.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363994-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v21 10/13] ax88179_178a: Add ethtool get_drvinfo
Date: Mon, 16 Nov 2026 02:07:05 +0000
Organization: Usenet Network
Message-ID: <179479482548.3136.14472959825841932397@kernel.org>
References: <20261114-ax88179a-v21-10-c2d34410bcbe@birger-koblitz.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1956425"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:eXr4ZeM3lwEdj9AAWy6TXQA+J3M= sha256:RltwGgG+oHjYI3/VmbkhBdujxr14kSVlC8Iac8TlmWA=
	sha1:SBMwVPKmR1NFRW37gmH/QXQeZAY= sha256:QDroUFyLQZFTAIheJC3PF87ugS251eOb0BNo/iQtmns=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 0D10C114AE0; Mon, 16 Nov 2026 05:08:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.3
X-Spam-Status: No, score=-2.3 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001,
	DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id nPWglpJrKSH7;
	Mon, 16 Nov 2026 05:07:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363994-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 4236E114AF1; Mon, 16 Nov 2026 05:07:51 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id D10A7335F8; Mon, 16 Nov 2026 02:07:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794794828;
	b=x2MxngPr1Diu2DzVSRRVw0PjTp4zrtQou6Q9kjHBbEmcaH4ZWSy983sn0F+y/xNx6pSi
	 b2jFkqvby9DSXnK/fG4UtetMCI0JHY7CVb2oiJF+tpV8QPSH/dDHAQfdHBAHJd885C29z
	 doYxKwv0vNAWlZpEumQtD6P6D0pMEbgDJnKTH9QmCwe5OvpbViCs9AGXoTzzHoXMDqDpo
	 PAOY2Q5e8a9TqI3LFP56C6yBqKFMAiI0FoEcKCDngiH/lnMJ+kFGwtsp/xxktGml71spY
	 MZD7VWfYMpkhjH9FyZRVhX/bsU2mxgNI5WljvuB8Y1TYBA5d4ZHwj1ruJ0n2bSOVRHQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794794828;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=+KuDMSse6mdV1eusHZ2I6xcvIQeQ6s4RtbvR4Zkb9iY=;
	b=bmAr3x87o+nSOfeFmCsoYGxqPxyqyKk1swIO5/ExIHzO+ATC5cjDS331uGJsY0qsYKmO
	 X8jINlDMdORHhROZoeFB9HrUhITL4LSUTXvhw5lnw4Tss87vA9qcwtOcd/JbR+GlZShOh
	 760SSJz9/aCwViPZ7MUVwDkYpm3eGM3fLvVgr/J6T6PJsWq/q6VlAWMiClLlqOhCr9f/b
	 UaOTpwdpwHHobmGmGLL8Hdo1vn6QjLNoBKmZd6vXC+FbLGNCYB25U0s45H+suTQm5i0xd
	 6QHCRo8OcEsgjCWfncBtp4njYIdq0p4NRStwmV5acEmcr0W3RHzt1IOQAeLQ7POyt9Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Ba/DRurA";
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id E600560A262B;
	Mon, 16 Nov 2026 02:07:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ba/DRurA
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794794827;
	b=kEXeqqjrMqYNHl3kllsgjP+YSPdJOdshL2L27JrxCVDZMXCk7utVfidQmZfrdPDnQJWL
	 M5nHoe08gKqWq+g4R5R48CbaXFcP7Qp15c1DYnYGq+4c8vwBLjDYgus/yB4uMo4IyXqY+
	 OZEZqr+95cfMLiNF3BnUugcv2JuSDKLOiV23MLgMqf7U4JuezRmVjVxGqlFS4jzr/ZDw9
	 FwazLTIUv4f6U4r9jJ9iPtmmoN/10IfJSLYik4h4saFLXyXbJ++QvdyAMnxdjlyqZKaKB
	 BcBCkr3HwQJPzEUmkWDzd60vPPONoG1xBAKODIud4gDamtQaX2ar/jDNTbRHlxOk+BA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794794827;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=+KuDMSse6mdV1eusHZ2I6xcvIQeQ6s4RtbvR4Zkb9iY=;
	b=0birXXZvr7F4H15Qm7kdBxv/krucrz8TDnp+BBoYC/YLPfi8jVORH5/Vv3kvVz6zY4ao
	 IOEpISFE5agC13HwnafSRgb2Z5kHNl4wWeISe+TYLz1eQt3df+qV/nvo4sPBOZR2/NN/B
	 8saJzt+wruN8HY0u6JvDS6wFFTRvpZ5iAoAAXYAHtodivv+eNesir8EBs0t2QGPsz1on3
	 WDHi81mbxxTDdOvro0bvJkIUdhd0lkoTf4hM2/oUQuddyg8/aszvyH+BdEertbfItl5Z5
	 QtpdH5F6AuqxLVOzoBzVwvd4HJUby7uQelYEo5kTTxsGxMeouUQYWd/sXzsaODMk3Hw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Ba/DRurA";
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F48560A261C;
	Mon, 16 Nov 2026 02:07:07 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E95501F000C8;
	Mon, 16 Nov 2026 02:07:05 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794794826;
	bh=+KuDMSse6mdV1eusHZ2I6xcvIQeQ6s4RtbvR4Zkb9iY=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Ba/DRurAhdWgEsRijZzK17c0rXdwJqWGQvqpslJaSbDLI37EQkiokct5ra3XwgkG8
	 g+VrdehDx4Ic9tsQv+Fw753Rh5Y17VTm2Qaklub2mBdwPuwn1zLKKXTKYXyr1MddT5
	 FFKi/ZKib2KTFyBUMExf8IouQkHL1XLTxVAJEcSLJgJ8Mr9n6SNWVPZ72iwfG2+hZi
	 oYOUyFAMuzP8KSpaIhUWpL2PErFeMtwqtRZEX/MZ/NmirxtKI8Mj+yzQUV7VnJdBvM
	 KQImnak81i4CEDslrYD4D12C0z7KW4swiFEst42zcsFJxJEPEbqlPnoxUd1LMAQIYI
	 uHJAc43VaoeJA==
X-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
X-In-Reply-To: <20261114-ax88179a-v21-10-c2d34410bcbe@birger-koblitz.de>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list