From e318d3196cbbb1f20ebe8c482502d77de2730377 Mon Sep 17 00:00:00 2001 From: Mallikarjun Kasoju Date: Mon, 17 Jun 2024 17:49:13 +0000 Subject: [PATCH] scsi: ufs: Do not enable pllrefe clk in T264 pllrefe is not used in T264 ufs. Do not enable it. Bug 4199271 Change-Id: I0d940b66e1a30ac2b097c07a1ba470ddc2f41de4 --- drivers/scsi/ufs/ufs-tegra-common.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/ufs/ufs-tegra-common.c b/drivers/scsi/ufs/ufs-tegra-common.c index 1c33329b..ca8c5cb2 100644 --- a/drivers/scsi/ufs/ufs-tegra-common.c +++ b/drivers/scsi/ufs/ufs-tegra-common.c @@ -561,22 +561,19 @@ static int ufs_tegra_enable_mphylane_clks(struct ufs_tegra_host *host) if (host->is_lane_clks_enabled) return 0; - err = clk_prepare_enable(host->pllrefe_clk); - if (err < 0) - goto out; - - if (host->soc->chip_id == TEGRA264) { + if (host->soc->chip_id == TEGRA264) err = ufs_tegra_host_clk_enable(dev, "mphy_l0_uphy_tx_fifo", host->mphy_l0_uphy_tx_fifo); - if (err) - goto disable_mphy_core_pll_fixed; - } + else + err = clk_prepare_enable(host->pllrefe_clk); + if (err) + goto out; err = ufs_tegra_host_clk_enable(dev, "mphy_core_pll_fixed", host->mphy_core_pll_fixed); if (err) - goto disable_mphy_l0_uphy_tx_fifo; + goto disable_mphy_clk; err = ufs_tegra_host_clk_enable(dev, "mphy_l0_tx_symb", host->mphy_l0_tx_symb); @@ -641,11 +638,11 @@ disable_tx_1mhz_ref: clk_disable_unprepare(host->mphy_l0_tx_symb); disable_l0_tx_symb: clk_disable_unprepare(host->mphy_core_pll_fixed); -disable_mphy_l0_uphy_tx_fifo: +disable_mphy_clk: if (host->soc->chip_id == TEGRA264) clk_disable_unprepare(host->mphy_l0_uphy_tx_fifo); -disable_mphy_core_pll_fixed: - clk_disable_unprepare(host->pllrefe_clk); + else + clk_disable_unprepare(host->pllrefe_clk); out: return err; } @@ -661,9 +658,7 @@ static int ufs_tegra_init_mphy_lane_clks(struct ufs_tegra_host *host) "pllrefe_vcoout", &host->pllrefe_clk); if (err) goto out; - } - - if (host->soc->chip_id == TEGRA264) { + } else { err = ufs_tegra_host_clk_get(dev, "mphy_l0_uphy_tx_fifo", &host->mphy_l0_uphy_tx_fifo); if (err) @@ -2146,8 +2141,10 @@ static int ufs_tegra_init(struct ufs_hba *hba) goto enable_ufs_clk; err = ufs_tegra_init_mphy_lane_clks(ufs_tegra); - if (err) + if (err) { + dev_err(dev, "mphy clk init failed. Err %d\n", err); goto out_host_free; + } err = ufs_tegra_init_uphy_pll3(ufs_tegra); if (err) goto out_host_free;