Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v3 2/2] scsi: ufs-qcom: Keep core_clk_unipro ON while link is active
       [not found] <1606356063-38380-1-git-send-email-cang@codeaurora.org>
@ 2020-11-26  2:01 ` Can Guo
  2020-12-01  2:36   ` Asutosh Das (asd)
  0 siblings, 1 reply; 2+ messages in thread
From: Can Guo @ 2020-11-26  2:01 UTC (permalink / raw)
  To: asutoshd, nguyenb, hongwus, ziqichen, rnayak, linux-scsi,
	kernel-team, saravanak, salyzyn, cang
  Cc: Andy Gross, Bjorn Andersson, Alim Akhtar, Avri Altman,
	James E.J. Bottomley, Martin K. Petersen,
	open list:ARM/QUALCOMM SUPPORT, open list

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.

Reviewed-by: Hongwu Su<hongwus@codeaurora.org>
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..8a7fc62 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->keep_link_active = true;
+	}
+
 	err = ufs_qcom_init_lane_clks(host);
 	if (err)
 		goto out_variant_clear;
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3 2/2] scsi: ufs-qcom: Keep core_clk_unipro ON while link is active
  2020-11-26  2:01 ` [PATCH v3 2/2] scsi: ufs-qcom: Keep core_clk_unipro ON while link is active Can Guo
@ 2020-12-01  2:36   ` Asutosh Das (asd)
  0 siblings, 0 replies; 2+ messages in thread
From: Asutosh Das (asd) @ 2020-12-01  2:36 UTC (permalink / raw)
  To: Can Guo, nguyenb, hongwus, ziqichen, rnayak, linux-scsi,
	kernel-team, saravanak, salyzyn
  Cc: Andy Gross, Bjorn Andersson, Alim Akhtar, Avri Altman,
	James E.J. Bottomley, Martin K. Petersen,
	open list:ARM/QUALCOMM SUPPORT, open list

On 11/25/2020 6:01 PM, 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.
> 
> Reviewed-by: Hongwu Su<hongwus@codeaurora.org>
> Signed-off-by: Can Guo <cang@codeaurora.org>
> ---

Reviewed-by: Asutosh Das <asutoshd@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..8a7fc62 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->keep_link_active = true;
> +	}
> +
>   	err = ufs_qcom_init_lane_clks(host);
>   	if (err)
>   		goto out_variant_clear;
> 


-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-01  2:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1606356063-38380-1-git-send-email-cang@codeaurora.org>
2020-11-26  2:01 ` [PATCH v3 2/2] scsi: ufs-qcom: Keep core_clk_unipro ON while link is active Can Guo
2020-12-01  2:36   ` Asutosh Das (asd)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox