From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Ian Rogers" <irogers@google.com>, "Vinod Koul" <vkoul@kernel.org>
Cc: "Neil Armstrong" <neil.armstrong@linaro.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
linux-phy@lists.infradead.org, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Benoît Monin" <benoit.monin@bootlin.com>,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Vladimir Oltean" <olteanv@gmail.com>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
linux-mips@vger.kernel.org
Subject: Re: [PATCH 04/10] phy: eyeq5-eth: Set .owner = THIS_MODULE
Date: Tue, 01 Dec 2026 11:25:06 +0100 [thread overview]
Message-ID: <DN9BNHOPB31T.36NN8MGSEFP0V@bootlin.com> (raw)
In-Reply-To: <20261130225428.99361-5-irogers@google.com>
Hello Ian,
On Mon Nov 30, 2026 at 11:54 PM CET, Ian Rogers wrote:
> phy_get() and of_phy_get() call try_module_get(phy->ops->owner) to pin
> the PHY provider module while the PHY is in use, and of_phy_put() calls
> module_put(phy->ops->owner). Because phy->ops is const struct phy_ops *,
> phy_create() cannot populate ops->owner at runtime, and
> try_module_get(NULL) returns true without incrementing the module
> reference count.
>
> Set .owner = THIS_MODULE in eq5_phy_ops, found with Clang's
> require_explicit_initialization attribute.
>
> Fixes: b6e33443876d ("phy: Add driver for EyeQ5 Ethernet PHY wrapper")
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> drivers/phy/phy-eyeq5-eth.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/phy/phy-eyeq5-eth.c b/drivers/phy/phy-eyeq5-eth.c
> index fae147268f5f..69c428a867c8 100644
> --- a/drivers/phy/phy-eyeq5-eth.c
> +++ b/drivers/phy/phy-eyeq5-eth.c
> @@ -182,6 +182,7 @@ static const struct phy_ops eq5_phy_ops = {
> .power_off = eq5_phy_power_off,
> .set_mode = eq5_phy_set_mode,
> .validate = eq5_phy_validate,
> + .owner = THIS_MODULE,
> };
>
> static struct phy *eq5_phy_xlate(struct device *dev,
Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com>
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2026-12-01 10:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261130225428.99361-1-irogers@google.com>
2026-11-30 22:54 ` [PATCH 04/10] phy: eyeq5-eth: Set .owner = THIS_MODULE Ian Rogers
2026-12-01 10:25 ` Théo Lebrun [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=DN9BNHOPB31T.36NN8MGSEFP0V@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=benoit.monin@bootlin.com \
--cc=gregory.clement@bootlin.com \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=luca.ceresoli@bootlin.com \
--cc=mani@kernel.org \
--cc=nathan@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=vkoul@kernel.org \
--cc=vladimir.kondratiev@mobileye.com \
/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