From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796369451; b=TdKa8sCTa0AnMZZU1rOOfLk39EB6UaAqXsNQr1OMDj/98EM55UMm+uTssflVFaBHl5vp i99Li1EXUwrGQ3SN3h+RmTXGrDHtczi5XIM1itg0M/vw6mWFgcXIUMsPii/tFJVC1lG0k Uia63ML5Hg9nr2gj4YROTIzunvgFcWDdhe5oqjNTB1lF/ozb9iNpvQEXXt2530K+ehceg /Oa10tnoWzNA3Fu/jRCgNgKPclp47aZmg4zZYXqU9Lkl6QYW5sczh2GwHOtIYP3p4H74X e+yhZk2ODacoYewUAgiLhF5XHey6JZJ23TGGKOgfNMMRCYikeYlvzAYSecvj72YrYdw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796369451; h=DMARC-Filter:X-Alimail-AntiSpam:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=NPj2g+QUk/D7GDYb9OjwaEsocpHj8fVbZWdiyD97S6k=; b=yy4902PDgZxI2oACBeKsf+gfPz7z+7NL9EVbB/UwBA7Z8caD0HrMETvDe50DLLmRzSDv W+lDJ0lAlUVvJrhM3BhjeKfem4k5GLMSD1q8mYtatGKtoDU/u+PJ01/1xhdVEJYcVCAI1 EFpdYG7nrltZjSmqJHBX40QjOwD8HwETSteO2BgEX1TAukoF4LDfI63DLf9+nsV9CR2l0 eWRHscHcriAg9MVwm25M84i7g8sKdZzeaRxsXTWZ5p0zY+PNOZMYRdjNkHc22vXdqxuRN HmFUQpczNGvsYKU6Dvkr0WIc8iOZNQp9DKxVQQ6T/dw1CtDGkapeIRW16EzOE8Se35w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=motor-comm.com; spf=pass smtp.mailfrom=motor-comm.com; arc=none smtp.remote-ip=115.124.28.124 Received: from out28-124.mail.aliyun.com (out28-124.mail.aliyun.com [115.124.28.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8E5B606A332; Fri, 4 Dec 2026 07:30:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C8E5B606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motor-comm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=motor-comm.com X-Alimail-AntiSpam:AC=CONTINUE;BC=0.07440638|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.126443-0.000544618-0.873012;FP=11957424094194446194|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033037034184;MF=kyle.switch@motor-comm.com;NM=1;PH=DS;RN=19;RT=19;SR=0;TI=SMTPD_---.kGUJtah_1796369432; Received: from 10.10.26.192(mailfrom:kyle.switch@motor-comm.com fp:SMTPD_---.kGUJtah_1796369432 cluster:ay29) by smtp.aliyun-inc.com; Fri, 04 Dec 2026 15:30:34 +0800 Message-ID: Date: Fri, 4 Dec 2026 15:30:32 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v29 RESEND 2/3] net: phy: Add support for Template Control register for PMA To: netdev-bot+sashiko@kernel.org 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 References: <20261202105259.3767612-3-kyle.switch@motor-comm.com> <179629856356.3146.7532277250694179813@kernel.org> Content-Language: en-US From: Kyle Switch In-Reply-To: <179629856356.3146.7532277250694179813@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/3/26 19:49, netdev-bot+sashiko@kernel.org wrote: > 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? will be refactor in next patch. >> 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? will added in next patch. >> +} >> +EXPORT_SYMBOL_GPL(genphy_c45_pma_test_mode); >> + > [ ... ] >