From patchwork Tue Nov 24 07:28:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Can Guo X-Patchwork-Id: 11927319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46F04C63798 for ; Tue, 24 Nov 2020 07:29:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01A0020719 for ; Tue, 24 Nov 2020 07:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730105AbgKXH2w (ORCPT ); Tue, 24 Nov 2020 02:28:52 -0500 Received: from labrats.qualcomm.com ([199.106.110.90]:8295 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729283AbgKXH2v (ORCPT ); Tue, 24 Nov 2020 02:28:51 -0500 IronPort-SDR: y7FUubupOmpvvTbxlHJ40wKINI2czsAMIPX4iPZD8Tx9HhCup4vGluDPa7sel4dI9fJFruDfFj 0FrRrj7uB/GAboV0/ktPosqCvrZIT2PWI2Ja7tksw5VopG4OaYq+7jv0pSTUC6ur8XfgXrWTru uek+fjDF8BZ/P5t2ZZDKGi0wVDI+1xYHiGvrFGYZxjndnkwr32NL8N2wkEp4eR7pGNg8nFICNo IiUrPxcwSRcUnr/GrKTv0ImtJ/o8dEO2VqgPt+ZRosKW6qe2vALWDFif4wjExeoYfpzyYSju0d JUg= X-IronPort-AV: E=Sophos;i="5.78,365,1599548400"; d="scan'208";a="47507391" Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by labrats.qualcomm.com with ESMTP; 23 Nov 2020 23:28:51 -0800 X-QCInternal: smtphost Received: from wsp769891wss.qualcomm.com (HELO stor-presley.qualcomm.com) ([192.168.140.85]) by ironmsg05-sd.qualcomm.com with ESMTP; 23 Nov 2020 23:28:50 -0800 Received: by stor-presley.qualcomm.com (Postfix, from userid 359480) id 81B332185E; Mon, 23 Nov 2020 23:28:50 -0800 (PST) From: Can Guo To: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, ziqichen@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, cang@codeaurora.org Cc: Andy Gross , Bjorn Andersson , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 2/2] scsi: ufs-qcom: Keep core_clk_unipro ON while link is active Date: Mon, 23 Nov 2020 23:28:26 -0800 Message-Id: <1606202906-14485-3-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1606202906-14485-1-git-send-email-cang@codeaurora.org> References: <1606202906-14485-1-git-send-email-cang@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 Reviewed-by: Hongwu Su --- 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;