From patchwork Wed Mar 25 18:29:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Asutosh Das (asd)" X-Patchwork-Id: 11458441 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A968161F for ; Wed, 25 Mar 2020 18:29:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63D7F206F6 for ; Wed, 25 Mar 2020 18:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727865AbgCYS3W (ORCPT ); Wed, 25 Mar 2020 14:29:22 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:27404 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbgCYS3V (ORCPT ); Wed, 25 Mar 2020 14:29:21 -0400 Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 25 Mar 2020 11:29:21 -0700 Received: from asutoshd-linux1.qualcomm.com ([10.46.160.39]) by ironmsg01-sd.qualcomm.com with ESMTP; 25 Mar 2020 11:29:20 -0700 Received: by asutoshd-linux1.qualcomm.com (Postfix, from userid 92687) id A1480208CE; Wed, 25 Mar 2020 11:29:20 -0700 (PDT) From: Asutosh Das To: Avri.Altman@wdc.com, 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 v2 3/3] scsi: ufs-qcom: Override devfreq parameters Date: Wed, 25 Mar 2020 11:29:02 -0700 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Override devfreq parameters for power-performance trade-off. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 6115ac6..19aa5c4 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,29 @@ static void ufs_qcom_device_reset(struct ufs_hba *hba) usleep_range(10, 15); } +#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) +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 = 5; +} +#else +static void ufs_qcom_config_scaling_param(struct ufs_hba *hba, + struct devfreq_dev_profile *p, + void *data) +{ +} +#endif + /** * struct ufs_hba_qcom_vops - UFS QCOM specific variant operations * @@ -1710,6 +1734,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, }; /**