Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1442980pxu; Mon, 23 Nov 2020 23:34:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFuHDMpUZByYxxiymv1wtPQB3zr184YSnFjkEwZ0KPrPoZ5a43eaaSCgqV7j2E5iRT++44 X-Received: by 2002:a17:906:ceca:: with SMTP id si10mr2860111ejb.409.1606203271292; Mon, 23 Nov 2020 23:34:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606203271; cv=none; d=google.com; s=arc-20160816; b=lVfOVyqeVH82RDuT2Cu4D7vUYgTgQAGHlR56BxcN5gfwZfUhmaB0PpHMM73laY1qQ+ WP6gek7qA2bXCRzOnvttrDK0I3npMWmj1VU4nixQ/HMql+zydEGBIR3AkfZO+iCn7you Ywy+p7baYypGIp7FGEdnS/keBVs9Ijhk35PyA4vql81bMRNC4wyJQbd8H51JiBDg15rJ 9hpuGTqzuE154TymK4KLn/52FXpxcGlyMJWyTtdqNRKA9eMLzopx0cNq9NDthTDKWCML qa2blVuLWC438F7+yb+gNFYqoG50uqhRfGnWkyJvWoBAxDh242NpJDYaEYw6pg8PCQPJ IrNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr; bh=ZSFzn309TC6nh6lZocgEWYAjcG2jIH2Xb1IyVLd0Zno=; b=No/4IvGGOWvHSUZI85yRvJ5eNBit3YjKddDx9ZbDZQXZYrBPd9TehyebN82e/COudO f1rAMuZDjcSAynxFN8IrLMLau0PxoJzMXhPM3n1OHzuesePSo/1iFxDEIWdICn2Em5ML yr+qhMCCpEeEarHB99Zzw7XipyjUW+l6nkPGmphhtIcKTxlr6nzktvIPfMhhFnloVAhs ih1BGqDBaoR8qThK1Vou5sBMmgD0VPLonqmStY5B9bjs7sioUdFtPZ+lfTcla1x1Vc8K 7FtayFZBw351r41/zcyBn8bqpNmv4uBASP6/lFwNBphK9yJd0ucPulRikk8lbOxsO5ly pNQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb9si6367583ejc.725.2020.11.23.23.34.07; Mon, 23 Nov 2020 23:34:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730107AbgKXH2w (ORCPT + 99 others); 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-kernel@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 --- 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; -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.