* [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL @ 2020-12-22 7:29 Stanley Chu 2020-12-22 11:34 ` Can Guo 0 siblings, 1 reply; 15+ messages in thread From: Stanley Chu @ 2020-12-22 7:29 UTC (permalink / raw) To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb Cc: Stanley Chu, alice.chao, bvanassche, andy.teng, cc.chou, chun-hung.wu, kuohong.wang, linux-kernel, jiajie.hao, cang, linux-mediatek, peter.wang, matthias.bgg, beanhuo, chaotian.jing, linux-arm-kernel, asutoshd Flush during hibern8 is sufficient on MediaTek platforms, thus enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL to skip enabling fWriteBoosterBufferFlush during WriteBooster initialization. Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> --- drivers/scsi/ufs/ufs-mediatek.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c index 80618af7c872..c55202b92a43 100644 --- a/drivers/scsi/ufs/ufs-mediatek.c +++ b/drivers/scsi/ufs/ufs-mediatek.c @@ -661,6 +661,7 @@ static int ufs_mtk_init(struct ufs_hba *hba) /* Enable WriteBooster */ hba->caps |= UFSHCD_CAP_WB_EN; + hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL; hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80); if (host->caps & UFS_MTK_CAP_DISABLE_AH8) -- 2.18.0 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-22 7:29 [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Stanley Chu @ 2020-12-22 11:34 ` Can Guo 2020-12-23 4:19 ` Stanley Chu 0 siblings, 1 reply; 15+ messages in thread From: Can Guo @ 2020-12-22 11:34 UTC (permalink / raw) To: Stanley Chu Cc: jiajie.hao, linux-scsi, martin.petersen, andy.teng, jejb, chun-hung.wu, kuohong.wang, linux-kernel, cc.chou, avri.altman, alice.chao, linux-mediatek, peter.wang, alim.akhtar, matthias.bgg, asutoshd, chaotian.jing, bvanassche, linux-arm-kernel, beanhuo On 2020-12-22 15:29, Stanley Chu wrote: > Flush during hibern8 is sufficient on MediaTek platforms, thus > enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL to skip enabling > fWriteBoosterBufferFlush during WriteBooster initialization. > > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> > --- > drivers/scsi/ufs/ufs-mediatek.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/scsi/ufs/ufs-mediatek.c > b/drivers/scsi/ufs/ufs-mediatek.c > index 80618af7c872..c55202b92a43 100644 > --- a/drivers/scsi/ufs/ufs-mediatek.c > +++ b/drivers/scsi/ufs/ufs-mediatek.c > @@ -661,6 +661,7 @@ static int ufs_mtk_init(struct ufs_hba *hba) > > /* Enable WriteBooster */ > hba->caps |= UFSHCD_CAP_WB_EN; > + hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL; > hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80); > > if (host->caps & UFS_MTK_CAP_DISABLE_AH8) I guess we need it too... Change LGTM. Regards, Can Guo. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-22 11:34 ` Can Guo @ 2020-12-23 4:19 ` Stanley Chu 2020-12-23 4:41 ` Can Guo 0 siblings, 1 reply; 15+ messages in thread From: Stanley Chu @ 2020-12-23 4:19 UTC (permalink / raw) To: Can Guo Cc: jiajie.hao, linux-scsi, martin.petersen, andy.teng, jejb, chun-hung.wu, kuohong.wang, linux-kernel, cc.chou, avri.altman, alice.chao, linux-mediatek, peter.wang, alim.akhtar, matthias.bgg, asutoshd, chaotian.jing, bvanassche, linux-arm-kernel, beanhuo Hi Can, On Tue, 2020-12-22 at 19:34 +0800, Can Guo wrote: > On 2020-12-22 15:29, Stanley Chu wrote: > > Flush during hibern8 is sufficient on MediaTek platforms, thus > > enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL to skip enabling > > fWriteBoosterBufferFlush during WriteBooster initialization. > > > > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> > > --- > > drivers/scsi/ufs/ufs-mediatek.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/scsi/ufs/ufs-mediatek.c > > b/drivers/scsi/ufs/ufs-mediatek.c > > index 80618af7c872..c55202b92a43 100644 > > --- a/drivers/scsi/ufs/ufs-mediatek.c > > +++ b/drivers/scsi/ufs/ufs-mediatek.c > > @@ -661,6 +661,7 @@ static int ufs_mtk_init(struct ufs_hba *hba) > > > > /* Enable WriteBooster */ > > hba->caps |= UFSHCD_CAP_WB_EN; > > + hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL; > > hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80); > > > > if (host->caps & UFS_MTK_CAP_DISABLE_AH8) > > I guess we need it too... AHHA, if you decide to add this in your platform too later, maybe we could change the way it does: Keep manual flush disabled by default and remove this quirk. Thanks, Stanley Chu > > Change LGTM. > > Regards, > > Can Guo. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-23 4:19 ` Stanley Chu @ 2020-12-23 4:41 ` Can Guo 2020-12-23 7:47 ` Avri Altman 2020-12-24 2:21 ` Can Guo 0 siblings, 2 replies; 15+ messages in thread From: Can Guo @ 2020-12-23 4:41 UTC (permalink / raw) To: Stanley Chu Cc: jiajie.hao, linux-scsi, martin.petersen, andy.teng, jejb, chun-hung.wu, kuohong.wang, linux-kernel, cc.chou, avri.altman, alice.chao, linux-mediatek, peter.wang, alim.akhtar, matthias.bgg, asutoshd, chaotian.jing, bvanassche, linux-arm-kernel, beanhuo On 2020-12-23 12:19, Stanley Chu wrote: > Hi Can, > > On Tue, 2020-12-22 at 19:34 +0800, Can Guo wrote: >> On 2020-12-22 15:29, Stanley Chu wrote: >> > Flush during hibern8 is sufficient on MediaTek platforms, thus >> > enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL to skip enabling >> > fWriteBoosterBufferFlush during WriteBooster initialization. >> > >> > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> >> > --- >> > drivers/scsi/ufs/ufs-mediatek.c | 1 + >> > 1 file changed, 1 insertion(+) >> > >> > diff --git a/drivers/scsi/ufs/ufs-mediatek.c >> > b/drivers/scsi/ufs/ufs-mediatek.c >> > index 80618af7c872..c55202b92a43 100644 >> > --- a/drivers/scsi/ufs/ufs-mediatek.c >> > +++ b/drivers/scsi/ufs/ufs-mediatek.c >> > @@ -661,6 +661,7 @@ static int ufs_mtk_init(struct ufs_hba *hba) >> > >> > /* Enable WriteBooster */ >> > hba->caps |= UFSHCD_CAP_WB_EN; >> > + hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL; >> > hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80); >> > >> > if (host->caps & UFS_MTK_CAP_DISABLE_AH8) >> >> I guess we need it too... > > AHHA, if you decide to add this in your platform too later, maybe we > could change the way it does: Keep manual flush disabled by default and > remove this quirk. > Yeah... I will get back with an answer later. Thanks, Can Guo. > Thanks, > Stanley Chu >> >> Change LGTM. >> >> Regards, >> >> Can Guo. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-23 4:41 ` Can Guo @ 2020-12-23 7:47 ` Avri Altman 2020-12-23 8:35 ` Bean Huo 2020-12-28 12:59 ` Avri Altman 2020-12-24 2:21 ` Can Guo 1 sibling, 2 replies; 15+ messages in thread From: Avri Altman @ 2020-12-23 7:47 UTC (permalink / raw) To: Can Guo, Stanley Chu Cc: 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, jiajie.hao@mediatek.com, alice.chao@mediatek.com, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, beanhuo@micron.com, chaotian.jing@mediatek.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, asutoshd@codeaurora.org > > On 2020-12-23 12:19, Stanley Chu wrote: > > Hi Can, > > > > On Tue, 2020-12-22 at 19:34 +0800, Can Guo wrote: > >> On 2020-12-22 15:29, Stanley Chu wrote: > >> > Flush during hibern8 is sufficient on MediaTek platforms, thus > >> > enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL to skip > enabling > >> > fWriteBoosterBufferFlush during WriteBooster initialization. > >> > > >> > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> > >> > --- > >> > drivers/scsi/ufs/ufs-mediatek.c | 1 + > >> > 1 file changed, 1 insertion(+) > >> > > >> > diff --git a/drivers/scsi/ufs/ufs-mediatek.c > >> > b/drivers/scsi/ufs/ufs-mediatek.c > >> > index 80618af7c872..c55202b92a43 100644 > >> > --- a/drivers/scsi/ufs/ufs-mediatek.c > >> > +++ b/drivers/scsi/ufs/ufs-mediatek.c > >> > @@ -661,6 +661,7 @@ static int ufs_mtk_init(struct ufs_hba *hba) > >> > > >> > /* Enable WriteBooster */ > >> > hba->caps |= UFSHCD_CAP_WB_EN; > >> > + hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL; > >> > hba->vps->wb_flush_threshold = > UFS_WB_BUF_REMAIN_PERCENT(80); > >> > > >> > if (host->caps & UFS_MTK_CAP_DISABLE_AH8) > >> > >> I guess we need it too... > > > > AHHA, if you decide to add this in your platform too later, maybe we > > could change the way it does: Keep manual flush disabled by default and > > remove this quirk. Ack on that. I never understood why it was needed in the first place. Maybe just remove it, and allow to perform explicit flush from sysfs. Thanks, Avri > > > > Yeah... I will get back with an answer later. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-23 7:47 ` Avri Altman @ 2020-12-23 8:35 ` Bean Huo 2020-12-28 12:59 ` Avri Altman 1 sibling, 0 replies; 15+ messages in thread From: Bean Huo @ 2020-12-23 8:35 UTC (permalink / raw) To: Avri Altman, Can Guo, Stanley Chu Cc: 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, jiajie.hao@mediatek.com, alice.chao@mediatek.com, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, beanhuo@micron.com, chaotian.jing@mediatek.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, asutoshd@codeaurora.org On Wed, 2020-12-23 at 07:47 +0000, Avri Altman wrote: > > > could change the way it does: Keep manual flush disabled by > > > default and > > > remove this quirk. > > Ack on that. > I never understood why it was needed in the first place. > Maybe just remove it, and allow to perform explicit flush from sysfs. > > Thanks, > Avr Avri I agree with you. I don't understand why setting that at the begginnning, also assign this feature the contrller to make desicion. Bean _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-23 7:47 ` Avri Altman 2020-12-23 8:35 ` Bean Huo @ 2020-12-28 12:59 ` Avri Altman 1 sibling, 0 replies; 15+ messages in thread From: Avri Altman @ 2020-12-28 12:59 UTC (permalink / raw) To: Can Guo, Stanley Chu Cc: 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, jiajie.hao@mediatek.com, alice.chao@mediatek.com, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, beanhuo@micron.com, chaotian.jing@mediatek.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, asutoshd@codeaurora.org > > > > On 2020-12-23 12:19, Stanley Chu wrote: > > > Hi Can, > > > > > > On Tue, 2020-12-22 at 19:34 +0800, Can Guo wrote: > > >> On 2020-12-22 15:29, Stanley Chu wrote: > > >> > Flush during hibern8 is sufficient on MediaTek platforms, thus > > >> > enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL to skip > > enabling > > >> > fWriteBoosterBufferFlush during WriteBooster initialization. > > >> > > > >> > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-23 4:41 ` Can Guo 2020-12-23 7:47 ` Avri Altman @ 2020-12-24 2:21 ` Can Guo 2020-12-24 7:52 ` Stanley Chu 1 sibling, 1 reply; 15+ messages in thread From: Can Guo @ 2020-12-24 2:21 UTC (permalink / raw) To: Stanley Chu Cc: jiajie.hao, linux-scsi, martin.petersen, andy.teng, jejb, chun-hung.wu, kuohong.wang, linux-kernel, cc.chou, avri.altman, alice.chao, linux-mediatek, peter.wang, alim.akhtar, matthias.bgg, asutoshd, chaotian.jing, bvanassche, linux-arm-kernel, beanhuo On 2020-12-23 12:41, Can Guo wrote: > On 2020-12-23 12:19, Stanley Chu wrote: >> Hi Can, >> >> On Tue, 2020-12-22 at 19:34 +0800, Can Guo wrote: >>> On 2020-12-22 15:29, Stanley Chu wrote: >>> > Flush during hibern8 is sufficient on MediaTek platforms, thus >>> > enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL to skip enabling >>> > fWriteBoosterBufferFlush during WriteBooster initialization. >>> > >>> > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> >>> > --- >>> > drivers/scsi/ufs/ufs-mediatek.c | 1 + >>> > 1 file changed, 1 insertion(+) >>> > >>> > diff --git a/drivers/scsi/ufs/ufs-mediatek.c >>> > b/drivers/scsi/ufs/ufs-mediatek.c >>> > index 80618af7c872..c55202b92a43 100644 >>> > --- a/drivers/scsi/ufs/ufs-mediatek.c >>> > +++ b/drivers/scsi/ufs/ufs-mediatek.c >>> > @@ -661,6 +661,7 @@ static int ufs_mtk_init(struct ufs_hba *hba) >>> > >>> > /* Enable WriteBooster */ >>> > hba->caps |= UFSHCD_CAP_WB_EN; >>> > + hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL; >>> > hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80); >>> > >>> > if (host->caps & UFS_MTK_CAP_DISABLE_AH8) >>> >>> I guess we need it too... >> >> AHHA, if you decide to add this in your platform too later, maybe we >> could change the way it does: Keep manual flush disabled by default >> and >> remove this quirk. >> > > Yeah... I will get back with an answer later. Hi Stanley, Do you see any substantial benefit of having fWriteBoosterBufferFlushEn disabled? Thanks, Can Guo. > > Thanks, > > Can Guo. > >> Thanks, >> Stanley Chu >>> >>> Change LGTM. >>> >>> Regards, >>> >>> Can Guo. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-24 2:21 ` Can Guo @ 2020-12-24 7:52 ` Stanley Chu 2020-12-24 11:03 ` Avri Altman 0 siblings, 1 reply; 15+ messages in thread From: Stanley Chu @ 2020-12-24 7:52 UTC (permalink / raw) To: Can Guo Cc: jiajie.hao, linux-scsi, martin.petersen, andy.teng, jejb, chun-hung.wu, kuohong.wang, linux-kernel, cc.chou, avri.altman, alice.chao, linux-mediatek, peter.wang, alim.akhtar, matthias.bgg, asutoshd, chaotian.jing, bvanassche, linux-arm-kernel, beanhuo Hi Can, On Thu, 2020-12-24 at 10:21 +0800, Can Guo wrote: > On 2020-12-23 12:41, Can Guo wrote: > > On 2020-12-23 12:19, Stanley Chu wrote: > >> Hi Can, > >> > >> On Tue, 2020-12-22 at 19:34 +0800, Can Guo wrote: > >>> On 2020-12-22 15:29, Stanley Chu wrote: > >>> > Flush during hibern8 is sufficient on MediaTek platforms, thus > >>> > enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL to skip enabling > >>> > fWriteBoosterBufferFlush during WriteBooster initialization. > >>> > > >>> > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> > >>> > --- > >>> > drivers/scsi/ufs/ufs-mediatek.c | 1 + > >>> > 1 file changed, 1 insertion(+) > >>> > > >>> > diff --git a/drivers/scsi/ufs/ufs-mediatek.c > >>> > b/drivers/scsi/ufs/ufs-mediatek.c > >>> > index 80618af7c872..c55202b92a43 100644 > >>> > --- a/drivers/scsi/ufs/ufs-mediatek.c > >>> > +++ b/drivers/scsi/ufs/ufs-mediatek.c > >>> > @@ -661,6 +661,7 @@ static int ufs_mtk_init(struct ufs_hba *hba) > >>> > > >>> > /* Enable WriteBooster */ > >>> > hba->caps |= UFSHCD_CAP_WB_EN; > >>> > + hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL; > >>> > hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80); > >>> > > >>> > if (host->caps & UFS_MTK_CAP_DISABLE_AH8) > >>> > >>> I guess we need it too... > >> > >> AHHA, if you decide to add this in your platform too later, maybe we > >> could change the way it does: Keep manual flush disabled by default > >> and > >> remove this quirk. > >> > > > > Yeah... I will get back with an answer later. > > Hi Stanley, > > Do you see any substantial benefit of having fWriteBoosterBufferFlushEn > disabled? 1. The definition of fWriteBoosterBufferFlushEn is that host allows device to do flush in anytime after fWriteBoosterBufferFlushEn is set as on. This is not what we want. Just Like BKOP, We do not want flush happening beyond host's expected timing that device performance may be "randomly" dropped. 2. Another related concern is that currently fWriteBoosterBufferFlushEn may keep on while device is not in Active Power Mode during suspend period. I am not sure if such configuration would confuse the device. Thanks, Stanley Chu > > Thanks, > Can Guo. > > > > > Thanks, > > > > Can Guo. > > > >> Thanks, > >> Stanley Chu > >>> > >>> Change LGTM. > >>> > >>> Regards, > >>> > >>> Can Guo. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-24 7:52 ` Stanley Chu @ 2020-12-24 11:03 ` Avri Altman 2020-12-24 12:01 ` Bean Huo 0 siblings, 1 reply; 15+ messages in thread From: Avri Altman @ 2020-12-24 11:03 UTC (permalink / raw) To: Stanley Chu, Can Guo Cc: 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, jiajie.hao@mediatek.com, alice.chao@mediatek.com, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, beanhuo@micron.com, chaotian.jing@mediatek.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, asutoshd@codeaurora.org Hi, Just to clarify things: > > Do you see any substantial benefit of having fWriteBoosterBufferFlushEn > > disabled? > > 1. The definition of fWriteBoosterBufferFlushEn is that host allows > device to do flush in anytime after fWriteBoosterBufferFlushEn is set as > on. This is not what we want. > > Just Like BKOP, We do not want flush happening beyond host's expected > timing that device performance may be "randomly" dropped. Explicit flush takes place only when the device is idle: if fWriteBoosterBufferFlushEn is set, the device is idle, and before h8 received. If a request arrives, the flush operation should be halted. So no performance degradation is expected. > > 2. Another related concern is that currently fWriteBoosterBufferFlushEn > may keep on while device is not in Active Power Mode during suspend > period. I am not sure if such configuration would confuse the device. The spec says: " While the flushing operation is in progress, the device is in Active power mode" > > Thanks, > Stanley Chu > > > > > Thanks, > > Can Guo. > > > > > > > > Thanks, > > > > > > Can Guo. > > > > > >> Thanks, > > >> Stanley Chu > > >>> > > >>> Change LGTM. > > >>> > > >>> Regards, > > >>> > > >>> Can Guo. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-24 11:03 ` Avri Altman @ 2020-12-24 12:01 ` Bean Huo 2020-12-24 13:47 ` Stanley Chu 0 siblings, 1 reply; 15+ messages in thread From: Bean Huo @ 2020-12-24 12:01 UTC (permalink / raw) To: Avri Altman, Stanley Chu, Can Guo Cc: 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, jiajie.hao@mediatek.com, alice.chao@mediatek.com, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, beanhuo@micron.com, chaotian.jing@mediatek.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, asutoshd@codeaurora.org On Thu, 2020-12-24 at 11:03 +0000, Avri Altman wrote: > > > Do you see any substantial benefit of having > > > fWriteBoosterBufferFlushEn > > > disabled? > > > > 1. The definition of fWriteBoosterBufferFlushEn is that host allows > > device to do flush in anytime after fWriteBoosterBufferFlushEn is > > set as > > on. This is not what we want. > > > > Just Like BKOP, We do not want flush happening beyond host's > > expected > > timing that device performance may be "randomly" dropped. > > Explicit flush takes place only when the device is idle: > if fWriteBoosterBufferFlushEn is set, the device is idle, and before > h8 received. > If a request arrives, the flush operation should be halted. > So no performance degradation is expected. Hi Stanley Avri's comment is correct, fWriteBoosterBufferFlushEn==1, device will flush only when it is in idle, once there is new incoming request, the flush will be suspended. You should be very careful when you want to skip this stetting of this flag. Bean _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-24 12:01 ` Bean Huo @ 2020-12-24 13:47 ` Stanley Chu 2020-12-28 1:32 ` Asutosh Das (asd) 2020-12-28 1:33 ` Can Guo 0 siblings, 2 replies; 15+ messages in thread From: Stanley Chu @ 2020-12-24 13:47 UTC (permalink / raw) To: Bean Huo 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, Can Guo, 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 Hi Avri, Bean, On Thu, 2020-12-24 at 13:01 +0100, Bean Huo wrote: > On Thu, 2020-12-24 at 11:03 +0000, Avri Altman wrote: > > > > Do you see any substantial benefit of having > > > > fWriteBoosterBufferFlushEn > > > > disabled? > > > > > > 1. The definition of fWriteBoosterBufferFlushEn is that host allows > > > device to do flush in anytime after fWriteBoosterBufferFlushEn is > > > set as > > > on. This is not what we want. > > > > > > Just Like BKOP, We do not want flush happening beyond host's > > > expected > > > timing that device performance may be "randomly" dropped. > > > > Explicit flush takes place only when the device is idle: > > if fWriteBoosterBufferFlushEn is set, the device is idle, and before > > h8 received. > > If a request arrives, the flush operation should be halted. > > So no performance degradation is expected. > > Hi Stanley > > Avri's comment is correct, fWriteBoosterBufferFlushEn==1, device will > flush only when it is in idle, once there is new incoming request, the > flush will be suspended. You should be very careful when you want to > skip this stetting of this flag. Very appreciate your the clarification. However similar to "Background Operations Termination Latency", while the next request comes, device may need some time to suspend on-going flush operations. This delay may "randomly" degrade the performance right? Since the configuration, i.e., enable fWriteBoosterBufferFlushDuringHibernate only with fWriteBoosterBufferFlushEn disabled, has been applied in many of our mass-produced products these yeas, we would like to keep it unless the new setting has obvious benefits. Thanks, Stanley Chu > > Bean > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-24 13:47 ` Stanley Chu @ 2020-12-28 1:32 ` Asutosh Das (asd) 2020-12-28 2:00 ` Stanley Chu 2020-12-28 1:33 ` Can Guo 1 sibling, 1 reply; 15+ messages in thread From: Asutosh Das (asd) @ 2020-12-28 1:32 UTC (permalink / raw) To: Stanley Chu, Bean Huo Cc: jiajie.hao@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, Can Guo, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, alice.chao@mediatek.com, chaotian.jing@mediatek.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, beanhuo@micron.com On 12/24/2020 5:47 AM, Stanley Chu wrote: > Hi Avri, Bean, > > On Thu, 2020-12-24 at 13:01 +0100, Bean Huo wrote: >> On Thu, 2020-12-24 at 11:03 +0000, Avri Altman wrote: >>>>> Do you see any substantial benefit of having >>>>> fWriteBoosterBufferFlushEn >>>>> disabled? >>>> >>>> 1. The definition of fWriteBoosterBufferFlushEn is that host allows >>>> device to do flush in anytime after fWriteBoosterBufferFlushEn is >>>> set as >>>> on. This is not what we want. >>>> >>>> Just Like BKOP, We do not want flush happening beyond host's >>>> expected >>>> timing that device performance may be "randomly" dropped. >>> >>> Explicit flush takes place only when the device is idle: >>> if fWriteBoosterBufferFlushEn is set, the device is idle, and before >>> h8 received. >>> If a request arrives, the flush operation should be halted. >>> So no performance degradation is expected. >> >> Hi Stanley >> >> Avri's comment is correct, fWriteBoosterBufferFlushEn==1, device will >> flush only when it is in idle, once there is new incoming request, the >> flush will be suspended. You should be very careful when you want to >> skip this stetting of this flag. > > Very appreciate your the clarification. > > However similar to "Background Operations Termination Latency", while > the next request comes, device may need some time to suspend on-going > flush operations. This delay may "randomly" degrade the performance > right? > Have you actually seen this happening? I've not come across any random performance degradation concerns, hence asking. From what I've observed is the handling of WB buffer flush depends on how flash vendors implement it. Some vendors that I've seen just create a separate WB buffer in an instant. I don't know the intricacies of their implementation, but I guess the new WB buffer handles the requests while the previous one is being flushed. Anyway, for Qualcomm platforms we plan to have fWriteBoosterBufferFlushEn=1 by default. > Since the configuration, i.e., enable > fWriteBoosterBufferFlushDuringHibernate only with > fWriteBoosterBufferFlushEn disabled, has been applied in many of our > mass-produced products these yeas, we would like to keep it unless the > new setting has obvious benefits. > > Thanks, > Stanley Chu > >> >> Bean >> > -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-28 1:32 ` Asutosh Das (asd) @ 2020-12-28 2:00 ` Stanley Chu 0 siblings, 0 replies; 15+ messages in thread From: Stanley Chu @ 2020-12-28 2:00 UTC (permalink / raw) To: Asutosh Das (asd) Cc: jiajie.hao@mediatek.com, Bean Huo, 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, Can Guo, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, alice.chao@mediatek.com, chaotian.jing@mediatek.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, beanhuo@micron.com Hi Asutosh, On Sun, 2020-12-27 at 17:32 -0800, Asutosh Das (asd) wrote: > On 12/24/2020 5:47 AM, Stanley Chu wrote: > > Hi Avri, Bean, > > > > On Thu, 2020-12-24 at 13:01 +0100, Bean Huo wrote: > >> On Thu, 2020-12-24 at 11:03 +0000, Avri Altman wrote: > >>>>> Do you see any substantial benefit of having > >>>>> fWriteBoosterBufferFlushEn > >>>>> disabled? > >>>> > >>>> 1. The definition of fWriteBoosterBufferFlushEn is that host allows > >>>> device to do flush in anytime after fWriteBoosterBufferFlushEn is > >>>> set as > >>>> on. This is not what we want. > >>>> > >>>> Just Like BKOP, We do not want flush happening beyond host's > >>>> expected > >>>> timing that device performance may be "randomly" dropped. > >>> > >>> Explicit flush takes place only when the device is idle: > >>> if fWriteBoosterBufferFlushEn is set, the device is idle, and before > >>> h8 received. > >>> If a request arrives, the flush operation should be halted. > >>> So no performance degradation is expected. > >> > >> Hi Stanley > >> > >> Avri's comment is correct, fWriteBoosterBufferFlushEn==1, device will > >> flush only when it is in idle, once there is new incoming request, the > >> flush will be suspended. You should be very careful when you want to > >> skip this stetting of this flag. > > > > Very appreciate your the clarification. > > > > However similar to "Background Operations Termination Latency", while > > the next request comes, device may need some time to suspend on-going > > flush operations. This delay may "randomly" degrade the performance > > right? > > > > Have you actually seen this happening? I've not come across any random > performance degradation concerns, hence asking. > > From what I've observed is the handling of WB buffer flush depends on > how flash vendors implement it. Some vendors that I've seen just create > a separate WB buffer in an instant. I don't know the intricacies of > their implementation, but I guess the new WB buffer handles the requests > while the previous one is being flushed. > Anyway, for Qualcomm platforms we plan to have > fWriteBoosterBufferFlushEn=1 by default. Thanks for above information and discussion : ) Actually we've not come across any random performance degradation due to fWriteBoosterBufferFlushEn=1 as well. Since the implementation of fWriteBoosterBufferFlushEn may differ by different vendors, we would like to keep current configuration used in our mass-produced products first. But this is an interesting topic for possible termination latency of WriteBooster flush. Maybe we could discuss with vendors to explicitly define the required latency in UFS specification, just like "Background Operations Termination Latency"? Then host can choose the best configuration according to the definition provided by the device. Thanks. Stanley Chu > > > Since the configuration, i.e., enable > > fWriteBoosterBufferFlushDuringHibernate only with > > fWriteBoosterBufferFlushEn disabled, has been applied in many of our > > mass-produced products these yeas, we would like to keep it unless the > > new setting has obvious benefits. > > > > Thanks, > > Stanley Chu > > > >> > >> Bean > >> > > > > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL 2020-12-24 13:47 ` Stanley Chu 2020-12-28 1:32 ` Asutosh Das (asd) @ 2020-12-28 1:33 ` Can Guo 1 sibling, 0 replies; 15+ messages in thread From: Can Guo @ 2020-12-28 1:33 UTC (permalink / raw) To: Stanley Chu Cc: jiajie.hao, Bean Huo, linux-scsi, martin.petersen, andy.teng, jejb, chun-hung.wu, kuohong.wang, linux-kernel, cc.chou, Avri Altman, alice.chao, linux-mediatek, peter.wang, alim.akhtar, matthias.bgg, asutoshd, chaotian.jing, bvanassche, linux-arm-kernel, beanhuo On 2020-12-24 21:47, Stanley Chu wrote: > Hi Avri, Bean, > > On Thu, 2020-12-24 at 13:01 +0100, Bean Huo wrote: >> On Thu, 2020-12-24 at 11:03 +0000, Avri Altman wrote: >> > > > Do you see any substantial benefit of having >> > > > fWriteBoosterBufferFlushEn >> > > > disabled? >> > > >> > > 1. The definition of fWriteBoosterBufferFlushEn is that host allows >> > > device to do flush in anytime after fWriteBoosterBufferFlushEn is >> > > set as >> > > on. This is not what we want. >> > > >> > > Just Like BKOP, We do not want flush happening beyond host's >> > > expected >> > > timing that device performance may be "randomly" dropped. >> > >> > Explicit flush takes place only when the device is idle: >> > if fWriteBoosterBufferFlushEn is set, the device is idle, and before >> > h8 received. >> > If a request arrives, the flush operation should be halted. >> > So no performance degradation is expected. >> >> Hi Stanley >> >> Avri's comment is correct, fWriteBoosterBufferFlushEn==1, device will >> flush only when it is in idle, once there is new incoming request, the >> flush will be suspended. You should be very careful when you want to >> skip this stetting of this flag. > > Very appreciate your the clarification. > > However similar to "Background Operations Termination Latency", while > the next request comes, device may need some time to suspend on-going > flush operations. This delay may "randomly" degrade the performance > right? That can be case by case (or vendor by vendor), but generally I agree with you on this. > > Since the configuration, i.e., enable > fWriteBoosterBufferFlushDuringHibernate only with > fWriteBoosterBufferFlushEn disabled, has been applied in many of our > mass-produced products these yeas, we would like to keep it unless the > new setting has obvious benefits. Thanks for sharing the info. I will leave the decision to Asutosh on this. Thanks, Can Guo. > > Thanks, > Stanley Chu > >> >> Bean >> _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2020-12-28 13:00 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-12-22 7:29 [PATCH v1] scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Stanley Chu 2020-12-22 11:34 ` Can Guo 2020-12-23 4:19 ` Stanley Chu 2020-12-23 4:41 ` Can Guo 2020-12-23 7:47 ` Avri Altman 2020-12-23 8:35 ` Bean Huo 2020-12-28 12:59 ` Avri Altman 2020-12-24 2:21 ` Can Guo 2020-12-24 7:52 ` Stanley Chu 2020-12-24 11:03 ` Avri Altman 2020-12-24 12:01 ` Bean Huo 2020-12-24 13:47 ` Stanley Chu 2020-12-28 1:32 ` Asutosh Das (asd) 2020-12-28 2:00 ` Stanley Chu 2020-12-28 1:33 ` Can Guo
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).