From: sashiko-bot@kernel.org
To: "Artem Shimko" <a.shimko.dev@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH net-next v5 3/3] net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
Date: Tue, 04 Aug 2026 10:17:56 +0000 [thread overview]
Message-ID: <20260804101756.F350A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260803101734.270821-4-a.shimko.dev@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Incorrect initialization order: RGMII delay settings are written after the PHY software reset.
- [Low] Brittle error handling in read_poll_timeout relies on mathematical coincidence of negative error codes.
--
--- Patch [3]: [PATCH net-next v5 3/3] net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver ---
commit a53a9ce41047cdc6842142dab15fe0303b0f860a
Author: Artem Shimko <a.shimko.dev@gmail.com>
net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
Adds a new PHY driver for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY.
The driver implements extended register access for RGMII delay configuration.
> diff --git a/drivers/net/phy/dap8211r.c b/drivers/net/phy/dap8211r.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/net/phy/dap8211r.c
[ ... ]
> +static int dap8211r_config_init(struct phy_device *phydev)
> +{
[ ... ]
> + set |= FIELD_PREP(DAP8211R_RGMII_RX_DEL_MASK, rx_internal_delay);
> + set |= FIELD_PREP(DAP8211R_RGMII_TX_DEL_MASK, tx_internal_delay);
> +
> + ret = dap8211r_modify_ext(phydev, DAP8211R_PHY_CON, DAP8211R_PHY_SW_RST, 0);
> + if (ret)
> + return ret;
> +
> + /* Wait for reset self-clear (from low active to high) */
> + ret = read_poll_timeout(dap8211r_read_ext, val,
> + (val & DAP8211R_PHY_SW_RST),
[Severity: Low]
Should this exit condition explicitly check for val < 0?
If dap8211r_read_ext() returns a negative error code, this loop currently
terminates only because negative values in two's complement happen to have
BIT(15) set. Relying on this coincidence might mask errors if a different
register or bit is polled in the future.
> + 20, 200, false, phydev, DAP8211R_PHY_CON);
> + if (ret)
> + return ret;
> + if (val < 0)
> + return val;
> +
> + ret = dap8211r_modify_ext(phydev, DAP8211R_RGMII_CON, DAP8211R_RGMII_CONFIG_MASK, set);
[Severity: Medium]
The function's docstring mentions "Software reset to apply settings", but here
the RGMII configuration is written after the reset completes.
Does this PHY require the settings to be written before the software reset in
order to latch them properly?
> + if (ret)
> + return ret;
> +
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260803101734.270821-1-a.shimko.dev@gmail.com?part=3
next prev parent reply other threads:[~2026-08-04 10:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 10:17 [PATCH net-next v5 0/3] Add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver Artem Shimko
2026-08-03 10:17 ` [PATCH net-next v5 1/3] dt-bindings: vendor-prefixes: add Guangdong Dapu Telecom Co., Ltd Artem Shimko
2026-08-04 6:46 ` Krzysztof Kozlowski
2026-08-04 7:14 ` Artem Shimko
2026-08-03 10:17 ` [PATCH net-next v5 2/3] dt-bindings: net: add DAPU Telecom DAP8211R(I) PHY binding Artem Shimko
2026-08-03 10:17 ` [PATCH net-next v5 3/3] net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver Artem Shimko
2026-08-04 2:30 ` Andrew Lunn
2026-08-04 7:13 ` Artem Shimko
2026-08-04 13:26 ` Andrew Lunn
2026-08-04 14:05 ` Artem Shimko
2026-08-04 10:17 ` sashiko-bot [this message]
2026-08-04 10:38 ` Artem Shimko
2026-08-04 2:32 ` [PATCH net-next v5 0/3] Add " Andrew Lunn
2026-08-04 7:03 ` Artem Shimko
2026-08-04 13:32 ` Andrew Lunn
2026-08-04 14:08 ` Artem Shimko
2026-08-04 14:41 ` Andrew Lunn
2026-08-04 15:12 ` Artem Shimko
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=20260804101756.F350A1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=a.shimko.dev@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--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