[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <062aa9e8f37c2e50032241ff8ddc1dcbc8051ba9.camel@gmail.com>
Date: Mon, 07 Dec 2020 11:59:31 +0100
From: Bean Huo <huobean@...il.com>
To: Stanley Chu <stanley.chu@...iatek.com>, linux-scsi@...r.kernel.org,
martin.petersen@...cle.com, avri.altman@....com,
alim.akhtar@...sung.com, jejb@...ux.ibm.com
Cc: beanhuo@...ron.com, asutoshd@...eaurora.org, cang@...eaurora.org,
matthias.bgg@...il.com, bvanassche@....org,
linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kuohong.wang@...iatek.com, peter.wang@...iatek.com,
chun-hung.wu@...iatek.com, andy.teng@...iatek.com,
chaotian.jing@...iatek.com, cc.chou@...iatek.com,
jiajie.hao@...iatek.com, alice.chao@...iatek.com
Subject: Re: [PATCH] scsi: ufs: Enable WB flush during suspend only if WB is
enabled
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@...iatek.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,
Bean
Powered by blists - more mailing lists