* [PATCH] phy: hisilicon: fix UTMI reset leaks in INNO USB2 PHY
@ 2026-11-11 8:59 Xia Yan
2026-11-11 9:15 ` Philipp Zabel
0 siblings, 1 reply; 2+ messages in thread
From: Xia Yan @ 2026-11-11 8:59 UTC (permalink / raw)
To: Vinod Koul, linux-phy
Cc: Neil Armstrong, Manivannan Sadhasivam, Philipp Zabel,
Pengcheng Li, Jiancheng Xue, Shawn Guo, Shawn Guo,
Kishon Vijay Abraham I, linux-kernel, stable, yana06070
hisi_inno_phy_probe() acquires an exclusive UTMI reset control for each
child node but never releases it on probe failure or driver detach.
The leaked controls remain acquired, so a later probe can fail with
-EBUSY when requesting the same resets.
Register a devres action after each successful lookup to release the
control on probe failure and detach.
Found during source review of reset-control lifetimes.
Build-tested the driver object on x86_64 with W=1 and reset support
enabled. No hardware testing.
Fixes: ba8b0ee81fbb ("phy: add inno-usb2-phy driver for hi3798cv200 SoC")
Cc: stable@vger.kernel.org # needs of_node_put(child) on <= 6.6
Signed-off-by: Xia Yan <yanxia@cmss.chinamobile.com>
---
drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c b/drivers/phy/hisilicon/phy-hisi-inno-usb2.c
index c843923252aa..9bf207e3e692 100644
--- a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c
+++ b/drivers/phy/hisilicon/phy-hisi-inno-usb2.c
@@ -132,6 +132,11 @@ static const struct phy_ops hisi_inno_phy_ops = {
.owner = THIS_MODULE,
};
+static void hisi_inno_phy_reset_put(void *data)
+{
+ reset_control_put(data);
+}
+
static int hisi_inno_phy_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -169,6 +174,10 @@ static int hisi_inno_phy_probe(struct platform_device *pdev)
if (IS_ERR(rst))
return PTR_ERR(rst);
+ ret = devm_add_action_or_reset(dev, hisi_inno_phy_reset_put, rst);
+ if (ret)
+ return ret;
+
priv->ports[i].utmi_rst = rst;
priv->ports[i].priv = priv;
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] phy: hisilicon: fix UTMI reset leaks in INNO USB2 PHY
2026-11-11 8:59 [PATCH] phy: hisilicon: fix UTMI reset leaks in INNO USB2 PHY Xia Yan
@ 2026-11-11 9:15 ` Philipp Zabel
0 siblings, 0 replies; 2+ messages in thread
From: Philipp Zabel @ 2026-11-11 9:15 UTC (permalink / raw)
To: Xia Yan, Vinod Koul, linux-phy
Cc: Neil Armstrong, Manivannan Sadhasivam, Pengcheng Li,
Jiancheng Xue, Shawn Guo, Shawn Guo, Kishon Vijay Abraham I,
linux-kernel, stable, yana06070
On Mi, 2026-11-11 at 16:59 +0800, Xia Yan wrote:
> hisi_inno_phy_probe() acquires an exclusive UTMI reset control for each
> child node but never releases it on probe failure or driver detach.
> The leaked controls remain acquired, so a later probe can fail with
> -EBUSY when requesting the same resets.
>
> Register a devres action after each successful lookup to release the
> control on probe failure and detach.
>
> Found during source review of reset-control lifetimes.
>
> Build-tested the driver object on x86_64 with W=1 and reset support
> enabled. No hardware testing.
>
> Fixes: ba8b0ee81fbb ("phy: add inno-usb2-phy driver for hi3798cv200 SoC")
> Cc: stable@vger.kernel.org # needs of_node_put(child) on <= 6.6
> Signed-off-by: Xia Yan <yanxia@cmss.chinamobile.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
It looks like an equivalent to devm_get_clk_from_child() for reset
controls could be useful.
regards
Philipp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-11 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 8:59 [PATCH] phy: hisilicon: fix UTMI reset leaks in INNO USB2 PHY Xia Yan
2026-11-11 9:15 ` Philipp Zabel
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®