All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] skipping manual flush for write booster
       [not found] <CGME20200824023811epcas2p4915326d30728acff0a721043706e1f3b@epcas2p4.samsung.com>
@ 2020-08-24  2:29 ` Kiwoong Kim
       [not found]   ` <CGME20200824023812epcas2p13703641720a1a031e4b0157b224e7ec3@epcas2p1.samsung.com>
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kiwoong Kim @ 2020-08-24  2:29 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

v2 -> v1: enable the quirk in exynos

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

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 v2 1/2] ufs: introduce skipping manual flush for wb
       [not found]   ` <CGME20200824023812epcas2p13703641720a1a031e4b0157b224e7ec3@epcas2p1.samsung.com>
@ 2020-08-24  2:29     ` Kiwoong Kim
  2020-08-24  6:49       ` Avri Altman
  0 siblings, 1 reply; 7+ messages in thread
From: Kiwoong Kim @ 2020-08-24  2:29 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.
fWriteBoosterEn, fWriteBoosterBufferFlushEn.
However, many product makers uses only fWriteBoosterBufferFlushEn,
because this can reportedly cover most scenarios and
there have been some reports that flush by fWriteBoosterEn could
lead raise power consumption thanks to unexpected internal
operations. So we need a way to enable or disable fWriteBoosterEn.

Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.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 ed03051..7c79a8f 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5277,6 +5277,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 e5353d6..cfafd6e 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -511,6 +511,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 v2 2/2] ufs: exynos: enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL
       [not found]   ` <CGME20200824023813epcas2p1ff02473d05b0c69815f779d350fb8d0b@epcas2p1.samsung.com>
@ 2020-08-24  2:29     ` Kiwoong Kim
  2020-08-24  6:50       ` Avri Altman
  0 siblings, 1 reply; 7+ messages in thread
From: Kiwoong Kim @ 2020-08-24  2:29 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>
---
 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 3c0a50b..defbcc2 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -1289,7 +1289,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 v2 0/2] skipping manual flush for write booster
  2020-08-24  2:29 ` [PATCH v2 0/2] skipping manual flush for write booster Kiwoong Kim
       [not found]   ` <CGME20200824023812epcas2p13703641720a1a031e4b0157b224e7ec3@epcas2p1.samsung.com>
       [not found]   ` <CGME20200824023813epcas2p1ff02473d05b0c69815f779d350fb8d0b@epcas2p1.samsung.com>
@ 2020-08-24  6:46   ` Avri Altman
  2020-08-25  1:59     ` Kiwoong Kim
  2 siblings, 1 reply; 7+ messages in thread
From: Avri Altman @ 2020-08-24  6:46 UTC (permalink / raw)
  To: Kiwoong Kim, linux-scsi, alim.akhtar, jejb, martin.petersen,
	beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh,
	hy50.seo, sh425.lee

 
> 
> v2 -> v1: enable the quirk in exynos
> 
> We have two knobs to flush for write booster, i.e.
> fWriteBoosterEn, fWriteBoosterBufferFlushEn.
fWriteBoosterBufferFlushDuringHibernate and fWriteBoosterBufferFlushEn.

> However, many product makers uses only fWriteBoosterBufferFlushEn,
Uses only fWriteBoosterBufferFlushDuringHibernate
> because this can reportedly cover most scenarios and
> there have been some reports that flush by fWriteBoosterEn could
flush by fWriteBoosterBufferFlushEn could

> lead raise power consumption thanks to unexpected internal
lead to a raise

> operations. So we need a way to enable or disable fWriteBoosterEn.
operations. For those case, this quirk will allow to avoid manual flush.

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

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

 
> 
> We have two knobs to flush for write booster, i.e.
> fWriteBoosterEn, fWriteBoosterBufferFlushEn.
fWriteBoosterBufferFlushDuringHibernate and fWriteBoosterBufferFlushEn.

> However, many product makers uses only fWriteBoosterBufferFlushEn,
Uses only fWriteBoosterBufferFlushDuringHibernate

> because this can reportedly cover most scenarios and
> there have been some reports that flush by fWriteBoosterEn could
flush by fWriteBoosterBufferFlushEn could

> lead 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>
> ---
>  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 ed03051..7c79a8f 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -5277,6 +5277,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 e5353d6..cfafd6e 100644
> --- a/drivers/scsi/ufs/ufshcd.h
> +++ b/drivers/scsi/ufs/ufshcd.h
> @@ -511,6 +511,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	[flat|nested] 7+ messages in thread

* RE: [PATCH v2 2/2] ufs: exynos: enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL
  2020-08-24  2:29     ` [PATCH v2 2/2] ufs: exynos: enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Kiwoong Kim
@ 2020-08-24  6:50       ` Avri Altman
  0 siblings, 0 replies; 7+ messages in thread
From: Avri Altman @ 2020-08-24  6:50 UTC (permalink / raw)
  To: Kiwoong Kim, linux-scsi, alim.akhtar, jejb, martin.petersen,
	beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh,
	hy50.seo, sh425.lee

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

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

* RE: [PATCH v2 0/2] skipping manual flush for write booster
  2020-08-24  6:46   ` [PATCH v2 0/2] skipping manual flush for write booster Avri Altman
@ 2020-08-25  1:59     ` Kiwoong Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Kiwoong Kim @ 2020-08-25  1:59 UTC (permalink / raw)
  To: 'Avri Altman',
	linux-scsi, alim.akhtar, jejb, martin.petersen, beanhuo,
	asutoshd, cang, bvanassche, grant.jung, sc.suh, hy50.seo,
	sh425.lee

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

It was my mistake and I'll be more careful when writing messages.

Thanks.
Kiwoong Kim


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

end of thread, other threads:[~2020-08-25  2:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200824023811epcas2p4915326d30728acff0a721043706e1f3b@epcas2p4.samsung.com>
2020-08-24  2:29 ` [PATCH v2 0/2] skipping manual flush for write booster Kiwoong Kim
     [not found]   ` <CGME20200824023812epcas2p13703641720a1a031e4b0157b224e7ec3@epcas2p1.samsung.com>
2020-08-24  2:29     ` [PATCH v2 1/2] ufs: introduce skipping manual flush for wb Kiwoong Kim
2020-08-24  6:49       ` Avri Altman
     [not found]   ` <CGME20200824023813epcas2p1ff02473d05b0c69815f779d350fb8d0b@epcas2p1.samsung.com>
2020-08-24  2:29     ` [PATCH v2 2/2] ufs: exynos: enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Kiwoong Kim
2020-08-24  6:50       ` Avri Altman
2020-08-24  6:46   ` [PATCH v2 0/2] skipping manual flush for write booster Avri Altman
2020-08-25  1:59     ` Kiwoong Kim

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.