Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1647047rwb; Sun, 14 Aug 2022 08:40:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6gshjQOwvvi9x4SZsPXoT34ZJj1L9UTsdaQxO7cAVE4Ur1jGkMxqIeXGhENncl6HQKUvqV X-Received: by 2002:a17:907:b04:b0:730:b0d7:eeea with SMTP id h4-20020a1709070b0400b00730b0d7eeeamr8216707ejl.173.1660491604462; Sun, 14 Aug 2022 08:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660491604; cv=none; d=google.com; s=arc-20160816; b=Yjuk5zUTmXqOyUSoPgWmDG6cQiIwZ5sfO3+eaz0lF7EartLxzbb5P5C1ehydb0T1S1 njSAAWYRhHvxHMuwTbhUGBRL0c5M5uA16bI7yX1Bzu6Kktfhyz/Fvq285NaM3yk6dgM0 qaNfCSU++R5IZ9eqarhkwMPQZNWgdDTH7m8c3GdPe4jgxL8s10BCC15NaprlaBDAPKrl Dhfc5/jWoSyCB3LMICMjdGPhjy0qHROYA4ySEgfS6LDqSKD6w2RuVx7I9JhE949ueKfZ RStewKS48/gP2HsWcHKz+q8/GqfYAOjmNaGOhLLkuTs56V3sXXatL7dwwGzFTlWnh35Q X0Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cQnmyLqi9wNJWCcYJdH3fjG2W6X53VwRABg5J/hYQNs=; b=madiPoafP3xx3y0+z0jPDgAu+3iCatD1cFqS/5Ym1RGm4vmgmfRVnKzmc1MG4Ai8pR d+1/T2omnjY5ChISHvny+p2PEmTTwsWyS7LDwDzW3OtDfBNkQ7tFzgLpdneYw8QiH+vj CpN4DnNRSmbMLjyB2S06IH8oy9dyffQ0sOBne9Znmg4NB++gf5nfF6YEXW4PWGQStwoX PJOFadSCevNpT8pHyNCDGQBF7S0Vr0pT0i2UydlJyXzSGQJqMQzdPnobDsk5lKSyELGf EuMrUbCCsWXzfCPzsSq2ZrZaP/VcgNxm7R0b6H8zsAnTvP7FsHh5S1qjD+jnJNseU7LM jp0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hNNDrRCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a056402269200b0043d68d2cf50si6447507edd.77.2022.08.14.08.39.38; Sun, 14 Aug 2022 08:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hNNDrRCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240556AbiHNPbk (ORCPT + 99 others); Sun, 14 Aug 2022 11:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240362AbiHNPa4 (ORCPT ); Sun, 14 Aug 2022 11:30:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AA3D1A826; Sun, 14 Aug 2022 08:29:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1479460C41; Sun, 14 Aug 2022 15:29:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DFB2C433D6; Sun, 14 Aug 2022 15:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660490971; bh=qt61o7YewrXnnLL9ocm5HDs/bnCH6kg7cv3t1Ds3lw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hNNDrRCxBQIok7pc0B2BtKN5py0ml1fNBjXHenOw1KbwjmkXG0ygxTZfC5Li6wAWj GO4Gpr4SayO+Bq7eM7s/8fGxtdUQWGKZ+38+MA9Mi0lzj744IjuDaHhnHReTgY1phE H01+WJac0OSGq34E8QzVhyQdVb2hIpGzbDq6qOquhx/4Sf4baaJQT9vTeF2BUY6EMJ 4jG6EI6P/dzNK4JbRIbkYtbMJvEDrYa3rI6AigALbR+6IgIqR4R4eTfNmMEoI31/k8 ayczk4roQ4ZfRDtMQvi2vAFyzRp14sJBckV41bGMGADwBzxW5ilWufRa4/ZZPfcEAU eGw6fgjfgLxWg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chanho Park , Krzysztof Kozlowski , "Martin K . Petersen" , Sasha Levin , jejb@linux.ibm.com, alim.akhtar@samsung.com, bvanassche@acm.org, beanhuo@micron.com, peter.wang@mediatek.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH AUTOSEL 5.19 38/64] scsi: ufs: ufs-exynos: Change ufs phy control sequence Date: Sun, 14 Aug 2022 11:24:11 -0400 Message-Id: <20220814152437.2374207-38-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220814152437.2374207-1-sashal@kernel.org> References: <20220814152437.2374207-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chanho Park [ Upstream commit 3d73b200f9893d8f5ba5d105e8b69c8d16744fa2 ] Since commit 1599069a62c6 ("phy: core: Warn when phy_power_on is called before phy_init"), the following warning has been reported: phy_power_on was called before phy_init To address this, we need to remove phy_power_on from exynos_ufs_phy_init() and move it after phy_init. phy_power_off and phy_exit are also necessary in exynos_ufs_remove(). Link: https://lore.kernel.org/r/20220706020255.151177-4-chanho61.park@samsung.com Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanho Park Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/ufs/host/ufs-exynos.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index a81d8cbd542f..25995667c832 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -910,9 +910,13 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs) if (ret) { dev_err(hba->dev, "%s: phy init failed, ret = %d\n", __func__, ret); - goto out_exit_phy; + return ret; } + ret = phy_power_on(generic_phy); + if (ret) + goto out_exit_phy; + return 0; out_exit_phy: @@ -1174,10 +1178,6 @@ static int exynos_ufs_init(struct ufs_hba *hba) goto out; } - ret = phy_power_on(ufs->phy); - if (ret) - goto phy_off; - exynos_ufs_priv_init(hba, ufs); if (ufs->drv_data->drv_init) { @@ -1195,8 +1195,6 @@ static int exynos_ufs_init(struct ufs_hba *hba) exynos_ufs_config_smu(ufs); return 0; -phy_off: - phy_power_off(ufs->phy); out: hba->priv = NULL; return ret; @@ -1514,9 +1512,14 @@ static int exynos_ufs_probe(struct platform_device *pdev) static int exynos_ufs_remove(struct platform_device *pdev) { struct ufs_hba *hba = platform_get_drvdata(pdev); + struct exynos_ufs *ufs = ufshcd_get_variant(hba); pm_runtime_get_sync(&(pdev)->dev); ufshcd_remove(hba); + + phy_power_off(ufs->phy); + phy_exit(ufs->phy); + return 0; } -- 2.35.1