Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Artem Shimko" <a.shimko.dev@gmail.com>,
	devicetree@vger.kernel.org, linux-leds@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org, lee@kernel.org
Subject: Re: [PATCH net-next 2/3] net: phy: dap8211r: add extended register write helper
Date: Sat, 14 Nov 2026 11:06:05 +0000	[thread overview]
Message-ID: <sashiko-outbox-214382@kernel.org> (raw)
In-Reply-To: <20261113110546.173624-3-a.shimko.dev@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] net: phy: dap8211r: inverted locking comment on
  dap8211r_write_ext()
--

commit 80c461dbd61c7143cfae371b80c6ab5797de75b3
Author: Artem Shimko <a.shimko.dev@gmail.com>

net: phy: dap8211r: add extended register write helper

This commit adds the dap8211r_write_ext() helper to write extended PHY
registers via indirect addressing.

> diff --git a/drivers/net/phy/dap8211r.c b/drivers/net/phy/dap8211r.c
> index 0bf770f8ebbb4..4eb50c26397fb 100644
> --- a/drivers/net/phy/dap8211r.c
> +++ b/drivers/net/phy/dap8211r.c
> @@ -88,6 +88,32 @@ static int dap8211r_read_ext(struct phy_device *phydev, u16 reg)
>  	return ret;
>  }
>  
> +/**
> + * dap8211r_write_ext() - Write extended register
> + * @phydev: PHY device structure
> + * @reg: Extended register address
> + * @data: Data to write
> + *
> + * Writes a PHY extended register using the indirect access method.
> + * The caller must hold the MDIO bus lock.
> + *
> + * Return: 0 on success, or negative error code
> + */
> +static int dap8211r_write_ext(struct phy_device *phydev, u16 reg, u16 data)
> +{
> +	int ret;
> +
> +	phy_lock_mdio_bus(phydev);
> +	ret = __phy_write(phydev, DAP8211R_EXT_ADD, reg);
> +	if (ret < 0)
> +		goto out;
> +
> +	ret = __phy_write(phydev, DAP8211R_EXT_DATA, data);
> +out:
> +	phy_unlock_mdio_bus(phydev);
> +	return ret;
> +}

[Severity: Low]
Does the kernel-doc comment for dap8211r_write_ext() state the opposite of
its locking requirement?  dap8211r_write_ext() takes the MDIO bus mutex via
phy_lock_mdio_bus(phydev), so a caller that already holds the lock will
deadlock.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261113110546.173624-1-a.shimko.dev@gmail.com?part=2

  parent reply	other threads:[~2026-11-14 11:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 11:05 [PATCH net-next 0/3] net: phy: dap8211r: add LED hardware control Artem Shimko
2026-11-13 11:05 ` [PATCH net-next 1/3] dt-bindings: net: dptel,dap8211r: add led nodes Artem Shimko
2026-11-13 17:17   ` Conor Dooley
2026-11-14 11:06   ` sashiko-bot
2026-11-13 11:05 ` [PATCH net-next 2/3] net: phy: dap8211r: add extended register write helper Artem Shimko
2026-11-13 20:28   ` Andrew Lunn
2026-11-14 11:06   ` sashiko-bot [this message]
2026-11-13 11:05 ` [PATCH net-next 3/3] net: phy: dap8211r: add led hardware control support Artem Shimko
2026-11-13 20:32   ` Andrew Lunn
2026-11-14 11:06   ` sashiko-bot

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=sashiko-outbox-214382@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=a.shimko.dev@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@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