From 02859e118b97272b6ce8b6443f90395a7a777f57 Mon Sep 17 00:00:00 2001 From: Subhash Jadavani Date: Wed, 10 Jun 2015 17:40:46 -0700 Subject: [PATCH] scsi: ufs-qcom: fix symbol clocks handling We are only enabling the lane-0 symbol clock in 1-lane configuration but it seems during disabling we are trying to disable lane-1 symbol clocks as well even if they were never enable in 1-lane configuration, this change fixes this minor issue. Change-Id: I619a7c2e83a96caa338a56d53e61bba3d982ea13 Signed-off-by: Subhash Jadavani --- drivers/scsi/ufs/ufs-qcom.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index efd900f540ac..4eff9bfcc3b8 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -122,9 +122,11 @@ static void ufs_qcom_disable_lane_clks(struct ufs_qcom_host *host) if (!host->is_lane_clks_enabled) return; - clk_disable_unprepare(host->tx_l1_sync_clk); + if (host->hba->lanes_per_direction > 1) + clk_disable_unprepare(host->tx_l1_sync_clk); clk_disable_unprepare(host->tx_l0_sync_clk); - clk_disable_unprepare(host->rx_l1_sync_clk); + if (host->hba->lanes_per_direction > 1) + clk_disable_unprepare(host->rx_l1_sync_clk); clk_disable_unprepare(host->rx_l0_sync_clk); host->is_lane_clks_enabled = false; @@ -163,7 +165,8 @@ static int ufs_qcom_enable_lane_clks(struct ufs_qcom_host *host) goto out; disable_rx_l1: - clk_disable_unprepare(host->rx_l1_sync_clk); + if (host->hba->lanes_per_direction > 1) + clk_disable_unprepare(host->rx_l1_sync_clk); disable_tx_l0: clk_disable_unprepare(host->tx_l0_sync_clk); disable_rx_l0: