Article View: linux.kernel.netdev
Article #26307Re: [PATCH net-next v29 RESEND 2/3] net: phy: Add support for Template Control register for PMA
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 11:49
Date: Thu, 03 Dec 2026 11:49
104 lines
12128 bytes
12128 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 commit subject ("net: phy: Add support for Template Control
register for PMA") and body ("10GBASE-T PMA Template Test Mode…
- [Low] genphy_c45_pma_test_mode() in drivers/net/phy/phy-c45.c is
documented to select "Normal or one of Test Mode 1..7", but it only…
--
net: phy: Add support for Template Control register for PMA
This commit adds a genphy_c45_pma_test_mode() helper and uAPI defines for
the 10GBASE-T PMA test mode register (1.132). The helper selects Normal or
Test Mode 1..7 by programming bits 15:13 of that register.
> net: phy: Add support for Template Control register for PMA
>
> Add support for the 10GBASE-T PMA Template Test Mode register
> field, which allows selecting one of eight test modes (Normal and
> TestMode1..TestMode7) used for PHY validation.
[Severity: Low]
This isn't a bug, but is "Template" the right name for this register?
IEEE 802.3 calls register 1.132 the 10GBASE-T test mode register. The code
in this patch uses the same name:
#define MDIO_PMA_10GBT_TESTMODE 132 /* Test mode control */
The kernel-doc for genphy_c45_pma_test_mode() also says "configure the
10GBASE-T PMA test mode register".
Could the subject and body use the test mode name instead?
> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
> index 828af4c4e9d4c..0136727767ace 100644
> --- a/drivers/net/phy/phy-c45.c
> +++ b/drivers/net/phy/phy-c45.c
> @@ -1444,6 +1444,26 @@ int genphy_c45_fast_retrain(struct phy_device *phydev, bool enable)
> }
> EXPORT_SYMBOL_GPL(genphy_c45_fast_retrain);
>
> +/**
> + * genphy_c45_pma_test_mode - configure the 10GBASE-T PMA test mode register
> + * @phydev: target phy_device struct
> + * @test_mode: test mode to select, one of MDIO_PMA_10GBT_TESTMODE_*
> + *
> + * Set the 10GBASE-T PMA test mode to Normal or one of Test Mode 1..7.
> + *
> + * Return: 0 on success, or a negative error code on failure (e.g. register
> + * read/write error).
> + */
> +int genphy_c45_pma_test_mode(struct phy_device *phydev, u16 test_mode)
> +{
> + if (test_mode & ~MDIO_PMA_10GBT_TESTMODE_MASK)
> + return -EOPNOTSUPP;
> +
> + return phy_modify_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_10GBT_TESTMODE,
> + MDIO_PMA_10GBT_TESTMODE_MASK, test_mode);
[Severity: Low]
The kernel-doc says this selects "Normal or one of Test Mode 1..7". The
helper only writes bits 15:13 of register 1.132, because
MDIO_PMA_10GBT_TESTMODE_MASK is 0xE000.
In IEEE 802.3, bits 1.132.12:10 are the transmitter test frequencies field.
That field picks the dual-tone pair sent in Test Mode 4. Several of its
encodings are reserved, including 000.
What happens when a caller passes MDIO_PMA_10GBT_TESTMODE_4? The
read-modify-write keeps whatever is already in bits 12:10. Frequency bits
cannot be passed in either, because the check above rejects them:
if (test_mode & ~MDIO_PMA_10GBT_TESTMODE_MASK)
return -EOPNOTSUPP;
The PHY would then send whatever tone pair the stale bits select. That
could be a reserved encoding, depending on the PHY's reset value.
The uAPI header also defines MDIO_PMA_10GBT_TESTMODE_4 but nothing for
bits 12:10.
The only caller in this series is the YT8824 code in
drivers/net/phy/motorcomm.c, added by "net: phy: Add driver for Motorcomm
Quad 2.5GbE phy". It only uses MDIO_PMA_10GBT_TESTMODE_1 and
MDIO_PMA_10GBT_TESTMODE_NORMAL, so nothing in the tree triggers this today.
Could the kernel-doc say that Test Mode 4 needs the frequency field
programmed separately? Alternatively, could the header gain defines for
bits 12:10, with a way to pass them through this exported helper?
> +}
> +EXPORT_SYMBOL_GPL(genphy_c45_pma_test_mode);
> +
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202105259.3767612-1-kyle.switch%40motor-comm.com
Technical Details
Message-ID:
<179629856356.3146.7532277250694179813@kernel.org>Path:
mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376527-linux-kernel-netdev=dewy.ruReferences:
<20261202105259.3767612-3-kyle.switch@motor-comm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376527-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v29 RESEND 2/3] net: phy: Add support for Template Control register for PMA Date: Thu, 03 Dec 2026 11:49:23 +0000 Organization: Usenet Network Message-ID: <179629856356.3146.7532277250694179813@kernel.org> References: <20261202105259.3767612-3-kyle.switch@motor-comm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2476736"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Tc8hms9/EbTNxvX02HvHxgafHt8= sha256:vK8OWwy6/ZC0eaJRuJugpqepuxPucv0aD26NDCXp8Zk= sha1:HjcHpbA4CxBGtBpqKAvVRIY+F60= sha256:QWOJqxIK1mOpp2v44qqcL0lanYXCHXa0jXLCVCkZJt0= 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 A6CE21178F6; Thu, 3 Dec 2026 14:49:49 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.64 X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, 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 mQifOGAZ2E0d; Thu, 3 Dec 2026 14:49:46 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376527-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 828CC1178F8; Thu, 3 Dec 2026 14:49:38 +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 94C942FA43; Thu, 3 Dec 2026 11:49:28 +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=1796298566; b=5ejK2QvWP3BfakvD84xW1fBrTdkO1f4IIg7rTyL7woITaGxqfEzTGBqsRp3A/yCdWA07 KJw6Vy9WIjS5fkbRwEmd9m6cFpVfgYfVRGQC80+YYz7YUO3WXYW68voBL8EfaFJXEYQRg gHXoA0n8sYVVZ5+n1WFLEW057ysohbXdADuA3EZwXDqby4zCGZN0aPkvXY/FUckfC0CbS NGjRgPvtHcmd01R+/qXlte3TmsXNrTOLt52XqyNKTZSOcBjQS0j1sEDNZZPwxDEPm/xzu bMiOEEOXR0ePuM/PVuXX/xW/lj843B6NLnH74LVAlpa7TICg2R6TWDxsmhKqxO3a7mw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796298566; 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=i0xqwBXCUObWDgU4n5RyYKK+2iAvp5qoO6AuXuwd7us=; b=4zBQDDJgi2hOcfbjlRjhiWhII8zhphiSGpAYwgr0EeCb6WQP+Uw+O+zmHLGkNGtWO9NO XN3Rs9+mE3DEyOnXPcdSoQuDBdHhNPV2tSfE9d3BtsI7luuYxlzvmHNDmTR9lIHXQbTqy S9d3B7z0FlQLvIbaBSpNE7KGaobs+uFrIEYyOCBw9Fav7dROBAyqsbGUFIHKb5kA9WFVe J2bcwnNBlq794RoHOxptE4MJiNeKyog7rOd0paypmQFHJ9eAQLs70RzKzbj//+bp+LcN/ xVlKwVszaIFQlBBi9OAwid1xlH4Oztq7yK7eBEJa0XCYy27J13dRUFxWt08vEKo2gCA== 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=m6HJhKRA; 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 5C579606A337; Thu, 3 Dec 2026 11:49:26 +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=m6HJhKRA 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=1796298565; b=XcKBYv+ijy85zINBpPxp45xCcqLNe9GSyDmis6stImouBVw0ROcEO6rVSAvhd6Kafatp i0PsleguvQxfl0FQaITrp2CBuIqAtZmvQwhnlJ3kcSUqHjgkJmy12ryTPYFYKlf4zW/DB qNtnIcG9z+/7kw6foW1C+XUzxb6Ngrn3hDKFpQlzqknM0pGvWT6CLIXxixIQ4YrKKI785 6QHEPUPYyhQNjRLjQmAlpkxQVru1Sww2jh04VysAG4wTvgkeAwwBABaknKrwXVfo5RAWQ flpj/mJYC5TwoVvjm3xGehohKGoE2vWUlPigLkYoAO4iV0koMg6DQEKc2ual9U9VY3A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796298565; 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=i0xqwBXCUObWDgU4n5RyYKK+2iAvp5qoO6AuXuwd7us=; b=lYGK1SR0IF4tuRQ8poZETNohV8EEyOHO4oLs9/UPvpMA4ac1S8R6MWNsV8oME09SmF/I RiW7eOw7fmNCPp1iVk/7BVVMGwBTxed7cPEuX5VAAmsjVPbJFCkie8Hcw4S/JuDO2+yRQ HWGTyZ50u9rID43tdkEHNz8QtTpMpfdFQC7bkkaUGSWUfGXAjfwGGdXOo0853C9l1UfX7 pblk37jq/nIOBh+EDfRO24kL/rMKerQbl42fJlSQASE7xP2ta3fsqt2E9yhwRycV3898F 9DXp6n1NcJZjm9tIlpWWymWJyhR49W1ebIf8xJ4DxnVfQwaJ3ZSsgT3pi8SbG+dMJRw== 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=m6HJhKRA; 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 7DC1C606A32D; Thu, 3 Dec 2026 11:49:25 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AFA81F0089B; Thu, 3 Dec 2026 11:49:23 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796298565; bh=i0xqwBXCUObWDgU4n5RyYKK+2iAvp5qoO6AuXuwd7us=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=m6HJhKRALqHSaPvOgdrwSMy826QU6LsPR9FXQ/u4REqk7tF7Xmc6HLrJAjQL87/rU yyU+eM7m0Td2zbNZK1xiS1bCclpB7IBQDCqvFiH5LpoR4B8snEviJyIqHpo5KSgJ4l LSISZ+cUOxR9MWaJ4WNVWClnzg4fpWpke73KZ/xRbZ8XFXR3FCQiiwMMcjY4p/WTwb 4loL59KG9vCzOFG1xhuL4m7WfRgUnJNjBUxZTScb5sgL6IZkQnIRKq4Nqm3qt9jU/1 rC92w+f7e3/5hpXnNkwa/zig6tqqQfnE7MGhQXJ90bspuQ3XHomcZdmmVzaeD4A4Cv mYF+3xxEKDjbg== X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, Frank.Sae@motor-comm.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ming.xu@motor-comm.com, xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com X-In-Reply-To: <20261202105259.3767612-3-kyle.switch@motor-comm.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