From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 07E091A5B8A; Tue, 22 Apr 2025 02:15:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745288158; cv=none; b=fS/sYbLNrXCdK1pxb3AcJf87UtxzMGxLmUKmmnvGekH+pcFQlZ6LULUZPLyqrIqkJe6eDTU+i6S8Kc2S6x9MHz3kpiRsznDWri2bxSR1i0p29Bna3Cq4JQ88H/5nfTcUZTqYIKBDVBxa28FHn9HGeCLAL5R06PgqQviLVkcfYS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745288158; c=relaxed/simple; bh=0jyzO56/WanhY2K37sHk/W2hJ2Y6+n3AhxhJV5KnxHo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WwiO6rP5TcZJvbcSSM8wQjjXmcTNzBLvywYSE8Ba2olVwqcUbGhd+TO1heIVuKiQPKwysOjfz5m0cwShmjFgdvxuSYJBomz6hGfKXX4FEI9N8wt6k/NDPYTEHUoLoZFgcOlcJlg9TqaQdeokFGFw/TxbSWeQlfnbLVgEtPb7QQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eTNqOL0y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eTNqOL0y" 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> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.14.3 Content-Transfer-Encoding: 8bit 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