Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "James Hilliard" <james.hilliard1@gmail.com>
Cc: conor+dt@kernel.org, linux-sunxi@lists.linux.dev,
	robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v7 2/2] net: phy: add X-Powers AC200/AC300 EPHY driver
Date: Wed, 12 Aug 2026 23:28:54 +0000	[thread overview]
Message-ID: <20260812232855.711ED1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260811-submit-acx00-of-dynamic-v1-v7-2-03f5b91775d5@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Using device_trylock() with a fallback to -EPROBE_DEFER creates a fragile retry loop that can lead to permanent probe failures.
--

--- Patch [2]: [PATCH net-next v7 2/2] net: phy: add X-Powers AC200/AC300 EPHY driver ---
commit 51ec613693f83307bdc7a40a8e3f884bbf572129
Author: James Hilliard <james.hilliard1@gmail.com>
Subject: net: phy: add X-Powers AC200/AC300 EPHY driver

This commit adds a new Ethernet PHY driver for the X-Powers AC200 and AC300
companion ICs. It configures shared MDIO registers along with
package-specific I2C or MDIO control registers.

> diff --git a/drivers/net/phy/xpowers/ac200.c b/drivers/net/phy/xpowers/ac200.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/net/phy/xpowers/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: Medium]
Could this trylock and deferral pattern lead to permanent probe failures?

If the AC200 device is already fully bound, but its device lock is temporarily
held by another thread (such as a concurrent sysfs attribute read or a PM 
suspend/resume operation) when the PHY driver probes, device_trylock() will
fail.

This causes the PHY driver to return -EPROBE_DEFER. However, because the
supplier AC200 device is already bound, it will not trigger a new bind event.
If no other devices bind in the system to kick the deferred probe workqueue,
the PHY could remain permanently unbound.

Is there a way to avoid this fragile retry loop, perhaps by using standard
locking instead of treating transient lock contention as a missing
dependency?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260811-submit-acx00-of-dynamic-v1-v7-0-03f5b91775d5@gmail.com?part=2

      reply	other threads:[~2026-08-12 23:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 23:28 [PATCH net-next v7 0/2] net: phy: add X-Powers AC200/AC300 EPHY support James Hilliard
2026-08-11 23:28 ` [PATCH net-next v7 1/2] dt-bindings: net: x-powers: add AC200/AC300 EPHY packages James Hilliard
2026-08-11 23:28 ` [PATCH net-next v7 2/2] net: phy: add X-Powers AC200/AC300 EPHY driver James Hilliard
2026-08-12 23:28   ` sashiko-bot [this message]

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=20260812232855.711ED1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=james.hilliard1@gmail.com \
    --cc=linux-sunxi@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