答复: [External Mail]Re: [PATCH] scsi: ufs: ufsfbo: Introduce File Based Optimization feature

From: 李佳铭
Date: Wed Aug 24 2022 - 11:27:18 EST


Hi Bean
This is a UFS extended feature in UFS4.0 JEDEC Standard
Thanks

-----邮件原件-----
发件人: Bean Huo <huobean@xxxxxxxxx>
发送时间: 2022年8月24日 22:17
收件人: Jiaming Li <lijiamingsofine@xxxxxxxxx>; avri.altman@xxxxxxx; alim.akhtar@xxxxxxxxxxx; jejb@xxxxxxxxxxxxx; bvanassche@xxxxxxx
抄送: linux-scsi@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; 李佳铭 <lijiaming3@xxxxxxxxxx>
主题: [External Mail]Re: [PATCH] scsi: ufs: ufsfbo: Introduce File Based Optimization feature

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。

On Wed, 2022-08-24 at 16:46 +0800, Jiaming Li wrote:
> From: lijiaming3 <lijiaming3@xxxxxxxxxx>
>
> Implement File Based Optimization initialization and add sysfs
> interface.
>
> Stoage devices have a long lifespan. Device performance over its
> lifespan is not constant and may deteriorate over time
>
> This feature describes a method to improve the performance regression.
> The host needs to provide File System information to storage device
> first. Based on that information device analyzes the file system data
> and provides the host the level of performance regression. The host
> then may instruct the device to execute optimization procedure to
> improve the regression level.
>
> Signed-off-by: lijiaming3 <lijiaming3@xxxxxxxxxx>
> ---
> arch/arm64/configs/defconfig | 1 +
> drivers/scsi/ufs/Kconfig | 9 +
> drivers/scsi/ufs/Makefile | 1 +
> drivers/scsi/ufs/ufs.h | 13 +
> drivers/scsi/ufs/ufsfbo.c | 1007
> ++++++++++++++++++++++++++++++++++
> drivers/scsi/ufs/ufsfbo.h | 143 +++++
> drivers/scsi/ufs/ufshcd.c | 15 +
> drivers/scsi/ufs/ufshcd.h | 7 +-
> 8 files changed, 1195 insertions(+), 1 deletion(-) create mode
> 100644 drivers/scsi/ufs/ufsfbo.c create mode 100644
> drivers/scsi/ufs/ufsfbo.h
>
> diff --git a/arch/arm64/configs/defconfig
> b/arch/arm64/configs/defconfig index 4972a81d40d6..1363c237b6f3 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -289,6 +289,7 @@ CONFIG_SCSI_UFSHCD_PLATFORM=y
> CONFIG_SCSI_UFS_QCOM=m CONFIG_SCSI_UFS_HISI=y
> CONFIG_SCSI_UFS_EXYNOS=y
> +CONFIG_SCSI_UFS_FBO=y
> CONFIG_ATA=y
> CONFIG_SATA_AHCI=y
> CONFIG_SATA_AHCI_PLATFORM=y
> diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index
> 432df76e6318..57b0e8b14543 100644
> --- a/drivers/scsi/ufs/Kconfig
> +++ b/drivers/scsi/ufs/Kconfig
> @@ -199,3 +199,12 @@ config SCSI_UFS_FAULT_INJECTION
> help
> Enable fault injection support in the UFS driver. This makes
> it easier
> to test the UFS error handler and abort handler.
> +
> +config SCSI_UFS_FBO
> + bool "Support UFS File-based Optimization"
> + depends on SCSI_UFSHCD
> + help
> + The UFS FBO feature improves Sequential read performance.
> The Host can
> + send the LBA to device. The device will return a fragmented
> state. It
> + is up to the host to decide whether to defrag. After
> defragment,
> + Sequential read performance is improved
> \ No newline at end of file
> diff --git a/drivers/scsi/ufs/Makefile b/drivers/scsi/ufs/Makefile
> index c407da9b5171..956be0738263 100644
> --- a/drivers/scsi/ufs/Makefile
> +++ b/drivers/scsi/ufs/Makefile
> @@ -9,6 +9,7 @@ ufshcd-core-$(CONFIG_DEBUG_FS) += ufs-
> debugfs.o
> ufshcd-core-$(CONFIG_SCSI_UFS_BSG) += ufs_bsg.o
> ufshcd-core-$(CONFIG_SCSI_UFS_CRYPTO) += ufshcd-crypto.o
> ufshcd-core-$(CONFIG_SCSI_UFS_HPB) += ufshpb.o
> +ufshcd-core-$(CONFIG_SCSI_UFS_FBO) += ufsfbo.o
> ufshcd-core-$(CONFIG_SCSI_UFS_FAULT_INJECTION) += ufs-fault-
> injection.o
>
> obj-$(CONFIG_SCSI_UFS_DWC_TC_PCI) += tc-dwc-g210-pci.o ufshcd-dwc.o
> tc-dwc-g210.o diff --git a/drivers/scsi/ufs/ufs.h
> b/drivers/scsi/ufs/ufs.h index 8c6b38b1b142..b750ce3f7de9 100644
> --- a/drivers/scsi/ufs/ufs.h
> +++ b/drivers/scsi/ufs/ufs.h
> @@ -170,6 +170,7 @@ enum desc_idn {
> QUERY_DESC_IDN_GEOMETRY = 0x7,
> QUERY_DESC_IDN_POWER = 0x8,
> QUERY_DESC_IDN_HEALTH = 0x9,
> + QUERY_DESC_IDN_FBO = 0xA,
Hi Jiaming,

Is this a UFS extended standard or vendor specific feature?



#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#