From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C307C369AB for ; Tue, 22 Apr 2025 02:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=a1XZRDeMKMCjMDLnD5k5ZZsTmf1blB1ntyuEtw01ff0=; b=0KWA/rjSorgmTOsaJa4P1WzLKN LxQPE0tKvFSYgjS5bUTp6s+oHWMGizGL3gQ2hvk1c0EZ6UGh+tCqM1H7XjJDOemq9RWs3ef+AXbIn jYFVEBOWndMan97ETWmCtg9+M07jMH2tLXKJcRLsR7rWWu0gm+pgmwInbfkchGUUFqV3snLRlKKeY jrewUiWZP6MOnS7juqTPvyCF5vEBC38L37X1tM8vYPXRDTyBmMu93tsXu2jfuj4PFKlnrNk6QcxbA PIDjUl6HIrHVKIzp7J3QI0m2tDnuZA/YCDuO2gPzbXRFp4SrGs1cbAMwGHiRW/se0PP516E9H1kTA Ri9W0L6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u73HI-00000005ag0-1Tbr; Tue, 22 Apr 2025 02:22:28 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u73B0-00000005YyL-3h3Y for linux-arm-kernel@lists.infradead.org; Tue, 22 Apr 2025 02:16:00 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id F1AA6A4BF30; Tue, 22 Apr 2025 02:10:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BEE3C4CEE4; Tue, 22 Apr 2025 02:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745288157; bh=0jyzO56/WanhY2K37sHk/W2hJ2Y6+n3AhxhJV5KnxHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eTNqOL0ySfIgEKHs86e84cY8ivlFpaTFcZU2jMFjSITN5Dm5XbhDK9u5BcQiHVDE2 oYCoPF0I+z5VW32tC4ST2VCUmlySR+FXLHtojo0A+wK87SebXy6za2sBpggTwlMIV6 Up++qYqonBV2PNaD1rZCilhjii5MJdAjw6CKVqXVgel9sMeo973DYSbpoItEdi8PGb OQLqxEoYbHnC/gFNyQjMfSO9AgJ3mt7kLfySrK0cQYqQvhlMey+MBeMIJW+YCnDr46 FTUxGZE3bitnZ+SwS7/6SK41vL4nJWv4BYdvu3qcntP8GPWz/s7c4sWhI9OzARA3ku vcXt+eTndn6gg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Peter Griffin , Bart Van Assche , "Martin K . Petersen" , Sasha Levin , alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, krzk@kernel.org, linux-scsi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 6.14 04/30] scsi: ufs: exynos: Move phy calls to .exit() callback Date: Mon, 21 Apr 2025 22:15:24 -0400 Message-Id: <20250422021550.1940809-4-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250422021550.1940809-1-sashal@kernel.org> References: <20250422021550.1940809-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.14.3 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250421_191559_002239_B35D0B7C X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peter Griffin [ Upstream commit 67e4085015c33bf2fb552af1f171c58b81ef0616 ] ufshcd_pltfrm_remove() calls ufshcd_remove(hba) which in turn calls ufshcd_hba_exit(). By moving the phy_power_off() and phy_exit() calls to the newly created .exit callback they get called by ufshcd_variant_hba_exit() before ufshcd_hba_exit() turns off the regulators. This is also similar flow to the ufs-qcom driver. Signed-off-by: Peter Griffin Link: https://lore.kernel.org/r/20250319-exynos-ufs-stability-fixes-v2-6-96722cc2ba1b@linaro.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/ufs/host/ufs-exynos.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index b441178089cdd..e5c101480f09d 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1501,6 +1501,14 @@ static int exynos_ufs_init(struct ufs_hba *hba) return ret; } +static void exynos_ufs_exit(struct ufs_hba *hba) +{ + struct exynos_ufs *ufs = ufshcd_get_variant(hba); + + phy_power_off(ufs->phy); + phy_exit(ufs->phy); +} + static int exynos_ufs_host_reset(struct ufs_hba *hba) { struct exynos_ufs *ufs = ufshcd_get_variant(hba); @@ -1956,6 +1964,7 @@ static int gs101_ufs_pre_pwr_change(struct exynos_ufs *ufs, static const struct ufs_hba_variant_ops ufs_hba_exynos_ops = { .name = "exynos_ufs", .init = exynos_ufs_init, + .exit = exynos_ufs_exit, .hce_enable_notify = exynos_ufs_hce_enable_notify, .link_startup_notify = exynos_ufs_link_startup_notify, .pwr_change_notify = exynos_ufs_pwr_change_notify, @@ -1994,13 +2003,7 @@ static int exynos_ufs_probe(struct platform_device *pdev) static void exynos_ufs_remove(struct platform_device *pdev) { - struct ufs_hba *hba = platform_get_drvdata(pdev); - struct exynos_ufs *ufs = ufshcd_get_variant(hba); - ufshcd_pltfrm_remove(pdev); - - phy_power_off(ufs->phy); - phy_exit(ufs->phy); } static struct exynos_ufs_uic_attr exynos7_uic_attr = { -- 2.39.5