From nobody Sat Jul 25 01:37:24 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 A9F4241A776; Tue, 21 Jul 2026 06:48:09 +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=1784616492; cv=none; b=Oz23wSyEbQCBfbHi6hgzp0+GHWlLAMSEEzvwJGliZUINhQ4Ikr458E4XCSQ4s4kP+vOI8p39iiD95kvtOhTC6ha54BNxhPya7NVHaki01PgiHMcqNmaC8PB/9rRBQ6067CZ8QH6T+5gGzcg+LtuJN3SG2sFJFHJ4bnH1RIs3y80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784616492; c=relaxed/simple; bh=RA2oV+3c/CvsMB9fvFh/SIvyGMvtkJ06RvzSEbVj9cs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NGhf3ubbmSRulvTCeMM6TadLSkuOJLCuYvmqt72MZmTBJICVJgggSQ664xHRAXDm9Npr62vJBH2Z9US3ga/ITOcyGzXXsM8piQeWD39LvixguVDTKw9eybf5RykumrDcXNwmDF6QCUhruiO0CDbmr6FG4QDOthM6zDIi34vkA6Q= 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: 1e97771284d011f1aa26b74ffac11d73-20260721 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:464eec67-f3a5-4af9-a821-b6825e563397,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:019d5c6ce7d0507cf04a6c64187fe719,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|865|898,TC:nil,Content:0|15|50 ,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,O SA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE: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: 1e97771284d011f1aa26b74ffac11d73-20260721 X-User: pengcan@kylinos.cn Received: from lenovo [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1705813608; Tue, 21 Jul 2026 14:48:02 +0800 From: Can Peng To: vkoul@kernel.org, neil.armstrong@linaro.org, bmasney@redhat.com Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Can Peng , stable@vger.kernel.org Subject: [PATCH v2 1/4] phy: freescale: fsl-samsung-hdmi: Fix runtime PM cleanup Date: Tue, 21 Jul 2026 14:47:49 +0800 Message-ID: <20260721064752.153338-2-pengcan@kylinos.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260721064752.153338-1-pengcan@kylinos.cn> References: <20260721064752.153338-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" fsl_samsung_hdmi_phy_probe() takes a runtime PM reference, marks the device active and enables runtime PM before registering the PHY clock. If phy_clk_register() fails, probe returns without dropping the runtime PM reference or disabling runtime PM. The remove callback only unregisters the clock provider, so runtime PM is also left enabled after a successful probe followed by driver unbind. Check pm_runtime_set_active(), use devm_pm_runtime_enable() so runtime PM is disabled automatically, and drop the initial noresume reference on PM setup and clock registration failures. Fixes: 6ad082bee902 ("phy: freescale: add Samsung HDMI PHY") Cc: stable@vger.kernel.org Signed-off-by: Can Peng --- drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/fre= escale/phy-fsl-samsung-hdmi.c index d010fec15671..e7af4f9c7b20 100644 --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c @@ -665,20 +665,26 @@ static int fsl_samsung_hdmi_phy_probe(struct platform= _device *pdev) "failed to get ref clk\n"); =20 pm_runtime_get_noresume(phy->dev); - pm_runtime_set_active(phy->dev); - pm_runtime_enable(phy->dev); + ret =3D pm_runtime_set_active(phy->dev); + if (ret) + goto pm_put_noidle; + + ret =3D devm_pm_runtime_enable(phy->dev); + if (ret) + goto pm_put_noidle; =20 ret =3D phy_clk_register(phy); if (ret) { dev_err(&pdev->dev, "register clk failed\n"); - goto register_clk_failed; + goto pm_put_noidle; } =20 pm_runtime_put(phy->dev); =20 return 0; =20 -register_clk_failed: +pm_put_noidle: + pm_runtime_put_noidle(phy->dev); return ret; } =20 --=20 2.53.0 From nobody Sat Jul 25 01:37:24 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 BCDB141A776; Tue, 21 Jul 2026 06:48:13 +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=1784616495; cv=none; b=As9s2wAWZSNqWbv6vhqECCWpwb0z7WP5b8ozjne6uNiQjnjifbpxCxiCOM0RArr8vw/AWi09zbhSl4fckpTmWKYOhEWbEhrUgFU4S64u+Gw/CEKIFRhlrItCyBJaQY8kb/5bYgTSJNIfrIoJDusLk7GZ1siNzKB0N0D1gAK5q14= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784616495; c=relaxed/simple; bh=ge+TWb4icNanYC4RtWtGqHS2iaK9/amQnITQLQSQKDQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uwaLe8RWE2tk6wR/wZd8PRNyBwz5e7wSo1+juRENP+NLNXw5jhJRosUCRh1KQHKDWDh7uxlilwmt7JOFzPpd+hhwtUKsWmZ8ClgmkpbrBqCShLJUrjEALsoS4grHQOrnPEn8CszdgFsZhI5VFwhitnI2LFXUW9/k0QwUBeOttN8= 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: 2266606a84d011f1aa26b74ffac11d73-20260721 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:69d927d5-af34-4c5b-a9c0-d4640c077d08,IP:0,U RL:0,TC:0,Content:-25,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:3e7a4f355dedc4bf6a97cc7a7de41efa,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|865|898,TC:nil,Content:0|15|50 ,EDM:5,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OS A:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE: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: 2266606a84d011f1aa26b74ffac11d73-20260721 X-User: pengcan@kylinos.cn Received: from lenovo [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1501765214; Tue, 21 Jul 2026 14:48:09 +0800 From: Can Peng To: vkoul@kernel.org, neil.armstrong@linaro.org, bmasney@redhat.com Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Can Peng , stable@vger.kernel.org Subject: [PATCH v2 2/4] phy: freescale: fsl-samsung-hdmi: Resume device on remove Date: Tue, 21 Jul 2026 14:47:50 +0800 Message-ID: <20260721064752.153338-3-pengcan@kylinos.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260721064752.153338-1-pengcan@kylinos.cn> References: <20260721064752.153338-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" The APB clock is acquired with devm_clk_get_enabled(), so devres will disable and unprepare it when the driver is unbound. Runtime suspend also disables the APB clock. If the device is runtime suspended when the driver is removed, devres will disable the already disabled clock and the clock enable count can underflow. Resume the device in the remove callback before devres runs so the final devres disable is balanced. Drop the runtime PM reference with noidle so the device is not suspended again before devres cleanup. Fixes: 6ad082bee902 ("phy: freescale: add Samsung HDMI PHY") Cc: stable@vger.kernel.org Signed-off-by: Can Peng --- drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/fre= escale/phy-fsl-samsung-hdmi.c index e7af4f9c7b20..5f41890bd134 100644 --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c @@ -690,7 +690,16 @@ static int fsl_samsung_hdmi_phy_probe(struct platform_= device *pdev) =20 static void fsl_samsung_hdmi_phy_remove(struct platform_device *pdev) { + int ret; + + ret =3D pm_runtime_resume_and_get(&pdev->dev); + if (ret < 0) + dev_warn(&pdev->dev, "failed to resume on remove: %d\n", ret); + of_clk_del_provider(pdev->dev.of_node); + + if (!ret) + pm_runtime_put_noidle(&pdev->dev); } =20 static int __maybe_unused fsl_samsung_hdmi_phy_suspend(struct device *dev) --=20 2.53.0 From nobody Sat Jul 25 01:37:24 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 BEE3342883D; Tue, 21 Jul 2026 06:48:16 +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=1784616502; cv=none; b=Seu1nWUltz4kUwDsXwXl/cFX5bW+8lAosLpuUL03GPjgn7Ie1UzWeXCXi6wdNlQCWqne2E7Op9PomdEYuVwzl/fq0ZDi5sNvtK4Ap2yxgrxb7TO1nmybrEdLgcpPyE7T7bWc49BRiqMNm6jE6nSKjZVhARiT9X5j7gluuQxfu3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784616502; c=relaxed/simple; bh=8qtYWFIyqNitdneNzuzz0atY0ca9fmAexYaRFaSFixM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tFe7yZNC/fphtcmRT3pn3zTmC8x4xZ6GwrObqudb9OURC07wJu00PlzTobGwa3U9t5GitXVOf8VJ6bYI1S7OCz2z93kIghXeiEHLGcQufSDvIYoIozFZ5i/imiZ1WXhlvvYP5MdqseXHF0DpEkAFn+3d5oJ9ZYtEiGn2ca+edwY= 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: 246fc4aa84d011f1aa26b74ffac11d73-20260721 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:79d72310-165d-4435-98d6-59e84d751874,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:e7bac3a,CLOUDID:3049064dc9f762a36daa46b2ce985449,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|865|898,TC:nil,Content:0|15|50 ,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,O SA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE: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: 246fc4aa84d011f1aa26b74ffac11d73-20260721 X-User: pengcan@kylinos.cn Received: from lenovo [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 2031218206; Tue, 21 Jul 2026 14:48:12 +0800 From: Can Peng To: vkoul@kernel.org, neil.armstrong@linaro.org, bmasney@redhat.com Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Can Peng , stable@vger.kernel.org Subject: [PATCH v2 3/4] phy: freescale: fsl-samsung-hdmi: Only gate APB clock in runtime PM Date: Tue, 21 Jul 2026 14:47:51 +0800 Message-ID: <20260721064752.153338-4-pengcan@kylinos.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260721064752.153338-1-pengcan@kylinos.cn> References: <20260721064752.153338-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" The APB clock is acquired with devm_clk_get_enabled(), so it remains prepared until devres cleanup and runtime PM only needs to gate or ungate it. Using clk_prepare_enable() from runtime resume is also problematic when the common clock framework runtime-resumes the provider device before calling the PHY clock rate callbacks, because clk_set_rate() is executed while holding the clock prepare lock. Use clk_enable() and clk_disable() in the runtime PM callbacks so the APB clock remains prepared for the lifetime of the device and runtime resume does not re-enter the prepare path. Fixes: 6ad082bee902 ("phy: freescale: add Samsung HDMI PHY") Cc: stable@vger.kernel.org Signed-off-by: Can Peng --- drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/fre= escale/phy-fsl-samsung-hdmi.c index 5f41890bd134..455d03220b72 100644 --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c @@ -706,7 +706,7 @@ static int __maybe_unused fsl_samsung_hdmi_phy_suspend(= struct device *dev) { struct fsl_samsung_hdmi_phy *phy =3D dev_get_drvdata(dev); =20 - clk_disable_unprepare(phy->apbclk); + clk_disable(phy->apbclk); =20 return 0; } @@ -716,7 +716,7 @@ static int __maybe_unused fsl_samsung_hdmi_phy_resume(s= truct device *dev) struct fsl_samsung_hdmi_phy *phy =3D dev_get_drvdata(dev); int ret =3D 0; =20 - ret =3D clk_prepare_enable(phy->apbclk); + ret =3D clk_enable(phy->apbclk); if (ret) { dev_err(phy->dev, "failed to enable apbclk\n"); return ret; --=20 2.53.0 From nobody Sat Jul 25 01:37:24 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 9A1A34195DA; Tue, 21 Jul 2026 06:48:19 +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=1784616501; cv=none; b=KHztTokURhu5Yd+2z0BGumb3ZVU7/JFeX9dJ8z2RR3qFP+e3daTM8BMSwzyJBaNH5mRNX2swss3lwSewg3QxUhZNubO6nQDBaEiXVLB/4qgN7kMLoyvRoTlxmu8KOrXKTgtcqKYHKuD5bZ4vCqhk0RmQ2i8c3EPodrHXbHz/01w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784616501; c=relaxed/simple; bh=EVm5nGLtaQ9F8VmMiOVvm3h/eHTfiwrZ95TDWNVJrWc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DX0sGm66ExrNicL7MKz/qSm4m9Vfk/2gK83fTImqo1Otxm58U+fNxsYWR5oSXFu8UxijhHgWZgdw8aYRLRAjZPsREOLkuRfVAZT4yT0ra9a2uEMoVDMyL3Pt3eGzsJLeP7/14fLzGG+3VyhaQc9hB6uZH+6qmtXVAT7z0vydnow= 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: 2622954884d011f1aa26b74ffac11d73-20260721 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:0266ae76-5ceb-416f-83ef-0ac66190f1b9,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:430a820fc86c611bc906720702d2c2ae,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|865|898,TC:nil,Content:0|15|50 ,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,O SA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE: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: 2622954884d011f1aa26b74ffac11d73-20260721 X-User: pengcan@kylinos.cn Received: from lenovo [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 973892165; Tue, 21 Jul 2026 14:48:15 +0800 From: Can Peng To: vkoul@kernel.org, neil.armstrong@linaro.org, bmasney@redhat.com Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Can Peng , stable@vger.kernel.org Subject: [PATCH v2 4/4] phy: freescale: fsl-samsung-hdmi: Disable APB clock on resume failure Date: Tue, 21 Jul 2026 14:47:52 +0800 Message-ID: <20260721064752.153338-5-pengcan@kylinos.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260721064752.153338-1-pengcan@kylinos.cn> References: <20260721064752.153338-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" fsl_samsung_hdmi_phy_resume() enables apbclk and then reprograms the PHY when a previous clock configuration is available. If the hardware configuration fails, the function returns the error with apbclk still enabled. Disable apbclk on the failure path so the clock enable count remains balanced. Fixes: 6ad082bee902 ("phy: freescale: add Samsung HDMI PHY") Cc: stable@vger.kernel.org Signed-off-by: Can Peng --- drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/fre= escale/phy-fsl-samsung-hdmi.c index 455d03220b72..bb1aa1977065 100644 --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c @@ -722,8 +722,11 @@ static int __maybe_unused fsl_samsung_hdmi_phy_resume(= struct device *dev) return ret; } =20 - if (phy->cur_cfg) + if (phy->cur_cfg) { ret =3D fsl_samsung_hdmi_phy_configure(phy, phy->cur_cfg); + if (ret) + clk_disable(phy->apbclk); + } =20 return ret; =20 --=20 2.53.0