[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250319-exynos-ufs-stability-fixes-v2-4-96722cc2ba1b@linaro.org>
Date: Wed, 19 Mar 2025 15:30:21 +0000
From: Peter Griffin <peter.griffin@...aro.org>
To: Alim Akhtar <alim.akhtar@...sung.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Chanho Park <chanho61.park@...sung.com>
Cc: linux-scsi@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Eric Biggers <ebiggers@...nel.org>, Bart Van Assche <bvanassche@....org>,
willmcvicker@...gle.com, kernel-team@...roid.com, tudor.ambarus@...aro.org,
andre.draszik@...aro.org, Peter Griffin <peter.griffin@...aro.org>,
stable@...r.kernel.org
Subject: [PATCH v2 4/7] scsi: ufs: exynos: ensure consistent phy reference
counts
ufshcd_link_startup() can call ufshcd_vops_link_startup_notify()
multiple times when retrying. This causes the phy reference count
to keep increasing and the phy to not properly re-initialize.
If the phy has already been previously powered on, first issue a
phy_power_off() and phy_exit(), before re-initializing and powering
on again.
Signed-off-by: Peter Griffin <peter.griffin@...aro.org>
Fixes: 3d73b200f989 ("scsi: ufs: ufs-exynos: Change ufs phy control sequence")
Cc: stable@...r.kernel.org
---
drivers/ufs/host/ufs-exynos.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 61b03e493cc1ddba17179a9f22e5b59ece02458b..34e16e198830d086cbdb6cb0b027ca92687b2ae6 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -962,6 +962,12 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs)
}
phy_set_bus_width(generic_phy, ufs->avail_ln_rx);
+
+ if (generic_phy->power_count) {
+ phy_power_off(generic_phy);
+ phy_exit(generic_phy);
+ }
+
ret = phy_init(generic_phy);
if (ret) {
dev_err(hba->dev, "%s: phy init failed, ret = %d\n",
--
2.49.0.rc1.451.g8f38331e32-goog
Powered by blists - more mailing lists