All of lore.kernel.org
 help / color / mirror / Atom feed
From: Asutosh Das <asutoshd@codeaurora.org>
To: subhashj@codeaurora.org, cang@codeaurora.org,
	vivek.gautam@codeaurora.org, rnayak@codeaurora.org,
	vinholikatti@gmail.com, jejb@linux.vnet.ibm.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org,
	Asutosh Das <asutoshd@codeaurora.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: [PATCH v1 9/9] scsi: ufs: enable FASTAUTO mode during low load condition
Date: Fri,  6 Jul 2018 18:00:36 +0530	[thread overview]
Message-ID: <e121bd8d45e6789ee00bd4b11803107cc9330a0b.1530880007.git.asutoshd@codeaurora.org> (raw)
In-Reply-To: <cover.1530880006.git.asutoshd@codeaurora.org>
In-Reply-To: <cover.1530880006.git.asutoshd@codeaurora.org>

From: Subhash Jadavani <subhashj@codeaurora.org>

We are currently running UFS link in HS-G3 FAST mode during high load
condition for best possible performance and in HS-G2 FAST mode during
low load condition to save power. As we are anyway scaling down from
HS-G3 to HS-G2, we can also change the mode from FAST to FASTAUTO.
So we looked at the performance numbers with HS-G2 FASTAUTO mode and
they are good enough for most of the low bandwidth usecases. But Samsung
UFS memory devices are exception which has really low sequential read
throughput in FAST AUTO mode hence we will only be enabling FAST AUTO mode
for other UFS device vendors.

Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
---
 drivers/scsi/ufs/ufshcd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 50588cf..a6e43f9 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1088,6 +1088,10 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, bool scale_up)
 			/* scale down gear */
 			new_pwr_info.gear_tx = UFS_MIN_GEAR_TO_SCALE_DOWN;
 			new_pwr_info.gear_rx = UFS_MIN_GEAR_TO_SCALE_DOWN;
+			if (!(hba->dev_quirks & UFS_DEVICE_NO_FASTAUTO)) {
+				new_pwr_info.pwr_tx = FASTAUTO_MODE;
+				new_pwr_info.pwr_rx = FASTAUTO_MODE;
+			}
 		}
 	}
 
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.

WARNING: multiple messages have this Message-ID (diff)
From: Asutosh Das <asutoshd@codeaurora.org>
To: subhashj@codeaurora.org, cang@codeaurora.org,
	vivek.gautam@codeaurora.org, rnayak@codeaurora.org,
	vinholikatti@gmail.com, jejb@linux.vnet.ibm.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org,
	Asutosh Das <asutoshd@codeaurora.org>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v1 9/9] scsi: ufs: enable FASTAUTO mode during low load condition
Date: Fri,  6 Jul 2018 18:00:36 +0530	[thread overview]
Message-ID: <e121bd8d45e6789ee00bd4b11803107cc9330a0b.1530880007.git.asutoshd@codeaurora.org> (raw)
In-Reply-To: <cover.1530880006.git.asutoshd@codeaurora.org>
In-Reply-To: <cover.1530880006.git.asutoshd@codeaurora.org>

From: Subhash Jadavani <subhashj@codeaurora.org>

We are currently running UFS link in HS-G3 FAST mode during high load
condition for best possible performance and in HS-G2 FAST mode during
low load condition to save power. As we are anyway scaling down from
HS-G3 to HS-G2, we can also change the mode from FAST to FASTAUTO.
So we looked at the performance numbers with HS-G2 FASTAUTO mode and
they are good enough for most of the low bandwidth usecases. But Samsung
UFS memory devices are exception which has really low sequential read
throughput in FAST AUTO mode hence we will only be enabling FAST AUTO mode
for other UFS device vendors.

Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
---
 drivers/scsi/ufs/ufshcd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 50588cf..a6e43f9 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1088,6 +1088,10 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, bool scale_up)
 			/* scale down gear */
 			new_pwr_info.gear_tx = UFS_MIN_GEAR_TO_SCALE_DOWN;
 			new_pwr_info.gear_rx = UFS_MIN_GEAR_TO_SCALE_DOWN;
+			if (!(hba->dev_quirks & UFS_DEVICE_NO_FASTAUTO)) {
+				new_pwr_info.pwr_tx = FASTAUTO_MODE;
+				new_pwr_info.pwr_rx = FASTAUTO_MODE;
+			}
 		}
 	}
 
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


  parent reply	other threads:[~2018-07-06 12:30 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1530880006.git.asutoshd@codeaurora.org>
2018-07-06 12:30 ` [PATCH v1 1/9] scsi: ufs: add support to allow non standard behaviours (quirks) Asutosh Das
2018-07-06 12:30   ` Asutosh Das
2018-07-06 12:30 ` [PATCH v1 2/9] scsi: Allow auto suspend override by low-level driver Asutosh Das
2018-07-06 12:30   ` Asutosh Das
2018-07-11 10:45   ` Adrian Hunter
2018-07-20 23:50   ` Subhash Jadavani
2018-07-06 12:30 ` [PATCH v1 3/9] scsi: ufs: Override auto suspend tunables for ufs Asutosh Das
2018-07-06 12:30   ` Asutosh Das
2018-07-11 10:46   ` Adrian Hunter
2018-07-20 23:51   ` Subhash Jadavani
2018-07-06 12:30 ` [PATCH v1 4/9] scsi: ufs: add option to change default UFS power management level Asutosh Das
2018-07-06 12:30   ` Asutosh Das
2018-07-11 10:50   ` Adrian Hunter
2018-07-11 10:50     ` Adrian Hunter
2018-07-23  3:09     ` Asutosh Das (asd)
2018-07-23  3:09       ` Asutosh Das (asd)
2018-07-11 20:33   ` Rob Herring
2018-07-11 20:33     ` Rob Herring
2018-07-23  3:20     ` Asutosh Das (asd)
2018-07-23  3:20       ` Asutosh Das (asd)
2018-07-23 14:36       ` Rob Herring
2018-07-24  3:34         ` Asutosh Das (asd)
2018-07-06 12:30 ` [PATCH v1 5/9] scsi: ufs: add support for hibern8 on idle Asutosh Das
2018-07-06 12:30   ` Asutosh Das
2018-07-06 12:30 ` [PATCH v1 6/9] scsi: ufs: optimize clock, pm_qos, hibern8 handling in queuecommand Asutosh Das
2018-07-06 12:30   ` Asutosh Das
2018-07-06 12:30 ` [PATCH v1 7/9] scsi: ufs: add UFS power collapse support during hibern8 Asutosh Das
2018-07-06 12:30   ` Asutosh Das
2018-07-20 23:58   ` Subhash Jadavani
2018-07-23  3:07     ` Asutosh Das (asd)
2018-07-06 12:30 ` [PATCH v1 8/9] scsi: ufs: enable runtime pm only after ufshcd init Asutosh Das
2018-07-06 12:30   ` Asutosh Das
2018-07-21  0:05   ` Subhash Jadavani
2018-07-06 12:30 ` Asutosh Das [this message]
2018-07-06 12:30   ` [PATCH v1 9/9] scsi: ufs: enable FASTAUTO mode during low load condition Asutosh Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e121bd8d45e6789ee00bd4b11803107cc9330a0b.1530880007.git.asutoshd@codeaurora.org \
    --to=asutoshd@codeaurora.org \
    --cc=cang@codeaurora.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=rnayak@codeaurora.org \
    --cc=subhashj@codeaurora.org \
    --cc=vinholikatti@gmail.com \
    --cc=vivek.gautam@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.