mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: 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, "Ian Rogers" <irogers@google.com>,
	"Peter Griffin" <peter.griffin@linaro.org>,
	"André Draszik" <andre.draszik@linaro.org>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Roy Luo" <royluo@google.com>,
	"Joy Chakraborty" <joychakr@google.com>,
	"Naveen Kumar" <mnkumar@google.com>,
	"RD Babiera" <rdbabiera@google.com>,
	"Neill Kapron" <nkapron@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Subject: [PATCH 05/10] phy: google: usb: Set .owner = THIS_MODULE
Date: Mon, 30 Nov 2026 14:54:21 -0800	[thread overview]
Message-ID: <20261130225428.99361-6-irogers@google.com> (raw)
In-Reply-To: <20261130225428.99361-1-irogers@google.com>

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 google_usb2_phy_ops and google_usb3_phy_ops,
found with Clang's require_explicit_initialization attribute.

Fixes: cbce66669c82 ("phy: Add Google Tensor SoC USB PHY driver")
Fixes: 8c2b331e6327 ("phy: Add USB3 PHY support to Google Tensor SoC USB PHY driver")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 drivers/phy/phy-google-usb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/phy/phy-google-usb.c b/drivers/phy/phy-google-usb.c
index 2acdb2b0e534..b820b1e34ad9 100644
--- a/drivers/phy/phy-google-usb.c
+++ b/drivers/phy/phy-google-usb.c
@@ -348,6 +348,7 @@ static int google_usb2_phy_exit(struct phy *_phy)
 static const struct phy_ops google_usb2_phy_ops = {
 	.init		= google_usb2_phy_init,
 	.exit		= google_usb2_phy_exit,
+	.owner		= THIS_MODULE,
 };
 
 static int google_usb3_phy_init(struct phy *_phy)
@@ -470,6 +471,7 @@ static const struct phy_ops google_usb3_phy_ops = {
 	.init		= google_usb3_phy_init,
 	.exit		= google_usb3_phy_exit,
 	.power_on	= google_usb3_phy_power_on,
+	.owner		= THIS_MODULE,
 };
 
 static struct phy *google_usb_phy_xlate(struct device *dev,
-- 
2.56.1.839.g22a8290db9-goog


  parent reply	other threads:[~2026-11-30 22:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 22:54 [PATCH 00/10] phy: Set missing .owner = THIS_MODULE in phy_ops Ian Rogers
2026-11-30 22:54 ` [PATCH 01/10] phy: allwinner: phy-sun6i-mipi-dphy: Set .owner = THIS_MODULE Ian Rogers
2026-11-30 22:54 ` [PATCH 02/10] phy: cadence: cdns-dphy-rx: " Ian Rogers
2026-11-30 22:54 ` [PATCH 03/10] phy: cadence: cdns-dphy: " Ian Rogers
2026-11-30 22:54 ` [PATCH 04/10] phy: eyeq5-eth: " Ian Rogers
2026-11-30 22:54 ` Ian Rogers [this message]
2026-11-30 22:54 ` [PATCH 06/10] phy: qcom: ipq4019-usb: " Ian Rogers
2026-11-30 22:54 ` [PATCH 07/10] phy: renesas: r8a779f0-ether-serdes: " Ian Rogers
2026-11-30 22:54 ` [PATCH 08/10] phy: starfive: jh7110-dphy-rx: " Ian Rogers
2026-11-30 22:54 ` [PATCH 09/10] phy: sunplus: usb2: " Ian Rogers
2026-11-30 22:54 ` [PATCH 10/10] phy: tegra: mphy: " Ian Rogers

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=20261130225428.99361-6-irogers@google.com \
    --to=irogers@google.com \
    --cc=andre.draszik@linaro.org \
    --cc=joychakr@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mani@kernel.org \
    --cc=mnkumar@google.com \
    --cc=nathan@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nkapron@google.com \
    --cc=peter.griffin@linaro.org \
    --cc=rdbabiera@google.com \
    --cc=royluo@google.com \
    --cc=tudor.ambarus@linaro.org \
    --cc=vkoul@kernel.org \
    /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

all inboxes | Powered by JetHome®