Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp85649ybb; Tue, 24 Mar 2020 17:08:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu05Xog8ZcJGKW9wB+TEUWCU95xJjRQh9SGnrBwtRz6mCeNL63O9iImBoWZNJn+8zu7uAJ2 X-Received: by 2002:aca:2811:: with SMTP id 17mr674321oix.126.1585094901675; Tue, 24 Mar 2020 17:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585094901; cv=none; d=google.com; s=arc-20160816; b=CdMEWoQpWHHeOQ4+j/FGo+o3WfYneVykmUjojvtaCOYwqSDCd/tRaaH5q4J0zWJxUe rpZ+pHh/N1umLeoLw5f/uMcTk6ZcwyiiuUgpHyDaILFM93P0dZfeYveCFbqzh/93oe36 0yP8zu54bQ2tqg9iJAfzd6pmBbcWKsei6aXGmp+DQQBnjenNYEHPujNza3M8EjX10RWy 843tvE6gDVeGb7imw2I1NXjzZgyjdrzM6DQkydA/lRIrt+jnIhtomqPdYA1ZoFXduWiw LT4kdv3eA0oPYXJkT8Gu9Nm/RnVXL5Oi9+nfUjV9tYSxaS54YLfuMhYVL5duyHCvgrWM DOpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=3sGY69SXabEe79YBaQR4rlR8YtI6RcM8qyh64kelHpY=; b=gqsSU7HrKBLfIvyKArrulODD7sL7f5UrI0okmrA89Ub32+EzrunW4KVMqnp1XDiJ/8 jDjxZvJeQAfBkx2zNZmuQX6rwIufa+hGnEVfQkfCXbqOOg5jhC+OptGYU7sFLkpkzexn gbW4W0Ir2w6IE024R7+f5WXJtBCUXwSITU1my4P/WVlNm0LDlqvx3L6OGNQRR6h9/Bq8 Nw/mZtiXMFJmUTvDvuFRrX/OZ/SsMgyhv3ra42CNVKXMPi98OizllQV9q10+Wwig8/7k +epleKwSU8TZjcxFlhc1ngS64TpFDg2p5TwJzFKPBZx7bTPiklSjZzqQq5216/f/Ie68 PJ5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t140si9981319oif.99.2020.03.24.17.07.48; Tue, 24 Mar 2020 17:08:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727297AbgCYAHV (ORCPT + 99 others); Tue, 24 Mar 2020 20:07:21 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:11975 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbgCYAHV (ORCPT ); Tue, 24 Mar 2020 20:07:21 -0400 Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 24 Mar 2020 17:07:20 -0700 Received: from asutoshd-linux1.qualcomm.com ([10.46.160.39]) by ironmsg04-sd.qualcomm.com with ESMTP; 24 Mar 2020 17:07:19 -0700 Received: by asutoshd-linux1.qualcomm.com (Postfix, from userid 92687) id E99CA1F79D; Tue, 24 Mar 2020 17:07:19 -0700 (PDT) From: Asutosh Das To: cang@codeaurora.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: Asutosh Das , linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 3/3] scsi: ufs-qcom: Override devfreq parameters Date: Tue, 24 Mar 2020 17:07:05 -0700 Message-Id: <8595b24c49bd84974ced1fec5a8eecdeeae47746.1585094538.git.asutoshd@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Override devfreq parameters for power-performance trade-off. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 6115ac6..0fb17e2 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "ufshcd.h" #include "ufshcd-pltfrm.h" @@ -1689,6 +1690,21 @@ static void ufs_qcom_device_reset(struct ufs_hba *hba) usleep_range(10, 15); } +static void ufs_qcom_config_scaling_param(struct ufs_hba *hba, + struct devfreq_dev_profile *p, + void *data) +{ + static struct devfreq_simple_ondemand_data *d; + + if (!data) + return; + + d = (struct devfreq_simple_ondemand_data *)data; + p->polling_ms = 60; + d->upthreshold = 70; + d->downdifferential = 65; +} + /** * struct ufs_hba_qcom_vops - UFS QCOM specific variant operations * @@ -1710,6 +1726,7 @@ static const struct ufs_hba_variant_ops ufs_hba_qcom_vops = { .resume = ufs_qcom_resume, .dbg_register_dump = ufs_qcom_dump_dbg_regs, .device_reset = ufs_qcom_device_reset, + .config_scaling_param = ufs_qcom_config_scaling_param, }; /** -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.