From: sashiko-bot@kernel.org
To: "Markus Stockhausen" <markus.stockhausen@gmx.de>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v13 09/11] net: mdio: realtek-rtl9300: Add support for RTL838x
Date: Sat, 08 Aug 2026 17:12:31 +0000 [thread overview]
Message-ID: <20260808171231.C57AE1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260807171058.522833-10-markus.stockhausen@gmx.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Omitting C45 read/write callbacks causes C45-over-C22 fallback, which races with the hardware polling engine and silently corrupts PHY MMD registers.
--
--- Patch [9]: [PATCH net-next v13 09/11] net: mdio: realtek-rtl9300: Add support for RTL838x ---
commit d55bec9024e95e7ae2bc08007789dc929916fc94
Author: Markus Stockhausen <markus.stockhausen@gmx.de>
net: mdio: realtek-rtl9300: Add support for RTL838x
This commit adds support for the RTL838x (maple) series to the RTL9300
MDIO driver. It introduces new hardware definitions, C22 access functions,
and controller setup for RTL8380.
[ ... ]
> @@ -868,6 +927,26 @@ static int otto_emdio_probe(struct platform_device *pdev)
> return 0;
> }
>
> +static const struct otto_emdio_info otto_emdio_8380_info = {
> + .addr_map_base = RTL8380_SMI_PORT0_5_ADDR_CTRL,
> + .cmd_fail = RTL8380_PHY_CTRL_FAIL,
> + .cmd_read = RTL8380_PHY_CTRL_READ,
> + .cmd_write = RTL8380_PHY_CTRL_WRITE,
> + .cmd_regs = {
> + .c22_data = RTL8380_SMI_ACCESS_PHY_CTRL_1,
> + .c45_data = RTL8380_SMI_ACCESS_PHY_CTRL_3,
> + .io_data = RTL8380_SMI_ACCESS_PHY_CTRL_2,
> + .port_mask_low = RTL8380_SMI_ACCESS_PHY_CTRL_0,
> + },
> + .num_buses = RTL8380_NUM_BUSES,
> + .num_pages = RTL8380_NUM_PAGES,
> + .num_ports = RTL8380_NUM_PORTS,
> + .poll_ctrl = RTL8380_SMI_POLL_CTRL,
> + .setup_controller = otto_emdio_8380_setup_controller,
> + .read_c22 = otto_emdio_8380_read_c22,
> + .write_c22 = otto_emdio_8380_write_c22,
> +};
[Severity: High]
Will omitting the .read_c45 and .write_c45 callbacks here cause the PHY
subsystem to automatically use the C45-over-C22 software fallback via
mmd_phy_indirect() when MMD registers are accessed?
The commit message mentions keeping the C45 helpers out of the driver until
needed. However, if any kernel PHY code (like EEE initialization) or userspace
tool accesses MMD registers, the software fallback performs multiple non-atomic
C22 writes to registers 13 and 14.
Since the hardware polling engine autonomously and continuously writes to these
same registers in the background, could the software fallback interleave with
the polling engine and silently corrupt the PHY MMD configuration?
If C45 access should be disabled for now, would it be safer to provide dummy
C45 callbacks that return an error, or to have otto_emdio_write_c22() intercept
and reject writes to registers 13 and 14?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260807171058.522833-1-markus.stockhausen@gmx.de?part=9
next prev parent reply other threads:[~2026-08-08 17:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 17:10 [PATCH net-next v13 00/11] net: mdio: realtek-rtl9300: Add RTL83xx support Markus Stockhausen
2026-08-07 17:10 ` [PATCH net-next v13 01/11] dt-bindings: net: realtek,rtl9301-mdio: Add RTL83xx series Markus Stockhausen
2026-08-07 17:10 ` [PATCH net-next v13 02/11] net: mdio: realtek-rtl9300: Add polling documentation Markus Stockhausen
2026-08-07 17:10 ` [PATCH net-next v13 03/11] net: phy: add (*notify_phy_attach/detach)() hooks to struct mii_bus Markus Stockhausen
2026-08-08 17:12 ` sashiko-bot
2026-08-07 17:10 ` [PATCH net-next v13 04/11] net: mdio: realtek-rtl9300: suppress sysfs bind/unbind attributes Markus Stockhausen
2026-08-08 17:12 ` sashiko-bot
2026-08-07 17:10 ` [PATCH net-next v13 05/11] net: mdio: realtek-rtl9300: Configure hardware polling during probing Markus Stockhausen
2026-08-07 17:10 ` [PATCH net-next v13 06/11] net: mdio: realtek-rtl9300: Add page tracking Markus Stockhausen
2026-08-07 17:10 ` [PATCH net-next v13 07/11] net: mdio: realtek-rtl9300: Increase MDIO timeout Markus Stockhausen
2026-08-07 17:10 ` [PATCH net-next v13 08/11] net: mdio: realtek-rtl9300: Check for C45 support during setup Markus Stockhausen
2026-08-08 17:12 ` sashiko-bot
2026-08-07 17:10 ` [PATCH net-next v13 09/11] net: mdio: realtek-rtl9300: Add support for RTL838x Markus Stockhausen
2026-08-08 17:12 ` sashiko-bot [this message]
2026-08-07 17:10 ` [PATCH net-next v13 10/11] net: mdio: realtek-rtl9300: Add support for RTL839x Markus Stockhausen
2026-08-07 17:10 ` [PATCH net-next v13 11/11] net: mdio: realtek-rtl9300: reword Kconfig and module description Markus Stockhausen
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=20260808171231.C57AE1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=markus.stockhausen@gmx.de \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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