linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] ufs: introduce skipping manual flush for wb
       [not found] <CGME20200905061548epcas2p1dc708a23247702c6b1f6c0eedc513a92@epcas2p1.samsung.com>
@ 2020-09-05  6:06 ` Kiwoong Kim
       [not found]   ` <CGME20200905061549epcas2p3e3554be6bb9737f3133529ebac4ce99a@epcas2p3.samsung.com>
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Kiwoong Kim @ 2020-09-05  6:06 UTC (permalink / raw)
  To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen,
	beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh,
	hy50.seo, sh425.lee
  Cc: Kiwoong Kim

v3 -> v4: migrate these to 5.10
v2 -> v3: modify some commit messages
v1 -> v2: enable the quirk in exynos

We have two knobs to flush for write booster, i.e.
fWriteBoosterBufferFlushDuringHibernate and fWriteBoosterBufferFlushEn.
However, many product makers uses only fWriteBoosterBufferFlushDuringHibernate,
because this can reportedly cover most scenarios and
there have been some reports that flush by fWriteBoosterBufferFlushEn
could lead to raise power consumption thanks to unexpected internal
operations. So we need a way to enable or disable fWriteBoosterEn
operations. For those case, this quirk will allow to avoid manual flush

Kiwoong Kim (2):
  ufs: introduce skipping manual flush for wb
  ufs: exynos: enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL

 drivers/scsi/ufs/ufs-exynos.c | 3 ++-
 drivers/scsi/ufs/ufshcd.c     | 3 +++
 drivers/scsi/ufs/ufshcd.h     | 5 +++++
 3 files changed, 10 insertions(+), 1 deletion(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v4 1/2] ufs: introduce skipping manual flush for wb
       [not found]   ` <CGME20200905061549epcas2p3e3554be6bb9737f3133529ebac4ce99a@epcas2p3.samsung.com>
@ 2020-09-05  6:06     ` Kiwoong Kim
  2020-09-09  5:21       ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: Kiwoong Kim @ 2020-09-05  6:06 UTC (permalink / raw)
  To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen,
	beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh,
	hy50.seo, sh425.lee
  Cc: Kiwoong Kim

We have two knobs to flush for write booster, i.e.
fWriteBoosterBufferFlushDuringHibernate and fWriteBoosterBufferFlushEn.
However, many product makers uses only fWriteBoosterBufferFlushDuringHibernate,
because this can reportedly cover most scenarios and
there have been some reports that flush by fWriteBoosterBufferFlushEn
could lead to raise power consumption thanks to unexpected internal
operations. So we need a way to enable or disable fWriteBoosterEn
operations. For those case, this quirk will allow to avoid manual flush

Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
---
 drivers/scsi/ufs/ufshcd.c | 3 +++
 drivers/scsi/ufs/ufshcd.h | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 64bd59c..54a2259 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5307,6 +5307,9 @@ static int ufshcd_wb_toggle_flush_during_h8(struct ufs_hba *hba, bool set)
 
 static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable)
 {
+	if (hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)
+		return;
+
 	if (enable)
 		ufshcd_wb_buf_flush_enable(hba);
 	else
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 02bd405..e99efee 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -531,6 +531,11 @@ enum ufshcd_quirks {
 	 * OCS FATAL ERROR with device error through sense data
 	 */
 	UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR		= 1 << 10,
+
+	/*
+	 * This quirk needs to disable manual flush for write booster
+	 */
+	UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL		= 1 << 11,
 };
 
 enum ufshcd_caps {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v4 2/2] ufs: exynos: enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL
       [not found]   ` <CGME20200905061551epcas2p39976167b31a737e4093f0a421c71ee12@epcas2p3.samsung.com>
@ 2020-09-05  6:06     ` Kiwoong Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Kiwoong Kim @ 2020-09-05  6:06 UTC (permalink / raw)
  To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen,
	beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh,
	hy50.seo, sh425.lee
  Cc: Kiwoong Kim

For Exynos, only flush during hibern8 is enough for
sustaining performance and I think that there is
a possiblity of raising current thanks to an increase
of internal operations for manual flush.

Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
---
 drivers/scsi/ufs/ufs-exynos.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index 7d383e3..4584f5d 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -1290,7 +1290,8 @@ struct exynos_ufs_drv_data exynos_ufs_drvs = {
 				  UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR |
 				  UFSHCI_QUIRK_BROKEN_HCE |
 				  UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR |
-				  UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR,
+				  UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR |
+				  UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL,
 	.opts			= EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL |
 				  EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL |
 				  EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX |
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v4 0/2] ufs: introduce skipping manual flush for wb
  2020-09-05  6:06 ` [PATCH v4 0/2] ufs: introduce skipping manual flush for wb Kiwoong Kim
       [not found]   ` <CGME20200905061549epcas2p3e3554be6bb9737f3133529ebac4ce99a@epcas2p3.samsung.com>
       [not found]   ` <CGME20200905061551epcas2p39976167b31a737e4093f0a421c71ee12@epcas2p3.samsung.com>
@ 2020-09-08 16:11   ` Asutosh Das (asd)
  2020-09-09  2:17   ` Martin K. Petersen
  3 siblings, 0 replies; 7+ messages in thread
From: Asutosh Das (asd) @ 2020-09-08 16:11 UTC (permalink / raw)
  To: Kiwoong Kim, linux-scsi, alim.akhtar, avri.altman, jejb,
	martin.petersen, beanhuo, cang, bvanassche, grant.jung, sc.suh,
	hy50.seo, sh425.lee

On 9/4/2020 11:06 PM, Kiwoong Kim wrote:
> v3 -> v4: migrate these to 5.10
> v2 -> v3: modify some commit messages
> v1 -> v2: enable the quirk in exynos
> 
> We have two knobs to flush for write booster, i.e.
> fWriteBoosterBufferFlushDuringHibernate and fWriteBoosterBufferFlushEn.
> However, many product makers uses only fWriteBoosterBufferFlushDuringHibernate,
> because this can reportedly cover most scenarios and
> there have been some reports that flush by fWriteBoosterBufferFlushEn
> could lead to raise power consumption thanks to unexpected internal
> operations. So we need a way to enable or disable fWriteBoosterEn
> operations. For those case, this quirk will allow to avoid manual flush
> 
> Kiwoong Kim (2):
>    ufs: introduce skipping manual flush for wb
>    ufs: exynos: enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL
> 
>   drivers/scsi/ufs/ufs-exynos.c | 3 ++-
>   drivers/scsi/ufs/ufshcd.c     | 3 +++
>   drivers/scsi/ufs/ufshcd.h     | 5 +++++
>   3 files changed, 10 insertions(+), 1 deletion(-)
> 

Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v4 0/2] ufs: introduce skipping manual flush for wb
  2020-09-05  6:06 ` [PATCH v4 0/2] ufs: introduce skipping manual flush for wb Kiwoong Kim
                     ` (2 preceding siblings ...)
  2020-09-08 16:11   ` [PATCH v4 0/2] ufs: introduce skipping manual flush for wb Asutosh Das (asd)
@ 2020-09-09  2:17   ` Martin K. Petersen
  3 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2020-09-09  2:17 UTC (permalink / raw)
  To: alim.akhtar, asutoshd, jejb, cang, hy50.seo, bvanassche,
	linux-scsi, grant.jung, sc.suh, sh425.lee, Kiwoong Kim,
	avri.altman, beanhuo
  Cc: Martin K . Petersen

On Sat, 5 Sep 2020 15:06:50 +0900, Kiwoong Kim wrote:

> v3 -> v4: migrate these to 5.10
> v2 -> v3: modify some commit messages
> v1 -> v2: enable the quirk in exynos
> 
> We have two knobs to flush for write booster, i.e.
> fWriteBoosterBufferFlushDuringHibernate and fWriteBoosterBufferFlushEn.
> However, many product makers uses only fWriteBoosterBufferFlushDuringHibernate,
> because this can reportedly cover most scenarios and
> there have been some reports that flush by fWriteBoosterBufferFlushEn
> could lead to raise power consumption thanks to unexpected internal
> operations. So we need a way to enable or disable fWriteBoosterEn
> operations. For those case, this quirk will allow to avoid manual flush
> 
> [...]

Applied to 5.10/scsi-queue, thanks!

[1/2] scsi: ufs: Introduce skipping manual flush for Write Booster
      https://git.kernel.org/mkp/scsi/c/5df6f2def50c
[2/2] scsi: ufs: exynos: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL
      https://git.kernel.org/mkp/scsi/c/7973b8ac669e

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v4 1/2] ufs: introduce skipping manual flush for wb
  2020-09-05  6:06     ` [PATCH v4 1/2] " Kiwoong Kim
@ 2020-09-09  5:21       ` James Bottomley
  2020-09-09  6:24         ` Kiwoong Kim
  0 siblings, 1 reply; 7+ messages in thread
From: James Bottomley @ 2020-09-09  5:21 UTC (permalink / raw)
  To: Kiwoong Kim, linux-scsi, alim.akhtar, avri.altman,
	martin.petersen, beanhuo, asutoshd, cang, bvanassche, grant.jung,
	sc.suh, hy50.seo, sh425.lee

On Sat, 2020-09-05 at 15:06 +0900, Kiwoong Kim wrote:
[...]
> +
> +	/*
> +	 * This quirk needs to disable manual flush for write booster
> +	 */
> +	UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL		= 1 << 11,

You can't have 1 << 11 it's already taken by:

8da76f71fef7 scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL

	/*
         * This quirk needs to disable manual flush for write booster
         */
        UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL          = 1 << 11,

I take it 1 << 12 is OK?

James



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH v4 1/2] ufs: introduce skipping manual flush for wb
  2020-09-09  5:21       ` James Bottomley
@ 2020-09-09  6:24         ` Kiwoong Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Kiwoong Kim @ 2020-09-09  6:24 UTC (permalink / raw)
  To: jejb, linux-scsi, alim.akhtar, avri.altman, martin.petersen,
	beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh,
	hy50.seo, sh425.lee

> [...]
> > +
> > +	/*
> > +	 * This quirk needs to disable manual flush for write booster
> > +	 */
> > +	UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL		= 1 << 11,
> 
> You can't have 1 << 11 it's already taken by:
> 
> 8da76f71fef7 scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel
> EHL
> 
> 	/*
>          * This quirk needs to disable manual flush for write booster
>          */
>         UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL          = 1 << 11,
> 
> I take it 1 << 12 is OK?
> 
> James
> 
Sure, no problem.

Thanks.
Kiwoong Kim



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-09  6:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200905061548epcas2p1dc708a23247702c6b1f6c0eedc513a92@epcas2p1.samsung.com>
2020-09-05  6:06 ` [PATCH v4 0/2] ufs: introduce skipping manual flush for wb Kiwoong Kim
     [not found]   ` <CGME20200905061549epcas2p3e3554be6bb9737f3133529ebac4ce99a@epcas2p3.samsung.com>
2020-09-05  6:06     ` [PATCH v4 1/2] " Kiwoong Kim
2020-09-09  5:21       ` James Bottomley
2020-09-09  6:24         ` Kiwoong Kim
     [not found]   ` <CGME20200905061551epcas2p39976167b31a737e4093f0a421c71ee12@epcas2p3.samsung.com>
2020-09-05  6:06     ` [PATCH v4 2/2] ufs: exynos: enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Kiwoong Kim
2020-09-08 16:11   ` [PATCH v4 0/2] ufs: introduce skipping manual flush for wb Asutosh Das (asd)
2020-09-09  2:17   ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).