Article View: linux.kernel.netdev
Article #23327Re: [PATCH net-next v9 08/12] r8152: split RTL_VER_17 into QFN68 and QFN100 package variants
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 04:27
Date: Fri, 27 Nov 2026 04:27
153 lines
12970 bytes
12970 bytes
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] Before this patch, chip ID 0x2020 always mapped to RTL_VER_17
and r8152 drove it.
- [Low] The commit message says QFN100 "uses a different firmware image
from QFN68" and gives "guessing a package could load the wrong…
--
r8152: split RTL_VER_17 into QFN68 and QFN100 package variants
This patch splits RTL_VER_17 into RTL_VER_17_QFN68 and RTL_VER_17_QFN100.
The package is detected by reading the new PLA_PKG_DET register from
__rtl_get_hw_ver(). QFN100 parts now load rtl_nic/rtl8159-2.fw instead of
rtl8159-1.fw, and r8157_init() gains a QFN68-only u2phy backup restore
write.
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 3e16d0f832bc3..151acb0f58da6 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
[ ... ]
> @@ -10223,9 +10253,12 @@ static int rtl_fw_init(struct r8152 *tp)
> case RTL_VER_16:
> rtl_fw->fw_name = FIRMWARE_8157_1;
> break;
> - case RTL_VER_17:
> + case RTL_VER_17_QFN68:
> rtl_fw->fw_name = FIRMWARE_8159_1;
> break;
> + case RTL_VER_17_QFN100:
> + rtl_fw->fw_name = FIRMWARE_8159_2;
> + break;
> default:
> break;
> }
[Severity: Low]
The commit message says:
QFN100 uses a different firmware image from QFN68, so rtl_fw_init()
selects rtl8159-2.fw for it and keeps rtl8159-1.fw for QFN68.
It also explains rejecting unknown packages with "guessing a package could
load the wrong firmware".
Before this patch, every 0x2020 chip got rtl_nic/rtl8159-1.fw, QFN100 parts
included. If that image was wrong for QFN100, is this a fix to the original
RTL8159 support? Other fixes in this series carry a tag like:
Fixes: ad2a55b63b41 ("r8152: Add support for the RTL8159 chip")
Should this patch carry one too?
Is rtl_nic/rtl8159-2.fw already in linux-firmware?
rtl8152_request_firmware() does not fail when the file is missing:
result:
if (rc) {
rtl_fw->fw = ERR_PTR(rc);
dev_warn(&tp->intf->dev,
"unable to load firmware patch %s (%ld)\n",
rtl_fw->fw_name, rc);
}
If the new file is not published yet, QFN100 users would go from loading
rtl8159-1.fw to running with no firmware patch at all. Only a warning would
show the change.
Could the commit message say whether this is a fix or a feature, and where
the new firmware can be found?
[ ... ]
> @@ -10318,7 +10382,20 @@ static u8 __rtl_get_hw_ver(struct usb_device *udev)
> version = RTL_VER_16;
> break;
> case 0x2020:
> - version = RTL_VER_17;
> + ret = __rtl_get_pkg_det(udev, &pkg_det);
> + if (ret < 0) {
> + version = RTL_VER_UNKNOWN;
> + dev_err(&udev->dev, "Failed to read package: %d\n",
> + ret);
> + } else if (pkg_det == 0x1e || pkg_det == 0x1c) {
> + version = RTL_VER_17_QFN68;
> + } else if (pkg_det == 0x18 || pkg_det == 0x1a) {
> + version = RTL_VER_17_QFN100;
> + } else {
> + version = RTL_VER_UNKNOWN;
> + dev_info(&udev->dev, "Unknown package 0x%04x\n",
> + pkg_det);
> + }
> break;
> default:
> version = RTL_VER_UNKNOWN;
[Severity: Medium]
Before this patch, chip ID 0x2020 always mapped to RTL_VER_17. Now it maps
to RTL_VER_UNKNOWN in two cases:
- __rtl_get_pkg_det() fails (three failed control reads, a short read,
or -ENOMEM).
- The masked value is not 0x1e, 0x1c, 0x18 or 0x1a. That covers 12 of
the 16 values PKG_MASK allows.
The commit message calls this a fallback. Do the callers treat it as one?
Both of them reject the device:
rtl8152_cfgselector_choose_configuration()
if (__rtl_get_hw_ver(udev) == RTL_VER_UNKNOWN)
return -ENODEV;
rtl8152_probe()
version = rtl8152_get_version(intf);
if (version == RTL_VER_UNKNOWN)
return -ENODEV;
In those cases a previously supported RTL8159 is never switched to vendor
mode, and r8152 never drives it. The unknown-package case is logged only
at dev_info. Should the commit message say that a chip which used to bind
to r8152 can now stop binding?
The stated reason is to avoid loading the wrong firmware. Is refusing the
whole device needed for that? rtl8152_request_firmware() already skips
loading when no firmware name is set:
if (rtl_fw->fw || !rtl_fw->fw_name) {
dev_info(&tp->intf->dev, "skip request firmware\n");
Also, each caller reads PLA_PKG_DET again on its own: the cfgselector,
rtl8152_probe(), and r8153_ecm_probe() through rtl8152_get_version(). If
one read fails transiently, the callers can get different answers. Could
the cfgselector then switch the device to vendor mode, only for
rtl8152_probe() to reject it?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126033211.51850-1-nic_swsd%40realtek.com
Technical Details
Message-ID:
<179575362324.3135.9669497990549921570@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.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-372450-linux-kernel-netdev=dewy.ruReferences:
<20261126033211.51850-9-nic_swsd@realtek.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.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-372450-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v9 08/12] r8152: split RTL_VER_17 into QFN68 and QFN100 package variants Date: Fri, 27 Nov 2026 04:27:03 +0000 Organization: Usenet Network Message-ID: <179575362324.3135.9669497990549921570@kernel.org> References: <20261126033211.51850-9-nic_swsd@realtek.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="637148"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:hc4TV/lltVfX/lvpprXDwTP+mAs= sha256:tXNM4O33WCJ+sRB0EggLS/JvqCX4c8sDnfmTJoLiB5o= sha1:iThuzUieyK8Gvt7eligG0ub+lIY= sha256:XBFmRKrQiEAEavfZGCqsqvQmsWBzPf49bAloAaaGOKQ= 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 60B4C125F11; Fri, 27 Nov 2026 07:27:25 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[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] 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 RDSwIAKIAzcj; Fri, 27 Nov 2026 07:27:21 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372450-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id E6747125F0D; Fri, 27 Nov 2026 07:27:11 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 7E70831904; Fri, 27 Nov 2026 04:27:06 +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=1795753625; b=Pi4sxJP9eaXC3U0k/J814/I3ZE5/Ix9gCY47xU+4SS7VYCYsiXG7gvxBYaRfxEYdIO8L 1xaUMiR6jthcvb75aAttvIUFeCkwe4AEj+cwug0hNrW1qxBj05dCM2nH7u3NU8SeD3MnB DEoNRuyA1khh/YDPlu+k9AtBD4fJjJvz/RZCdaA4z3kybW5CWhpLpOFe5MJOh/HMk9t8G SKv7VyQ+5OkpwROD0LIrHsq87d+wc9iYUArnzHse5lsuvmQNn/PB5xfru5ipag1s1c9Js 89kFf3zMicF0XsgniowX03KVQ/JghaMYoo4gQcoXt5sWG00kV8hJP0BcQtytpmp7vgQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795753625; 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=aM7yTZa2mR1XHJV/CGPWguWQsTg/lG+DKYjci4/Vjco=; b=F9kbIcRs+9EBa24MjG7wTiyHHFLPAFjdrvJkH8qtZsX7tkeRziJRV9qGLjaagimw2+58 lwx1HB0b2d4FWY2Xm3CiotrgyZGCEqQ/iP6YdVcFzsl8CaurxKPUA8Hzfs3OtC6bU0rLa Xr3F2jtpdGRek2OPPLP8+MKfxmIUofaZaruKFsfwBwyy00aBjQZ3PDZNuDZcRsw4tXcHL 9vQ+UzxRDQ8OPhl5LiysRwdxWxJQ/EoGhWdWWkGBLkxyYUBffM+f66D5Fd03mMSCJOxAZ 487qyA4mmgS2bxMER7UtZQhAOtwA/d2YH5B4xBtvkZb8ftNqKC5DT9f9Szch7pDVkaQ== 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=ltmiJSkh; 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 B9D92606A339; Fri, 27 Nov 2026 04:27:05 +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=ltmiJSkh 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=1795753624; b=2cQdBUq8noCSPhzry85lkgdG09UBWuCeBk4zIVHEPwZh3mYS0qDTqIEF61/TIYtjWrN+ PWJTUreMLtgimCOxeyuTJuHBAo87unXyHC9y9S1PLGp5vKgio2k5zY66IZ4/NmDdLes9G qecAy6GQCsLKkhfW0ZKEwDSTb1Mt6MTitnyAjrkaP8RcsiO+MQNCItbXFFMats6SpPszv r9VEA65/I87yJj9dNZZl5yQCxGrKdEnIDxTKQ7K7YmgtzI7voa9iOP2pHL0FZBkhNP7LG 0pVPAWlcwRnfqrcBGvg/hccbu99MbitMnWHJQxOaHBLP3OyZDCLRrTE5kDE0HDKMvVg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795753624; 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=aM7yTZa2mR1XHJV/CGPWguWQsTg/lG+DKYjci4/Vjco=; b=I/sjGlU45+p2nDUmH/HFO8ydQY3e/p8bXeiSUQQfICTH5S9v07hj8hXfB7rvdMyziZCX xT/l938bOHigEsxedWU/8tVsR0fK6QSJZYZ5FgPIZ0kI9SxavLNOQav7gc+lAi/swDKkZ sc00HMVgfIXBscvFEZzzVMvbTvz0gzIzPckgq5RL04qtJFCx5VgK+96acUZwzQGyjdPI0 FvWSs+RYbtf8TxJDOpOSTNw0evDfayXxbvraCzQ8VJ4f60CX6bt0Vcd24eoeT/vg+oQc6 DvaH3XlWL3rvCBIYvhthwVCiR7yKRldioj1Iqad0h7i13VGTSSyCHLAQyAVHeuDOjhQ== 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=ltmiJSkh; 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 DBF40606A334; Fri, 27 Nov 2026 04:27:04 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAFF71F00925; Fri, 27 Nov 2026 04:27:03 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795753624; bh=aM7yTZa2mR1XHJV/CGPWguWQsTg/lG+DKYjci4/Vjco=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ltmiJSkh1N/uSfnZVvELdlJk/ydOiVgbfRj3Eoj1QaWgckvIYEkdBou9vIWND0Dmr SiPlXJz7zpLRat6TX998z1l+ZvBx48js64VjWheF7yB+mOIWTxildmmFxYe8YLLlFQ uOB8ZnhjMmGWfTQNZTAJ/YDNrnbE3p3P9n9qlWqF0OsRBgDdNcQD9axZoOEpwhhcdX kWpZIDSOwfNA28+s31kFLCVXlzjstKDklfhWCdPQnRKNosc+9kPbxNy9ScR2aqm8ja PHN/B2zzHX4WYmAsQqqhMZE2p6OpAJYj6DvFdqykvWl6/WkqrTEt6PZJbBl0CZLSsu YkxJr+5FG6/Tw== X-Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, nic_swsd@realtek.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, edumazet@google.com, bjorn@mork.no, pabeni@redhat.com, andrew+netdev@lunn.ch, mail@birger-koblitz.de X-In-Reply-To: <20261126033211.51850-9-nic_swsd@realtek.com> X-sashiko-severity: Medium 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