diff mbox series

[v2,2/2] scsi: ufs-qcom: Keep core_clk_unipro ON while link is active

Message ID 1606202906-14485-3-git-send-email-cang@codeaurora.org
State Accepted
Commit 96f08cc5943c0fe943ea10fdead6a80b73270046
Headers show
Series None | expand

Commit Message

Can Guo Nov. 24, 2020, 7:28 a.m. UTC
If we want to disable clocks to save power but still keep the link active,
core_clk_unipro, as same as ref_clk, should not be the one being disabled.

Signed-off-by: Can Guo <cang@codeaurora.org>
---
 drivers/scsi/ufs/ufs-qcom.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

hongwus@codeaurora.org Nov. 25, 2020, 2:02 a.m. UTC | #1
On 2020-11-24 15:28, Can Guo wrote:
> If we want to disable clocks to save power but still keep the link 
> active,
> core_clk_unipro, as same as ref_clk, should not be the one being 
> disabled.
> 
> Signed-off-by: Can Guo <cang@codeaurora.org>
> ---
>  drivers/scsi/ufs/ufs-qcom.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index f9d6ef3..70df357 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -977,6 +977,7 @@ static int ufs_qcom_init(struct ufs_hba *hba)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct ufs_qcom_host *host;
>  	struct resource *res;
> +	struct ufs_clk_info *clki;
> 
>  	if (strlen(android_boot_dev) && strcmp(android_boot_dev, 
> dev_name(dev)))
>  		return -ENODEV;
> @@ -1075,6 +1076,11 @@ static int ufs_qcom_init(struct ufs_hba *hba)
>  		}
>  	}
> 
> +	list_for_each_entry(clki, &hba->clk_list_head, list) {
> +		if (!strcmp(clki->name, "core_clk_unipro"))
> +			clki->always_on_while_link_active = true;
> +	}
> +
>  	err = ufs_qcom_init_lane_clks(host);
>  	if (err)
>  		goto out_variant_clear;

Reviewed-by: Hongwu Su<hongwus@codeaurora.org>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index f9d6ef3..70df357 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -977,6 +977,7 @@  static int ufs_qcom_init(struct ufs_hba *hba)
 	struct platform_device *pdev = to_platform_device(dev);
 	struct ufs_qcom_host *host;
 	struct resource *res;
+	struct ufs_clk_info *clki;
 
 	if (strlen(android_boot_dev) && strcmp(android_boot_dev, dev_name(dev)))
 		return -ENODEV;
@@ -1075,6 +1076,11 @@  static int ufs_qcom_init(struct ufs_hba *hba)
 		}
 	}
 
+	list_for_each_entry(clki, &hba->clk_list_head, list) {
+		if (!strcmp(clki->name, "core_clk_unipro"))
+			clki->always_on_while_link_active = true;
+	}
+
 	err = ufs_qcom_init_lane_clks(host);
 	if (err)
 		goto out_variant_clear;