public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Stanley Chu <stanley.chu@mediatek.com>
To: Bean Huo <huobean@gmail.com>
Cc: jiajie.hao@mediatek.com, alice.chao@mediatek.com,
	linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
	andy.teng@mediatek.com, jejb@linux.ibm.com,
	chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com,
	linux-kernel@vger.kernel.org, cc.chou@mediatek.com,
	avri.altman@wdc.com, cang@codeaurora.org,
	linux-mediatek@lists.infradead.org, peter.wang@mediatek.com,
	alim.akhtar@samsung.com, matthias.bgg@gmail.com,
	asutoshd@codeaurora.org, chaotian.jing@mediatek.com,
	bvanassche@acm.org, linux-arm-kernel@lists.infradead.org,
	beanhuo@micron.com
Subject: Re: [PATCH] scsi: ufs: Enable WB flush during suspend only if WB is enabled
Date: Mon, 7 Dec 2020 21:43:40 +0800	[thread overview]
Message-ID: <1607348620.3580.18.camel@mtkswgap22> (raw)
In-Reply-To: <062aa9e8f37c2e50032241ff8ddc1dcbc8051ba9.camel@gmail.com>

Hi Bean,

On Mon, 2020-12-07 at 11:59 +0100, Bean Huo wrote:
> On Mon, 2020-12-07 at 13:50 +0800, Stanley Chu wrote:
> > WriteBootser flush during suspend is not necessary to be enabled if
> > WriteBooster feature is disabled. Simply adding a check to prevent
> > unexpected power drain.
> > 
> > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> > ---
> >  drivers/scsi/ufs/ufshcd.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> > index 4879e87577e1..89fa8b9ac11d 100644
> > --- a/drivers/scsi/ufs/ufshcd.c
> > +++ b/drivers/scsi/ufs/ufshcd.c
> > @@ -5458,7 +5458,7 @@ static bool ufshcd_wb_need_flush(struct ufs_hba
> > *hba)
> >         u32 avail_buf;
> >         u8 index;
> >  
> > -       if (!ufshcd_is_wb_allowed(hba))
> > +       if (!ufshcd_is_wb_allowed(hba) || !hba->wb_enabled)
> >                 return false;
> >         /*
> >          * The ufs device needs the vcc to be ON to flush.
> 
> 
> Hi Stanley
> 
> In the 3.1 Spec:
> 
> "If the fWriteBoosterEn flag is set to zero, data written to any
> logical unit is written in normal storage.
> If the fWriteBoosterEn flag is set to one and the device is configured
> in “shared buffer” mode, data written to any logical unit is written in
> the shared WriteBooster Buffer."
> 
> so, IMO, fWriteBoosterEn is independant with WB buffer flush.
> 
> as for the flush:
> 
> "There are two methods for flushing data from the WriteBooster Buffer
> to the normal storage: one is using an explicit flush command, the
> other enabling the flushing during link hibernate state. If the
> fWriteBoosterBufferFlushEn flag is set to one, the device shall flush
> the data stored in the WriteBooster Buffer to the normal storage. If
> fWriteBoosterBufferFlushDuringHibernate is set to one, the device
> flushes the WriteBooster Buffer data automatically whenever the link
> enters the hibernate (HIBERN8) state."
> 
> IMO, for the flush, it is controlled by fWriteBoosterBufferFlushEn and
> fWriteBoosterBufferFlushDuringHibernate.
> 
> how do you understand the above two paragraphs from Spec?

Thanks for your review and feedback! : )

Actually this patch is not motivated by any limitation in spec. I was
thinking that if host disables WriteBooster, which may imply that host
does not want any WB related operations in device during the disabled
period.

However I may be wrong because host may only want not consuming any WB
buffer in device during the disabled time, but still want the "flush"
operation in device to clean WB buffer as quickly as possible to fulfill
future high-throughput requirement after WB is re-enabled.

So, I would drop this patch.

Thanks,
Stanley Chu
> 
> 
> thanks,
> Bean
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2020-12-07 13:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07  5:50 [PATCH] scsi: ufs: Enable WB flush during suspend only if WB is enabled Stanley Chu
2020-12-07 10:59 ` Bean Huo
2020-12-07 13:43   ` Stanley Chu [this message]

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=1607348620.3580.18.camel@mtkswgap22 \
    --to=stanley.chu@mediatek.com \
    --cc=alice.chao@mediatek.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andy.teng@mediatek.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=cc.chou@mediatek.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=huobean@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=jiajie.hao@mediatek.com \
    --cc=kuohong.wang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=peter.wang@mediatek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox