From nobody Sat Jul 25 04:30:37 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30B3D37AA97; Sat, 18 Jul 2026 09:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784365303; cv=none; b=LVUXCfCAWiGtbyBz9WCUQnA/UdKUuUYjW+xaz73Ht1/k9goyy4+PnIfWGj3EQtXGv8jvEiYt9gm+N3BhK37nZOA3zAvOPnXk9eZDHVGWY7p7zWIOv3+SmQyOd+EmvlgYCCrMKsWhDsn2Rfbgi7fLV+KDpIjXtTJEYXRtfY9a6No= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784365303; c=relaxed/simple; bh=qzWdfFHM4276VR80Poqhbwj/zpuNWpXwG6JIORxroEQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UamBHJbwjp7mWMFapC+tx/ywlSk2sUsA4lgjmm4of94MSmo+FZx/r2d4/sXkgF5cyGidl5qPtAv0D3M4S3v9mcNg1dBsg+kyBzoAwa+7NCrSDRdN1oIaKM2gc5mblrbaCkTnV4DtdhO7A8l9hfUdAWTX+ODZk2Q1prt6S2srzg0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 468ba19e828711f1aa26b74ffac11d73-20260718 X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME, HR_CTE_8B HR_CTT_MISS, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_NAME HR_SJ_DIGIT_LEN, HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM HR_SJ_PHRASE, HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT, HR_TO_DOMAIN_COUNT HR_TO_NO_NAME, IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED, SA_TRUSTED SA_EXISTED, SN_TRUSTED, SN_EXISTED, SPF_NOPASS, DKIM_NOPASS DMARC_NOPASS, CIE_GOOD, CIE_GOOD_SPF, GTI_FG_BS, GTI_RG_INFO GTI_C_BU, AMN_GOOD, ABX_MISS_RDNS X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:74026dc9-ed6e-4377-9713-549c45f3e9c4,IP:15, URL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-10 X-CID-INFO: VERSION:1.3.12,REQID:74026dc9-ed6e-4377-9713-549c45f3e9c4,IP:15,UR L:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-10 X-CID-META: VersionHash:e7bac3a,CLOUDID:b09afbe85e233be6cea232d369eb7bda,BulkI D:260718151802GOA6MZ3Q,BulkQuantity:1,Recheck:0,SF:10|38|66|78|81|82|102|1 27|865|898,TC:nil,Content:0|15|50,EDM:-3,IP:-2,URL:0,File:nil,RT:nil,Bulk: 41,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BR E:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 468ba19e828711f1aa26b74ffac11d73-20260718 X-User: pengcan@kylinos.cn Received: from lenovo [(116.128.244.171)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1296818041; Sat, 18 Jul 2026 17:01:34 +0800 From: Can Peng To: jack.zhu@starfivetech.com, changhuang.liang@starfivetech.com, keith.zhao@starfivetech.com, vkoul@kernel.org, neil.armstrong@linaro.org Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Can Peng , stable@vger.kernel.org Subject: [PATCH v2 1/2] phy: starfive: Fix runtime PM cleanup in JH7110 DPHY TX probe Date: Sat, 18 Jul 2026 17:00:53 +0800 Message-ID: <20260718090054.444513-2-pengcan@kylinos.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260718090054.444513-1-pengcan@kylinos.cn> References: <20260718090054.444513-1-pengcan@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" stf_dphy_probe() enables runtime PM before getting the clock and reset controls, creating the PHY and registering the PHY provider. If any of those steps fails, probe returns with runtime PM still enabled. The driver also has no remove callback, so runtime PM is left enabled on driver unbind after a successful probe. Use devm_pm_runtime_enable() so runtime PM is disabled automatically on later probe failures and on driver unbind. Fixes: d3ab79553308 ("phy: starfive: Add mipi dphy tx support") Cc: stable@vger.kernel.org Signed-off-by: Can Peng --- drivers/phy/starfive/phy-jh7110-dphy-tx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/phy/starfive/phy-jh7110-dphy-tx.c b/drivers/phy/starfi= ve/phy-jh7110-dphy-tx.c index c64d1c91b130..181491a93807 100644 --- a/drivers/phy/starfive/phy-jh7110-dphy-tx.c +++ b/drivers/phy/starfive/phy-jh7110-dphy-tx.c @@ -392,6 +392,7 @@ static int stf_dphy_probe(struct platform_device *pdev) { struct phy_provider *phy_provider; struct stf_dphy *dphy; + int ret; =20 dphy =3D devm_kzalloc(&pdev->dev, sizeof(*dphy), GFP_KERNEL); if (!dphy) @@ -406,7 +407,9 @@ static int stf_dphy_probe(struct platform_device *pdev) if (IS_ERR(dphy->topsys)) return PTR_ERR(dphy->topsys); =20 - pm_runtime_enable(&pdev->dev); + ret =3D devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; =20 dphy->txesc_clk =3D devm_clk_get(&pdev->dev, "txesc"); if (IS_ERR(dphy->txesc_clk)) --=20 2.53.0 From nobody Sat Jul 25 04:30:37 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 916EB369D4E; Sat, 18 Jul 2026 09:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784365308; cv=none; b=sfIC+AVzln7y0PkBCkqOlOCbgtPiKs1bM5KbUI+cBfqq4UQJ+vBxTjkApXkULH15PAX42xt48XWbY8HgyL4QVUOi5xYVShj63t0lUuIriz92FRp1pCGnL/DhvftwHMp+IQivj4LRKYEtOE1qsXM3oMNzKHiXFqOkB9BX3srX9Jk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784365308; c=relaxed/simple; bh=mw2KCmxx2THu2pzDTytabtpo8FD5E8alO2ADZTXnZS4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FUzyzN9ixDAiR7VPpOwjDvN//Qv9e0L/0wJzJlS2uCefkFjzFHyCMH2pKG6/ZEjUFLg5R5V2LJTzeatkgQGLCyJA+2BlEAxxMj468+TfXHkK6NVmAqxC7bpumGNpBzZKri82h9CHeGulM7l2Ci6SBTUKhK9d0TwtWuKLwU9Pzdo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 4b630522828711f1aa26b74ffac11d73-20260718 X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME, HR_CTE_8B HR_CTT_MISS, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_NAME HR_SJ_DIGIT_LEN, HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM HR_SJ_PHRASE, HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT, HR_TO_DOMAIN_COUNT HR_TO_NO_NAME, IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED, SA_TRUSTED SA_EXISTED, SN_TRUSTED, SN_EXISTED, SPF_NOPASS, DKIM_NOPASS DMARC_NOPASS, CIE_GOOD, CIE_GOOD_SPF, GTI_FG_BS, GTI_RG_INFO GTI_C_BU, AMN_GOOD, ABX_MISS_RDNS X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:19d82bbc-4137-4e01-918a-76a0fbebf785,IP:15, URL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-10 X-CID-INFO: VERSION:1.3.12,REQID:19d82bbc-4137-4e01-918a-76a0fbebf785,IP:15,UR L:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-10 X-CID-META: VersionHash:e7bac3a,CLOUDID:032a5c4608e3703a8c6104dfa0d4334d,BulkI D:260718170142YGQSCQMF,BulkQuantity:0,Recheck:0,SF:10|38|66|78|81|82|102|1 27|865|898,TC:nil,Content:0|15|50,EDM:-3,IP:-2,URL:0,File:nil,RT:nil,Bulk: nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,B RE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 4b630522828711f1aa26b74ffac11d73-20260718 X-User: pengcan@kylinos.cn Received: from lenovo [(116.128.244.171)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1453054753; Sat, 18 Jul 2026 17:01:42 +0800 From: Can Peng To: jack.zhu@starfivetech.com, changhuang.liang@starfivetech.com, keith.zhao@starfivetech.com, vkoul@kernel.org, neil.armstrong@linaro.org Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Can Peng , stable@vger.kernel.org Subject: [PATCH v2 2/2] phy: starfive: Fix runtime PM cleanup in JH7110 DPHY RX probe Date: Sat, 18 Jul 2026 17:00:54 +0800 Message-ID: <20260718090054.444513-3-pengcan@kylinos.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260718090054.444513-1-pengcan@kylinos.cn> References: <20260718090054.444513-1-pengcan@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" stf_dphy_probe() enables runtime PM before registering the PHY provider. If devm_of_phy_provider_register() fails, probe returns with runtime PM still enabled. The driver also has no remove callback, so runtime PM is left enabled on driver unbind after a successful probe. Use devm_pm_runtime_enable() so runtime PM is disabled automatically on later probe failures and on driver unbind. Fixes: f8aa660841bc ("phy: starfive: Add mipi dphy rx support") Cc: stable@vger.kernel.org Signed-off-by: Can Peng --- drivers/phy/starfive/phy-jh7110-dphy-rx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/phy/starfive/phy-jh7110-dphy-rx.c b/drivers/phy/starfi= ve/phy-jh7110-dphy-rx.c index 0b039e1f71c5..d06f21ad6332 100644 --- a/drivers/phy/starfive/phy-jh7110-dphy-rx.c +++ b/drivers/phy/starfive/phy-jh7110-dphy-rx.c @@ -150,6 +150,7 @@ static int stf_dphy_probe(struct platform_device *pdev) { struct phy_provider *phy_provider; struct stf_dphy *dphy; + int ret; =20 dphy =3D devm_kzalloc(&pdev->dev, sizeof(*dphy), GFP_KERNEL); if (!dphy) @@ -190,7 +191,9 @@ static int stf_dphy_probe(struct platform_device *pdev) return PTR_ERR(dphy->phy); } =20 - pm_runtime_enable(&pdev->dev); + ret =3D devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; =20 phy_set_drvdata(dphy->phy, dphy); phy_provider =3D devm_of_phy_provider_register(&pdev->dev, --=20 2.53.0