From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DE7D606A682 for ; Wed, 2 Dec 2026 05:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0+hJF/4v; dkim=fail reason="signature verification failed" (1024-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=ODtzhAOC DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=yOO9cyJkzr1GLhLxE84xq2e0PaRpUBmfklNJLGfWD6M=; b=0+hJF/4v3DUjqCAzhmpfdXxGLj G4X/Njp1UeHeNF/4NJoxPH5u1HzvF2QsyyQxyay9DHcpr7PCM/QASuIk9gL1gD6xrVZ/DDjHQpHcr F1zrPmLf5e7qKsGWOLvsFBM32i8b3m7L6Out2QMH0O6xjWkOuykQW3mybgQKmXxpIuObksdCuB/g+ UDWtduR2bDNioSReh3zgFp+GaeaN/eTu6unqwp5l07/IMwfCj64MSOBQUBfMvfUIZ55nQUB/hLOUa BxOIp90USQrSU/EdsJQzVW8zxX6Q0pPYqW8Fp9SWGNJO382Df6wuCkORdGdpmVmzto3VXang6MITa ExX8WBPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYdAW-0000000AJz9-17dG; Wed, 02 Dec 2026 05:46:16 +0000 Received: from sender5-op-o11.zoho.com ([165.173.182.11]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYdAT-0000000AJxv-1E0B; Wed, 02 Dec 2026 05:46:14 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1796190348; cv=none; d=zohomail.com; s=zohoarc; b=AYdHg9vtzb9oVK7px9g/bF7w1/bZ1umiRSLseYgdWKBwU/L6r8Wb50FFCBqCpAQ5UKI3YkzVgGIU+9keL5sH7hSvxhXEyDEACMItZVGVtmYLftsM/YHvuYsLGHfrX0n+Ufb85/+kF17rvmlmDzn4jw4XzUss0e5v0zASx4w7GIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796190348; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=NJiuJzkNuWss7+qLhP4f0QTDRzpQXzuQzdbMpVn1VtU=; b=N45BWqpbyR8Dh+FeRyd5BukxAw7ft8RgPh1NkvoXPOsc2s86i7Po9XZ5UGV+SopH5ihVNcCCX0l3d4d0BhaQX/7DvPap9Mdlg/7JLUg1x0fkZSGvEkINy/xxgbPArR1YPLyydIdLnyUW0vGn7UOi0T+7/wTmDitHaIydXH7Fnhc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=sebastian.reichel@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=ODtzhAOCNV9YjlH7jO8pm1PNuaUaRece5AhCwGKi056auRBydLcDAknXLMhR44BFFLQfeSVKnN0uxveHuQblW0dnEWxA0ufnjbgRgRnsez5n6WMkieEhI0sLjkjGHunTEhKHL45NznqjmRjGSuZguPVQGHwXyRllM8RN558Xduw=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=NJiuJzkNuWss7+qLhP4f0QTDRzpQXzuQzdbMpVn1VtU=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 179619034585223.546286848357; Tue, 1 Dec 2026 21:45:45 -0800 (PST) Received: by venus (Postfix, from userid 1000) id 2AB64182057; Wed, 02 Dec 2026 01:28:05 +0100 (CET) Date: Wed, 2 Dec 2026 01:28:05 +0100 From: Sebastian Reichel To: Xia Yan Cc: vkoul@kernel.org, linux-phy@lists.infradead.org, neil.armstrong@linaro.org, mani@kernel.org, heiko@sntech.de, p.zabel@pengutronix.de, ayaka@soulik.info, kishon@kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, yana06070@163.com Subject: Re: [PATCH v2] phy: rockchip-usb: fix reset control leak Message-ID: References: <20261201082805.50160d227cb63d84.patch@cmss.chinamobile.com> X-Archived-By: MIME-Version: 1.0 In-Reply-To: <20261201082805.50160d227cb63d84.patch@cmss.chinamobile.com> X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-0.2.28.1.5.5/296.168.99 X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_214613_374888_87AE4B8A X-CRM114-Status: GOOD ( 22.82 ) X-Spam-Score: -0.5 (/) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7519097439088354336==" Sender: "linux-phy" X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 --===============7519097439088354336== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qcj7qd5d2mbkynpt" Content-Disposition: inline --qcj7qd5d2mbkynpt Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v2] phy: rockchip-usb: fix reset control leak MIME-Version: 1.0 Hi, On Tue, Dec 01, 2026 at 04:28:05PM +0800, Xia Yan wrote: > rockchip_usb_phy_init() acquires a reset control from each PHY child > node but never releases it on probe failure or driver detach. >=20 > The leaked exclusive control prevents a later probe from acquiring > the same reset. Since lookup errors are converted to NULL, subsequent > PHY reset calls silently skip the hardware reset. >=20 > Move the lookup after devm_phy_create() and use devm_reset_control_get() > with the PHY device. Its firmware node is the original PHY child node, > so this keeps the lookup on the same node and releases the control > when the PHY device is released. Keep the existing handling of lookup > errors. >=20 > Found during review of reset-control lifetimes. >=20 > Build-tested the driver object directly on x86_64 with W=3D1 and reset > support enabled. No ARM or hardware testing. >=20 > Fixes: 0f74ab59ce87 ("phy: rockchip-usb: use rockchip_usb_phy_reset to re= set phy during wakeup") > Signed-off-by: Xia Yan devm_reset_control_get() is deprecated in favor of devm_reset_control_get_exclusive(), so it makes sense to directly use the second one. Greetings, -- Sebastian >=20 > --- >=20 > Notes (rockchip-v2-20261201): > Changes in v2: > - Drop the stable Cc as requested by Manivannan Sadhasivam. > - Use devm_reset_control_get() on the PHY device after devm_phy_creat= e(), > replacing the custom reset_control_put() action from v1. > =20 > v1: https://lore.kernel.org/linux-phy/20261115042640.426517-1-yanxia@= cmss.chinamobile.com/ > Review: https://patchwork.kernel.org/comment/27414254/ >=20 > drivers/phy/rockchip/phy-rockchip-usb.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/phy/rockchip/phy-rockchip-usb.c b/drivers/phy/rockch= ip/phy-rockchip-usb.c > index c5a2853a63d3..a3adb0a01b85 100644 > --- a/drivers/phy/rockchip/phy-rockchip-usb.c > +++ b/drivers/phy/rockchip/phy-rockchip-usb.c > @@ -218,10 +218,6 @@ static int rockchip_usb_phy_init(struct rockchip_usb= _phy_base *base, > return -EINVAL; > } > =20 > - rk_phy->reset =3D of_reset_control_get(child, "phy-reset"); > - if (IS_ERR(rk_phy->reset)) > - rk_phy->reset =3D NULL; > - > rk_phy->reg_offset =3D reg_offset; > =20 > rk_phy->clk =3D of_clk_get_by_name(child, "phyclk"); > @@ -285,6 +281,10 @@ static int rockchip_usb_phy_init(struct rockchip_usb= _phy_base *base, > } > phy_set_drvdata(rk_phy->phy, rk_phy); > =20 > + rk_phy->reset =3D devm_reset_control_get(&rk_phy->phy->dev, "phy-reset"= ); > + if (IS_ERR(rk_phy->reset)) > + rk_phy->reset =3D NULL; > + > rk_phy->vbus =3D devm_regulator_get_optional(&rk_phy->phy->dev, "vbus"); > if (IS_ERR(rk_phy->vbus)) { > if (PTR_ERR(rk_phy->vbus) =3D=3D -EPROBE_DEFER) >=20 > base-commit: 9a0dd2a09484e5ba45eb8e6ab58c0effe18703a3 > --=20 > 2.43.0 >=20 >=20 >=20 >=20 --qcj7qd5d2mbkynpt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmsPZhEACgkQ2O7X88g7 +pp6BBAAiZ6c7Zou1j/3Ydx/PTjA9Sp0Dp2q+U5UuJ+0JyqgcLCUHC9gpfhQR0C+ 3UU1l57voUUYr6VVFdhW7owqBlYez5kba01JJVVOWFt7V5wi6g4UPxtcOgf+tUlB j6cbu2mw+DQM0wtDcRC8JvODmS8/UUVrNcleljYVozIkb84hxtlfvkAW3sMukty2 z3r5NWtBe9BXEsgevrCmVqgXFA6xXCSHV43J4VaITJk3+8u9bmt2D/UQHJaI7vfc x3xqPLLy6uaS9XavAlYw8uDwIYdou9xozXAJHLfCZ13138XTWmyp0QU8ONzECBiW 50WSBL6QOSO0Uhfjz3PoUutD5ltPVPlAjCOTGC5PJ/X7qwXs6bHyW1HehCDXULNV kr7ll6vn1hFvijhMycnZ3nNA4czRWQC3DfuDDmKzbVKkAC6dbSfXCFwAC7NfzS1A F+Y/RyZmsl1X/ueDMXymPCQxTEsNFvzsnfL8x6D298Te5CyN69UbV1LYuLve7bgZ H6gWNUt9TmrzQZTMDK1y/3UNGSXOrW2K1hqhlDtKqkh1hBra/6Vq0oSq97G/tnnY TOIxltTAERxj2xc+2A+FIo9sJj2kTqwUTSu07WfQVjqugA9O0aZmwCxm1G/Qd7Bj Y3myxftvpJa9IoVFWna+WOZbpmYozfCqtcaEOTk8JGMpNZbjzIA= =316v -----END PGP SIGNATURE----- --qcj7qd5d2mbkynpt-- --===============7519097439088354336== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy --===============7519097439088354336==--