2018-07-06 12:41:54

by Asutosh Das (asd)

[permalink] [raw]
Subject: [PATCH v1 3/9] scsi: ufs: Override auto suspend tunables for ufs

From: Sujit Reddy Thumma <[email protected]>

Override auto suspend tunables for UFS device LUNs during
initialization so as to efficiently manage background operations
and the power consumption.

Signed-off-by: Sujit Reddy Thumma <[email protected]>
Signed-off-by: Gilad Broner <[email protected]>
Signed-off-by: Asutosh Das <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 77e2b3e..b03f3ea 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -89,6 +89,9 @@
/* Interrupt aggregation default timeout, unit: 40us */
#define INT_AGGR_DEF_TO 0x02

+/* default value of auto suspend is 3 seconds */
+#define UFSHCD_AUTO_SUSPEND_DELAY_MS 3000 /* millisecs */
+
#define ufshcd_toggle_vreg(_dev, _vreg, _on) \
({ \
int _ret; \
@@ -4528,6 +4531,9 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
blk_queue_max_segment_size(q, PRDT_DATA_BYTE_COUNT_MAX);

+ sdev->autosuspend_delay = UFSHCD_AUTO_SUSPEND_DELAY_MS;
+ sdev->use_rpm_auto = 1;
+
return 0;
}

--
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.



2018-07-11 10:50:02

by Adrian Hunter

[permalink] [raw]
Subject: Re: [PATCH v1 3/9] scsi: ufs: Override auto suspend tunables for ufs

On 06/07/18 15:30, Asutosh Das wrote:
> From: Sujit Reddy Thumma <[email protected]>
>
> Override auto suspend tunables for UFS device LUNs during
> initialization so as to efficiently manage background operations
> and the power consumption.
>
> Signed-off-by: Sujit Reddy Thumma <[email protected]>
> Signed-off-by: Gilad Broner <[email protected]>
> Signed-off-by: Asutosh Das <[email protected]>

Acked-by: Adrian Hunter <[email protected]>

> ---
> drivers/scsi/ufs/ufshcd.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 77e2b3e..b03f3ea 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -89,6 +89,9 @@
> /* Interrupt aggregation default timeout, unit: 40us */
> #define INT_AGGR_DEF_TO 0x02
>
> +/* default value of auto suspend is 3 seconds */
> +#define UFSHCD_AUTO_SUSPEND_DELAY_MS 3000 /* millisecs */
> +
> #define ufshcd_toggle_vreg(_dev, _vreg, _on) \
> ({ \
> int _ret; \
> @@ -4528,6 +4531,9 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
> blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
> blk_queue_max_segment_size(q, PRDT_DATA_BYTE_COUNT_MAX);
>
> + sdev->autosuspend_delay = UFSHCD_AUTO_SUSPEND_DELAY_MS;
> + sdev->use_rpm_auto = 1;
> +
> return 0;
> }
>
>


2018-07-20 23:52:51

by Subhash Jadavani

[permalink] [raw]
Subject: Re: [PATCH v1 3/9] scsi: ufs: Override auto suspend tunables for ufs

On 2018-07-06 05:30, Asutosh Das wrote:
> From: Sujit Reddy Thumma <[email protected]>
>
> Override auto suspend tunables for UFS device LUNs during
> initialization so as to efficiently manage background operations
> and the power consumption.
>
> Signed-off-by: Sujit Reddy Thumma <[email protected]>
> Signed-off-by: Gilad Broner <[email protected]>
> Signed-off-by: Asutosh Das <[email protected]>
> ---
> drivers/scsi/ufs/ufshcd.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 77e2b3e..b03f3ea 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -89,6 +89,9 @@
> /* Interrupt aggregation default timeout, unit: 40us */
> #define INT_AGGR_DEF_TO 0x02
>
> +/* default value of auto suspend is 3 seconds */
> +#define UFSHCD_AUTO_SUSPEND_DELAY_MS 3000 /* millisecs */
> +
> #define ufshcd_toggle_vreg(_dev, _vreg, _on) \
> ({ \
> int _ret; \
> @@ -4528,6 +4531,9 @@ static int ufshcd_slave_configure(struct
> scsi_device *sdev)
> blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
> blk_queue_max_segment_size(q, PRDT_DATA_BYTE_COUNT_MAX);
>
> + sdev->autosuspend_delay = UFSHCD_AUTO_SUSPEND_DELAY_MS;
> + sdev->use_rpm_auto = 1;
> +
> return 0;
> }

Looks good to me.
Reviewed-by: Subhash Jadavani <[email protected]>


--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project