Article View: linux.kernel.netdev
Article #25013Re: [PATCH net-next v10 10/12] r8152: split r8157_hw_phy_cfg into RTL8157 and RTL8159 variants
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:46
Date: Tue, 01 Dec 2026 06:46
84 lines
11015 bytes
11015 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,
RTL_VER_17_QFN68/QFN100 case) adds two PHY register writes that haveโฆ
--
r8152: split r8157_hw_phy_cfg into RTL8157 and RTL8159 variants
This commit splits r8157_hw_phy_cfg() into r8157_hw_phy_cfg() for
RTL_VER_16 and a new r8159_hw_phy_cfg() for RTL_VER_17_QFN68/QFN100.
Each function gets its own copy of the shared prologue and epilogue. It
also changes the EEE handling for RTL8159, adds new RTL8159 PHY tuning
parameters, and adds sram2_set_bits()/sram2_clr_bits() helpers.
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index a16e7d0257f2a..392b7015f4925 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
[ ... ]
> @@ -8372,22 +8459,35 @@ static void r8157_hw_phy_cfg(struct r8152 *tp)
> sram_write_w0w1(tp, 0x81ae, 0xff00, 0x0f00);
> sram_write_w0w1(tp, 0x81b9, 0xff00, 0xb900);
> /* normal link TX filter */
> - sram2_write_w0w1(tp, 0x83b0, 0x0e00, 0);
> - sram2_write_w0w1(tp, 0x83c5, 0x0e00, 0);
> - sram2_write_w0w1(tp, 0x83da, 0x0e00, 0);
> - sram2_write_w0w1(tp, 0x83ef, 0x0e00, 0);
> + sram2_clr_bits(tp, 0x83b0, 0x0e00);
> + sram2_clr_bits(tp, 0x83c5, 0x0e00);
> + sram2_clr_bits(tp, 0x83da, 0x0e00);
> + sram2_clr_bits(tp, 0x83ef, 0x0e00);
> +
> + ocp_reg_w0w1(tp, 0xbf38, 0x01f0, 0x0160);
> + ocp_reg_w0w1(tp, 0xbf3a, 0x001f, 0x0014);
[Severity: Low]
What are these two writes to 0xbf38 and 0xbf3a in r8159_hw_phy_cfg()
for? They have no comment, and the driver doesn't touch either register
before this patch, so this isn't code moved from somewhere else.
The commit message lists the new RTL8159 parameters as:
Newly added PHY tuning parameters for RTL8159:
- shorten CLKS latency
- CMP_Timer on MP_Timer=333
- spdchg_pga1_lpf_cap
- ENET PLL jitter improvement
Neither write fits any item on that list. Because they follow the
"normal link TX filter" sram2 block with no comment of their own, it is
hard to tell which feature they belong to.
Could a comment be added here, and could the commit message mention
them?
> + /* 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]
A related question about the 0xbf2a write: the "CMP_Timer on
MP_Timer=333" comment above it only describes the bitfields of 0xbf28.
Is the 0xbf2a write part of the CMP_Timer setting, or something else?
If it is part of it, could the comment also describe 0xbf2a bit[5:0]?
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130063123.2408-1-nic_swsd%40realtek.com
Technical Details
Message-ID:
<179610756830.3146.6173554703500982932@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-374752-linux-kernel-netdev=dewy.ruReferences:
<20261130063123.2408-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-374752-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v10 10/12] r8152: split r8157_hw_phy_cfg into RTL8157 and RTL8159 variants Date: Tue, 01 Dec 2026 06:46:08 +0000 Organization: Usenet Network Message-ID: <179610756830.3146.6173554703500982932@kernel.org> References: <20261130063123.2408-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="1639532"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:bllKDm1nxoQDIvRkxqby9Sl3L4s= sha256:Atg5Pv6Xv1VmYmrkjUdHJ7Q19PXbQlxEJe3RL93FkWM= sha1:ePfdOdCOk7bkKZMM+gw6vSOuhiM= sha256:cSyv5HFwdGWyoEMorzEePwlGb7EtS7SwRnoAfbQW24g= 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 49790117275; Tue, 1 Dec 2026 09:46:56 +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 1eKrnD-llhVM; Tue, 1 Dec 2026 09:46:53 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374752-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 AE287117265; Tue, 1 Dec 2026 09:46:44 +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 17B7F2DD76; Tue, 1 Dec 2026 06:46:22 +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=1796107570; b=Hf7GtkMqUI1N4MPxVOImf1zvtGwkV0scTbutH2IJbhKwFfTPXym1umT9nuwt52YkI1qr 9Muw+Mmjue3WmmHxkfKXxRKYMw2dt2p0OKPyWOu7ZYdKy+tmnS71mbIwv6FGiJNvMIqOr 4dQYsAZUIZC3JCVR9qzNgMBDw/qQA3D6MO/L7AM5+kht+omIcKfJ8WScgUJ4HX9H8mQTq 6ePGxMWytnbMiLGBBc674W6xwPvha94s9cUq3fyyL1sfduFwTaJYISs8A/M/aSLASBZUZ V8aproWRhloN1IiE26yA1dm91r/os1CQk4NF2swOMry3GGkzUaFelI5naZDdcsBOPnw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107570; 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=gqIEafF3ahem4e5D/4YwnUIRhD0srHFUqqQBZ4oqn0I=; b=10DmBTPTklLVYe4bPV+nJQpc847BlNnzDpvNkMtOh4ZHbJAejQiRnvC/XHIutEVAx5XJ rLGKzcw4QBCYiUIO1v2pWKP+o5yE5vcU8PB7jPD+kiIazi8hHsDEPhCQOC//zVLSlZb/9 6aTdT96J+FFkELKf2B1iuK+qACGOSLmMnSTECshsLSftKKe9v4VLVEGTeyO+l1HuZHijV Q1WNR2TYstmD+QL95ucVgb6sMcgZhJRD3eEOJJ2G+j3Ru+oIQ+cxypkJ6sbQ75qivWVzn Dt2wPFozlJ7RM5lweaG2F3q5lBE/t4PmGvK3sK9o0a2w46/BqVIZx0efEHDFE6vPKpQ== 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="GrZWZW/g"; 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 93B8B606A68A; Tue, 1 Dec 2026 06:46:10 +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=GrZWZW/g 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=1796107569; b=c3VS+lwPiQCqMZXrhIHbKZgXiUufkTgthe5etNefME32/bTlBy7Xv86dwST7Cd1ehu6T NrhpZh1daMdx9pFT8raXPD7hBYJeC5EyxhHR4e7/Amx29KuCOJNXR0x2ybgbe0BUumpdE E3J9q4SODiAnB/dTET3kpHmGJAxaVu6UetN+fJDAJVoHH//F0Ug8HZQ/+phjB7yaVRPm5 5JVKpx6JD7ifDw/0SlIGpYA9KbfAiZBthP6jHWo0eygK8f4zuJijwV2lvX6wsNnygfFXj VtJnwQrBVxJRUobbKs2ubmLqgL+Wclrc/X75n7txM2JH61lEyXEQcs+evI8SsoGFF8Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107569; 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=gqIEafF3ahem4e5D/4YwnUIRhD0srHFUqqQBZ4oqn0I=; b=pRq3FH7J6MeUxPr27L2GFAubd6bo38aTP+jCzf31UCgG+/NrEW7JPPq5vkOQSEvsLKjI F8jCLLTJes6Cj6N4WzjJ6TXWuOqJxUUXqqaT29xv7+Ufu8vmKL8LMBvie/L8sME7FvKDC 59pXALCBpO+C6/NMZoafLv3+K06XkibWPkh4l8I6m8/j8Lsjt9V1en2weOzKGJ1odt6eP G8VhUUmTBDFYhrtIVSM6hDB10JXdG3+Ikym5WPVUkjjP+KcaR5wzFqWxtmWDHb53a2G/n TUW/YIKgbcFwtHeDXfSfanICQZAYbWA25BFGeAXBg3EPaX5AbRmOQ1TciTTsyOhW+8g== 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="GrZWZW/g"; 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 B4623606A325; Tue, 1 Dec 2026 06:46:09 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1DC21F0089F; Tue, 1 Dec 2026 06:46:08 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796107569; bh=gqIEafF3ahem4e5D/4YwnUIRhD0srHFUqqQBZ4oqn0I=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GrZWZW/gpag3fNQpXr0Jhj9MkxSpybDqLCaqzBxPQeGnwaRYQzLliZc0UWLrdPsuR GyM627zKOpIYt4KgsegeIHtR6NkHjjfdnRmIAhCMj5Lit87y0v2PP07OoNJvUs6QWz /Kq4aQ0IS49KJ02NH4saoJwVVxOWyBlmRMf09e0KWGqdNUaE+3AgBLm/U3PJZOFRXF ceVE4L13vTXUYUMXpWonRXoxbtiRkpwMIYaWOQl6ExXMjjGw1YQbR+kgCjOlLb6PV/ eLEqZS5w9T/QxDXKtuVWlI68GQCM8OaBf6HleCkitlhii/5G/nTjqFAkU373NWsx5U 8XSj8v78/WHQg== 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: <20261130063123.2408-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