Article View: linux.kernel.netdev
Article #23328Re: [PATCH net-next v9 10/12] r8152: split r8157_hw_phy_cfg into RTL8157 and RTL8159 variants
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 04:27
Date: Fri, 27 Nov 2026 04:27
105 lines
11817 bytes
11817 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] r8159_hw_phy_cfg() (drivers/net/usb/r8152.c) adds two RTL8159
(VER_17_QFN68/QFN100) PHY register writes that neither the code nor…
- [Low] The commit message says that clearing PLA 0xd3c8 BIT(0) ("Disable
bypass_turn_off_clk_in_aldps") "is needed by both chips" and now also…
--
r8152: split r8157_hw_phy_cfg into RTL8157 and RTL8159 variants
This patch splits r8157_hw_phy_cfg() into an RTL8157-only function and a
new r8159_hw_phy_cfg() for RTL8159 (VER_17_QFN68/QFN100). It also changes
the RTL8159 EEE, 10M clock divider, 0xa5ea and 0x8ffe programming, and
moves the 0xd3c8 bypass_turn_off_clk_in_aldps clear into the shared
prologue so RTL8157 runs it too. Several new RTL8159 PHY tuning parameters
are added as well.
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index dbbaf06dca20b..2f3d97e2400c3 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
[ ... ]
> @@ -8231,11 +8242,14 @@ static void r8157_hw_phy_cfg(struct r8152 *tp)
[ ... ]
> /* Disable ALDPS force mode */
> ocp_reg_clr_bits(tp, 0xa44a, BIT(2));
>
> + /* Disable bypass_turn_off_clk_in_aldps */
> + ocp_byte_clr_bits(tp, MCU_TYPE_PLA, 0xd3c8, BIT(0));
> +
[Severity: Low]
This isn't a bug, but should this patch carry Fixes: tags?
The commit message says the 0xd3c8 BIT(0) clear "is needed by both
chips". Until now r8157_hw_phy_cfg() has not run it for RTL8157, and the
RTL8157 support came in with fd3c7d080df5 ("r8152: Add support for the
RTL8157 hardware").
In the same way, the RTL8159 EN_10M_CLKDIV, 0xa5ea and 0x8ffe changes in
r8159_hw_phy_cfg() correct programming added by ad2a55b63b41 ("r8152: Add
support for the RTL8159 chip"):
ocp_reg_clr_bits(tp, OCP_DOWN_SPEED,
EN_EEE_100 | EN_EEE_1000 | EN_10M_CLKDIV);
tp->ups_info._10m_ckdiv = false;
Other "per the datasheet" corrections in this series that target the same
two commits do carry Fixes: tags. Examples are "r8152: add
rtl8157_unload() for RTL8157 and RTL8159", "r8152: add
rtl8157_change_mtu() for RTL8157 and RTL8159" and "r8152: fix
RTL8156/RTL8156B/RTL8157/RTL8159 up and down settings".
This patch has no tag and doesn't describe a user-visible symptom. That
makes it hard for stable and distro backporters to tell whether the old
programming caused real problems or whether this is only a datasheet
alignment. Could the commit message say which one it is?
[ ... ]
> @@ -8372,22 +8459,35 @@ static void r8157_hw_phy_cfg(struct r8152 *tp)
[ ... ]
> + sram2_clr_bits(tp, 0x83ef, 0x0e00);
> +
> + ocp_reg_w0w1(tp, 0xbf38, 0x01f0, 0x0160);
> + ocp_reg_w0w1(tp, 0xbf3a, 0x001f, 0x0014);
> + /* shorten CLKS latency */
> + ocp_reg_clr_bits(tp, 0xbf28, BIT(14) | BIT(13));
> + ocp_reg_clr_bits(tp, 0xbf2c, BIT(15) | BIT(14));
> + /* CMP_Timer on MP_Timer=333
> + * GPHY OCP 0xbf28 bit[0] = 0x1
> + * GPHY OCP 0xbf28 bit[6:1] = 0x3
> + * GPHY OCP 0xbf28 bit[12:7] = 0x3
> + */
> + ocp_reg_w0w1(tp, 0xbf28, 0x1fff, 0x0187);
> + ocp_reg_w0w1(tp, 0xbf2a, 0x3f, 0x03);
[Severity: Low]
This isn't a bug, but what do the 0xbf38 and 0xbf3a writes in
r8159_hw_phy_cfg() configure?
They have no comment. None of the new RTL8159 tuning parameters listed in
the commit message (shorten CLKS latency, CMP_Timer on MP_Timer=333,
spdchg_pga1_lpf_cap, ENET PLL jitter improvement) seem to cover them.
The CMP_Timer comment also describes only the 0xbf28 bit fields. Nothing
explains the 0xbf2a write that follows it.
Could these writes get a short comment, and a mention in the commit
message, so each one can be traced to the datasheet item it implements?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126033211.51850-1-nic_swsd%40realtek.com
Technical Details
Message-ID:
<179575362520.3135.17351544520034128631@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-372451-linux-kernel-netdev=dewy.ruReferences:
<20261126033211.51850-11-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-372451-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v9 10/12] r8152: split r8157_hw_phy_cfg into RTL8157 and RTL8159 variants Date: Fri, 27 Nov 2026 04:27:05 +0000 Organization: Usenet Network Message-ID: <179575362520.3135.17351544520034128631@kernel.org> References: <20261126033211.51850-11-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="637197"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:T+VRsweqL/4z+7A7VnAaKvtrdhY= sha256:SpMMX6agjbo8ZOwGbwOvz52a5WPIPUYjG++JiKLZZco= sha1:xO/1DD+/QyeVT6fm1xUFdG1el48= sha256:br5S5c3sobvuZUMegaQNENNXHljAUs+6/RmJ+jgoxy8= 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 2BA2D125F0D; Fri, 27 Nov 2026 07:27:26 +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 zeGCGIMkyGiO; 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-372451-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 578E2125F0E; Fri, 27 Nov 2026 07:27:12 +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 5334A3194E; Fri, 27 Nov 2026 04:27:09 +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=1795753627; b=uddVzoH9frIFCPOjZV8LRLX+22qxRdEt/ll2vdAhGaSLeeAG4prUw6/OqnL2sBA5jWcN psVEtiXPevCdma5LZljmC0CjTphQE8dlcpM/QqejRd/L7vO5j0WesX0KsZYX2MD1V9caE 7ekcbfkWgwKP0yGmqJwx2xrH4hP2t5G9zLB7kqd+AdIDqc/x7FOfLebI5at/u+b5E0hWH qP06cNuEHMIismN/fqm+UFsmckCyR9vHfwa88MbPDnfw1nSEWqZpJsiJgnoljc68rj4Gr kWfRkpTUq7TSOWc8oImQXCvYDW9o6lVI1/h69u7ZzL0rB6DzUFo8UKU+UGhSZh+jRiA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795753627; 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=AnVF3aqWclhab2tDyVjUIAz+dvlD7Ph4asBpLs76sgM=; b=twOVRLjt98O+9SR9KcR+D70l9oP3clnX2v4cNUaJVz63a2Ityod4brMNey7Ay9AgQUsC O8l4TZ9NWZMYC4MihbJ1wMPRHyyQ4YnjKO7viJCJiN4PV402NOqAltb4BL1Dia6/DTpcL jMHp2YK6c1tPF6xuabpfqFZokfmcDdmbrZEFfCrQhzvCDxFoiHOa51o6jPlJMA6d1bZ4a 61v/FxW0gUZG8u19m3Z3OqsmOFRsN4LS87kcan+vx9heQLAXrL+vMpgXjNmnV4zaLSm3H TUo8esnz9lVbM8dJuDWwkfQqN/nz1YnkrKd3AUnunv1IZiIFaPHZMwUQZpmo9LKzMPw== 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=al1QV3xI; 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 938A5606A680; Fri, 27 Nov 2026 04:27: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=al1QV3xI 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=1795753626; b=gbxtMC0sGYgmKLNOFv8JjmEzrpwd6hjW0FQ3/mhvah488KnKIOthOideQi+0sBd83QmN T4hvpmWJEDbQXUxz7PYVnVv/+/gXglufx3lnI/yp7/VPKInDxCfenJhXrNnze3nDTC0Cu jiUMrGmcGWaacQ+f9oR6lB+ciNvee697CRYTKApddtiICreHUOFDXxviFkYd6TbEjr3l4 V6KdIrYI8o5p5Bw4y/tGXfNd61ZwJvn0nH5joJKh2CztF7Ugeae9nT0GROOApRlOxtnTa wu2ItZlUejm6legV0S+vSYNgXZKvOpoL0DTaD1HaZ1QQxE3TunSCKSDEzq5/pDsoDug== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795753626; 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=AnVF3aqWclhab2tDyVjUIAz+dvlD7Ph4asBpLs76sgM=; b=QENIoKmPEJnoEqsM5MCGHR6XsDp3dldxJRHWnRCExv+RigN7gm4MKDNgfPQUQFi6g20K wGmUs5gZgd0L/pOBdLXg5Dv6tnW1ryih4InW2LKuiPBfUlHZPAsZUmAE6Yfqw7dfMCuPL H97DAJ2zhJ2i3myXlSHGnqOZ9MfOWJhwpzs4jpDRzzituD9cJfvZ29juPYqnVOKSNv50J alppnaQ62RWJK8elfZS8/U77QWXKh8nUBkPiGzQ03xxZq9O763TobvajDBm3Opfwt6MQs VT8cAoOQlnrtoHH5DiZ9RYka2f0DhONwmAi+Zx2k6O8yPqCmKgoPoHA2Hp8o0noG51Q== 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=al1QV3xI; 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 B56B2606A330; Fri, 27 Nov 2026 04:27:06 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FDC41F000C1; Fri, 27 Nov 2026 04:27:05 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795753626; bh=AnVF3aqWclhab2tDyVjUIAz+dvlD7Ph4asBpLs76sgM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=al1QV3xIkZ5dqOk1kE1P/ZADOJMFYJz3uJFz6XluEcSo0GwKqC01NMupmEwP6etna F5hn515ycJSojfAw5IbCK0K/vX+8S8cEYzLlOm001l+6CbmCiXAWiresaFGi34lOsZ /Q+Lc4dhoWDO+5W4lByJPSCHtjVRQCRj7NwtWXLeG3/d3DVmLOmK+WQI/KCiMR3Ah7 WSYWQrFj+R3c7CNSRt/Fni7EWr61g6BT2ddiVCIrDoWpGPUdSDSDtJL65p+aU0S4EG lVcizVZm+Xw+TInsiIJiZfhOC65BMhqtlEBY/N2063d4p2XJ1gG276RzO5O/l4aHws 7qNeuUUjVQ/6w== 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-11-nic_swsd@realtek.com> 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