From: sashiko-bot@kernel.org
To: "James Hilliard" <james.hilliard1@gmail.com>
Cc: lee@kernel.org, robh@kernel.org, devicetree@vger.kernel.org,
mfd@lists.linux.dev, conor+dt@kernel.org
Subject: Re: [PATCH net-next v4 4/4] net: phy: add X-Powers AC200/AC300 EPHY driver
Date: Sat, 08 Aug 2026 04:52:06 +0000 [thread overview]
Message-ID: <20260808045207.3B8A11F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260806-submit-acx00-of-dynamic-v1-v4-4-9bf2f7441632@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Use of device_trylock() with a fallback to -EPROBE_DEFER is an anti-pattern used to bypass lock ordering.
--
--- Patch [4]: [PATCH net-next v4 4/4] net: phy: add X-Powers AC200/AC300 EPHY driver ---
commit 6bc6a63de1c66219eb59d7933bc21eede2472534
Author: James Hilliard <james.hilliard1@gmail.com>
net: phy: add X-Powers AC200/AC300 EPHY driver
This commit introduces the Ethernet PHY driver for the X-Powers AC200 and
AC300 companion ICs. It configures the shared MDIO PHY registers and manages
the package-specific I2C or MDIO control registers. The driver also handles
clock selection, vendor initialization, and power sequencing.
> --- /dev/null
> +++ b/drivers/net/phy/xpowers-acx00-ac200.c
[ ... ]
> +struct acx00_ephy_control *
> +ac200_ephy_ctl_create(struct phy_device *phydev,
> + struct device_node *package_node,
> + bool has_calibration, u8 calibration)
> +{
[ ... ]
> + if (!device_link_add(dev, &client->dev,
> + DL_FLAG_AUTOREMOVE_CONSUMER)) {
> + ret = dev_err_probe(dev, -EINVAL,
> + "failed to link AC200 device\n");
> + goto out_put_client;
> + }
> +
> + if (!device_trylock(&client->dev)) {
> + ret = dev_err_probe(dev, -EPROBE_DEFER,
> + "AC200 driver is not ready\n");
> + goto out_put_client;
> + }
[Severity: High]
Is this use of device_trylock() with a fallback to return -EPROBE_DEFER safe
from causing permanent probe failures?
The networking driver guidelines define trylock with a fallback to skip the
work entirely as an indicator of a flawed locking design that bypasses
proper lock ordering. If the lock happens to be held by an unrelated
subsystem, such as userspace sysfs access or power management, at the end
of the boot process when the deferred probe queue finishes, could this
cause the probe to permanently fail?
Could this be replaced with a proper dependency or synchronization mechanism
that avoids bypassing lock ordering?
> +
> + if (device_is_bound(&client->dev))
> + priv->regmap = dev_get_regmap(&client->dev, NULL);
> + device_unlock(&client->dev);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260806-submit-acx00-of-dynamic-v1-v4-0-9bf2f7441632@gmail.com?part=4
next prev parent reply other threads:[~2026-08-08 4:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 4:51 [PATCH net-next v4 0/4] net: phy: add X-Powers AC200/AC300 EPHY support James Hilliard
2026-08-07 4:51 ` [PATCH net-next v4 1/4] dt-bindings: mfd: x-powers: Add AC200 James Hilliard
2026-08-08 4:52 ` sashiko-bot
2026-08-09 15:34 ` Andrew Lunn
2026-08-09 19:33 ` James Hilliard
2026-08-09 20:48 ` Andrew Lunn
2026-08-07 4:51 ` [PATCH net-next v4 2/4] mfd: ac200: Add X-Powers AC200 support James Hilliard
2026-08-08 4:52 ` sashiko-bot
2026-08-07 4:51 ` [PATCH net-next v4 3/4] dt-bindings: net: x-powers: add AC200/AC300 EPHY packages James Hilliard
2026-08-08 4:52 ` sashiko-bot
2026-08-07 4:51 ` [PATCH net-next v4 4/4] net: phy: add X-Powers AC200/AC300 EPHY driver James Hilliard
2026-08-08 4:52 ` sashiko-bot [this message]
2026-08-09 15:50 ` Andrew Lunn
2026-08-09 20:29 ` James Hilliard
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=20260808045207.3B8A11F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=james.hilliard1@gmail.com \
--cc=lee@kernel.org \
--cc=mfd@lists.linux.dev \
--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