From fee74728d30721754ed2005d15f2ea66ffa8c1be Mon Sep 17 00:00:00 2001 From: Mallikarjun Kasoju Date: Wed, 22 May 2024 18:06:45 +0000 Subject: [PATCH] ufs: Do not use TX_MUX_SYMB_DIV and TX_MUX_SYMB_DIV TEGRA234_CLK_MPHY_L0_TX_MUX_SYMB_DIV and TEGRA234_CLK_MPHY_L0_RX_MUX_SYMB_DIV clock are only for T23x chips. Kept condition accordingly to use them in T23x chips only. Bug 4199271 Signed-off-by: Mallikarjun Kasoju Change-Id: I228b9da7c92628e3dfce82f571b5aaf0f73427a5 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3143258 Reviewed-by: Bitan Biswas GVS: buildbot_gerritrpt Reviewed-by: Bibek Basu Reviewed-by: Andy Sobczyk --- drivers/scsi/ufs/ufs-tegra-common.c | 50 +++++++++++++++++------------ 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/ufs/ufs-tegra-common.c b/drivers/scsi/ufs/ufs-tegra-common.c index 1cda2920..b4071b37 100644 --- a/drivers/scsi/ufs/ufs-tegra-common.c +++ b/drivers/scsi/ufs/ufs-tegra-common.c @@ -379,13 +379,15 @@ static int ufs_tegra_enable_t234_mphy_clocks(struct ufs_tegra_host *host) goto out; } - err = clk_set_parent(host->mphy_tx_hs_mux_symb_div, host->mphy_tx_hs_symb_div); - if (err) { - if (err != -EPROBE_DEFER) - dev_err(dev, - "%s mphy_tx_hs_mux_symb_div set parent failed %d\n", - __func__, err); - goto out; + if (host->soc->chip_id != TEGRA264) { + err = clk_set_parent(host->mphy_tx_hs_mux_symb_div, host->mphy_tx_hs_symb_div); + if (err) { + if (err != -EPROBE_DEFER) + dev_err(dev, + "%s mphy_tx_hs_mux_symb_div set parent failed %d\n", + __func__, err); + goto out; + } } err = ufs_tegra_host_clk_enable(dev, "mphy_tx_hs_symb_div", @@ -407,12 +409,14 @@ static int ufs_tegra_enable_t234_mphy_clocks(struct ufs_tegra_host *host) goto disable_mphy_tx_hs_symb_div; } - err = clk_set_parent(host->mphy_rx_hs_mux_symb_div, host->mphy_rx_hs_symb_div); - if (err) { - dev_err(dev, - "%s: mphy_rx_hs_symb_div set parent failed %d\n", - __func__, err); - goto disable_mphy_tx_hs_symb_div; + if (host->soc->chip_id != TEGRA264) { + err = clk_set_parent(host->mphy_rx_hs_mux_symb_div, host->mphy_rx_hs_symb_div); + if (err) { + dev_err(dev, + "%s: mphy_rx_hs_symb_div set parent failed %d\n", + __func__, err); + goto disable_mphy_tx_hs_symb_div; + } } err = ufs_tegra_host_clk_enable(dev, "mphy_rx_hs_symb_div", host->mphy_rx_hs_symb_div); @@ -584,20 +588,24 @@ static int ufs_tegra_init_mphy_lane_clks(struct ufs_tegra_host *host) if (err) goto out; - err = ufs_tegra_host_clk_get(dev, "mphy_l0_tx_mux_symb_div", - &host->mphy_tx_hs_mux_symb_div); - if (err) - goto out; + if (host->soc->chip_id != TEGRA264) { + err = ufs_tegra_host_clk_get(dev, "mphy_l0_tx_mux_symb_div", + &host->mphy_tx_hs_mux_symb_div); + if (err) + goto out; + } err = ufs_tegra_host_clk_get(dev, "mphy_l0_rx_hs_symb_div", &host->mphy_rx_hs_symb_div); if (err) goto out; - err = ufs_tegra_host_clk_get(dev, "mphy_l0_rx_mux_symb_div", - &host->mphy_rx_hs_mux_symb_div); - if (err) - goto out; + if (host->soc->chip_id != TEGRA264) { + err = ufs_tegra_host_clk_get(dev, "mphy_l0_rx_mux_symb_div", + &host->mphy_rx_hs_mux_symb_div); + if (err) + goto out; + } err = ufs_tegra_host_clk_get(dev, "mphy_l0_tx_2x_symb", &host->mphy_l0_tx_2x_symb);