From: netdev-bot+sashiko@kernel.org
To: kyle.switch@motor-comm.com
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
Subject: Re: [PATCH net-next v22 2/3] net: phy: Add support for Template Control register for PMA
Date: Thu, 01 Oct 2026 09:54:32 +0000 [thread overview]
Message-ID: <179084847200.434549.17753348636373360897@kernel.org> (raw)
In-Reply-To: <20260929095430.508657-3-kyle.switch@motor-comm.com>
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 new uAPI macro MDIO_PMA_10GBT_TESTMODE_MASK in
include/uapi/linux/mdio.h is defined as GENMASK(15, 13).
- [Low] net: phy: 'template' is a misnomer for standard 10GBASE-T test
mode
--
net: phy: Add support for Template Control register for PMA
This commit adds genphy_c45_template_testmode(), which programs the
10GBASE-T PMA template test mode field. It also adds new defines for
the register (132) and for the Normal and TestMode1..TestMode7 values
to include/uapi/linux/mdio.h.
> diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h
> index 06f4bc3c20c71..353ca13c64fca 100644
> --- a/include/uapi/linux/mdio.h
> +++ b/include/uapi/linux/mdio.h
> @@ -63,6 +63,7 @@
> /* Media-dependent registers. */
> #define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */
> #define MDIO_PMA_10GBT_TXPWR 131 /* 10GBASE-T TX power control */
> +#define MDIO_PMA_10GBT_TESTMODE 132 /* Test mode control */
> #define MDIO_PMA_10GBT_SNR 133 /* 10GBASE-T SNR margin, lane A.
> * Lanes B-D are numbered 134-136. */
[ ... ]
> @@ -320,6 +321,17 @@
> /* PMA 10GBASE-R Fast Retrain status and control register. */
> #define MDIO_PMA_10GBR_FSRT_ENABLE 0x0001 /* Fast retrain enable */
>
> +/* PMA 10GBASE-T Template Test Mode Register*/
> +#define MDIO_PMA_10GBT_TESTMODE_MASK GENMASK(15, 13) /* Template test mode */
[Severity: Low]
Is "template" the right name for this helper? IEEE 802.3 calls PMA/PMD
register 1.132 the 10GBASE-T test mode register. As far as I can tell,
the word template is not part of the register's name in the standard.
The same wording shows up in several places:
- the exported symbol genphy_c45_template_testmode()
- its kerneldoc
- the "PMA 10GBASE-T Template Test Mode Register" comment and the
"Template ..." value comments in include/uapi/linux/mdio.h
- the subject line ("Template Control register")
The new defines themselves are called MDIO_PMA_10GBT_TESTMODE_*, so the
function name no longer matches the register it programs. Someone
reading the code or grepping for the 10GBASE-T test mode register won't
easily find this helper.
This has no functional impact. Still, once the symbol is exported from
the core PHY library, other drivers may start using it and the name
becomes harder to change.
If template refers to something in the Motorcomm datasheet or in the
test procedure, could you say so in the commit message? Otherwise, would
something like genphy_c45_10gbt_testmode() be closer to the standard's
naming, with the comments and subject line updated to match?
[Severity: Low]
Will userspace be able to use this macro? GENMASK() comes from the
kernel-internal include/linux/bits.h. This uapi header only includes:
#include <linux/types.h>
#include <linux/mii.h>
So a userspace program that includes <linux/mdio.h> and uses
MDIO_PMA_10GBT_TESTMODE_MASK will not compile unless it defines GENMASK
itself.
The MDIO_AN_C73_*_MASK defines in this header already have the same
problem, but this change adds another one to the exported header.
Would __GENMASK(15, 13) from include/uapi/linux/bits.h, or a plain 0xe000,
work better here?
This isn't a bug, but the new register define above uses spaces:
#define MDIO_PMA_10GBT_TESTMODE 132 /* Test mode control */
while the lines around it use tabs to line up the values and comments. The
same goes for the new MDIO_PMA_10GBT_TESTMODE_* value defines.
> +#define MDIO_PMA_10GBT_TESTMODE_NORMAL 0x0 /* Template Normal */
> +#define MDIO_PMA_10GBT_TESTMODE_1 0x1 /* Template TestMode1 */
> +#define MDIO_PMA_10GBT_TESTMODE_2 0x2 /* Template TestMode2 */
> +#define MDIO_PMA_10GBT_TESTMODE_3 0x3 /* Template TestMode3 */
> +#define MDIO_PMA_10GBT_TESTMODE_4 0x4 /* Template TestMode4 */
> +#define MDIO_PMA_10GBT_TESTMODE_5 0x5 /* Template TestMode5 */
> +#define MDIO_PMA_10GBT_TESTMODE_6 0x6 /* Template TestMode6 */
> +#define MDIO_PMA_10GBT_TESTMODE_7 0x7 /* Template TestMode7 */
> +
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260929095430.508657-1-kyle.switch%40motor-comm.com
next prev parent reply other threads:[~2026-10-01 9:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 9:54 [PATCH net-next v22 0/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy Kyle Switch
2026-09-29 9:54 ` [PATCH net-next v22 1/3] dt-bindings: net: Document Motorcomm YT8824 PHY package Kyle Switch
2026-10-01 9:54 ` netdev-bot+sashiko
2026-09-29 9:54 ` [PATCH net-next v22 2/3] net: phy: Add support for Template Control register for PMA Kyle Switch
2026-09-29 12:00 ` Andrew Lunn
2026-10-01 9:54 ` netdev-bot+sashiko [this message]
2026-09-29 9:54 ` [PATCH net-next v22 3/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy Kyle Switch
2026-09-29 12:18 ` Andrew Lunn
2026-09-30 0:39 ` Kyle Switch
2026-10-01 9:54 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179084847200.434549.17753348636373360897@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=Frank.Sae@motor-comm.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=jianmin.wang@motor-comm.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=kyle.switch@motor-comm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=ming.xu@motor-comm.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=xiaolin.xu@motor-comm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®