Skip to contentSkip to conversation

scsi: ufs: revert HPB support

PATCH In review Christoph Hellwig 4 participants 6 messages Oct 22, 2021 – Oct 26, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufs: revert HPB support

The HPB support added this merge window is fundanetally flawed as it uses blk_insert_cloned_request to insert a cloned request onto the same queue as the one that the original request came from, leading to all kinds of issues in blk-mq accounting (in addition to this API being a special case for dm-mpath that should not see other users).

This reverts commits:

65ef27f7798b ("scsi: ufs: ufshpb: Remove unused parameters") 922ad26ebeaa ("scsi: ufs: ufshpb: Fix typo in comments")
6c9783e6296e ("scsi: ufs: ufshpb: Fix possible memory leak") 12bc2f13f381 ("scsi: ufs: ufshpb: Use scsi_cmd_to_rq() instead of scsi_cmnd.request") 10163cee1f06 ("scsi: ufs: ufshpb: Do not report victim error in HCM") 22aede9f48b6 ("scsi: ufs: ufshpb: Verify that 'num_inflight_map_req' is non-negative") 283e61c5a9be ("scsi: ufs: ufshpb: Rewind the read timeout on every read") 63522bf3aced ("scsi: ufs: core: Add L2P entry swap quirk for Micron UFS") f95f59a2bb60 ("scsi: ufs: ufshpb: Make host mode parameters configurable") 5dea655a09e6 ("scsi: ufs: ufshpb: Add support for host control mode") 1afb7ddadcad ("scsi: ufs: ufshpb: Do not send umap_all in host control mode") 33845a2d844b ("scsi: ufs: ufshpb: Limit the number of in-flight map requests") 13c044e91678 ("scsi: ufs: ufshpb: Add "cold" regions timer") 67001ff171cb ("scsi: ufs: ufshpb: Add HPB dev reset response") 6f4ad14f0fb9 ("scsi: ufs: ufshpb: Region inactivation in host mode") 6c59cb501b86 ("scsi: ufs: ufshpb: Make eviction depend on region's reads") c76a18885641 ("scsi: ufs: ufshpb: Add reads counter")
8becf4db1e01 ("scsi: ufs: ufshpb: Transform set_dirty to iterate_rgn") 3a2c1f680329 ("scsi: ufs: ufshpb: Add host control mode support to rsp_upiu") 119ee38c10fa ("scsi: ufs: ufshpb: Cache HPB Control mode on init") 07106f86ae13 ("scsi: ufs: ufshpb: Use a correct max multi chunk") 41d8a9333cc9 ("scsi: ufs: ufshpb: Add HPB 2.0 support")
2fff76f87542 ("scsi: ufs: ufshpb: Prepare HPB read for cached sub-region") 4b5f49079c52 ("scsi: ufs: ufshpb: L2P map management for HPB read") f02bc9754a68 ("scsi: ufs: ufshpb: Introduce Host Performance Buffer feature")

---
 Documentation/ABI/testing/sysfs-driver-ufs |  236 --
 drivers/scsi/ufs/Kconfig                   |    9 -
 drivers/scsi/ufs/Makefile                  |    1 -
 drivers/scsi/ufs/ufs-sysfs.c               |   22 -
 drivers/scsi/ufs/ufs.h                     |   54 +-
 drivers/scsi/ufs/ufs_quirks.h              |    6 -
 drivers/scsi/ufs/ufshcd.c                  |   76 +-
 drivers/scsi/ufs/ufshcd.h                  |   32 -
 drivers/scsi/ufs/ufshpb.c                  | 2931 --------------------
 drivers/scsi/ufs/ufshpb.h                  |  323 ---
 10 files changed, 3 insertions(+), 3687 deletions(-)
 delete mode 100644 drivers/scsi/ufs/ufshpb.c
 delete mode 100644 drivers/scsi/ufs/ufshpb.h
Documentation/ABI/testing/sysfs-driver-ufs +0 -236
index ec3a7149ced59..b4a5d55fa19f8 100644
@@ -1298,239 +1298,3 @@ Description:	This node is used to set or display whether UFS WriteBooster is
 		(if the platform supports UFSHCD_CAP_CLK_SCALING). For a
 		platform that doesn't support UFSHCD_CAP_CLK_SCALING, we can
 		disable/enable WriteBooster through this sysfs node.
-
-What:		/sys/bus/platform/drivers/ufshcd/*/device_descriptor/hpb_version
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the HPB specification version.
-		The full information about the descriptor can be found in the UFS
-		HPB (Host Performance Booster) Extension specifications.
-		Example: version 1.2.3 = 0123h
-
-		The file is read only.
-
-What:		/sys/bus/platform/drivers/ufshcd/*/device_descriptor/hpb_control
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows an indication of the HPB control mode.
-		00h: Host control mode
-		01h: Device control mode
-
-		The file is read only.
-
-What:		/sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_region_size
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the bHPBRegionSize which can be calculated
-		as in the following (in bytes):
-		HPB Region size = 512B * 2^bHPBRegionSize
-
-		The file is read only.
-
-What:		/sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_number_lu
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the maximum number of HPB LU supported	by
-		the device.
-		00h: HPB is not supported by the device.
-		01h ~ 20h: Maximum number of HPB LU supported by the device
-
-		The file is read only.
-
-What:		/sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_subregion_size
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the bHPBSubRegionSize, which can be
-		calculated as in the following (in bytes) and shall be a multiple of
-		logical block size:
-		HPB Sub-Region size = 512B x 2^bHPBSubRegionSize
-		bHPBSubRegionSize shall not exceed bHPBRegionSize.
-
-		The file is read only.
-
-What:		/sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_max_active_regions
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the maximum number of active HPB regions that
-		is supported by the device.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/unit_descriptor/hpb_lu_max_active_regions
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the maximum number of HPB regions assigned to
-		the HPB logical unit.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/unit_descriptor/hpb_pinned_region_start_offset
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the start offset of HPB pinned region.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/unit_descriptor/hpb_number_pinned_regions
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the number of HPB pinned regions assigned to
-		the HPB logical unit.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/hpb_stats/hit_cnt
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the number of reads that changed to HPB read.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/hpb_stats/miss_cnt
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the number of reads that cannot be changed to
-		HPB read.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/hpb_stats/rb_noti_cnt
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the number of response UPIUs that has
-		recommendations for activating sub-regions and/or inactivating region.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/hpb_stats/rb_active_cnt
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the number of active sub-regions recommended by
-		response UPIUs.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/hpb_stats/rb_inactive_cnt
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the number of inactive regions recommended by
-		response UPIUs.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/hpb_stats/map_req_cnt
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the number of read buffer commands for
-		activating sub-regions recommended by response UPIUs.
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/hpb_params/requeue_timeout_ms
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the requeue timeout threshold for write buffer
-		command in ms. The value can be changed by writing an integer to
-		this entry.
-
-What:		/sys/bus/platform/drivers/ufshcd/*/attributes/max_data_size_hpb_single_cmd
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the maximum HPB data size for using a single HPB
-		command.
-
-		===  ========
-		00h  4KB
-		01h  8KB
-		02h  12KB
-		...
-		FFh  1024KB
-		===  ========
-
-		The file is read only.
-
-What:		/sys/bus/platform/drivers/ufshcd/*/flags/hpb_enable
-Date:		June 2021
-Contact:	Daejun Park <[email protected]>
-Description:	This entry shows the status of HPB.
-
-		== ============================
-		0  HPB is not enabled.
-		1  HPB is enabled
-		== ============================
-
-		The file is read only.
-
-What:		/sys/class/scsi_device/*/device/hpb_param_sysfs/activation_thld
-Date:		February 2021
-Contact:	Avri Altman <[email protected]>
-Description:	In host control mode, reads are the major source of activation
-		trials.  Once this threshold hs met, the region is added to the
-		"to-be-activated" list.  Since we reset the read counter upon
-		write, this include sending a rb command updating the region
-		ppn as well.
-
-What:		/sys/class/scsi_device/*/device/hpb_param_sysfs/normalization_factor
-Date:		February 2021
-Contact:	Avri Altman <[email protected]>
-Description:	In host control mode, we think of the regions as "buckets".
-		Those buckets are being filled with reads, and emptied on write.
-		We use entries_per_srgn - the amount of blocks in a subregion as
-		our bucket size.  This applies because HPB1.0 only handles
-		single-block reads.  Once the bucket size is crossed, we trigger
-		a normalization work - not only to avoid overflow, but mainly
-		because we want to keep those counters normalized, as we are
-		using those reads as a comparative score, to make various decisions.
-		The normalization is dividing (shift right) the read counter by
-		the normalization_factor. If during consecutive normalizations
-		an active region has exhausted its reads - inactivate it.
-
-What:		/sys/class/scsi_device/*/device/hpb_param_sysfs/eviction_thld_enter
-Date:		February 2021
-Contact:	Avri Altman <[email protected]>
-Description:	Region deactivation is often due to the fact that eviction took
-		place: A region becomes active at the expense of another. This is
-		happening when the max-active-regions limit has been crossed.
-		In host mode, eviction is considered an extreme measure. We
-		want to verify that the entering region has enough reads, and
-		the exiting region has much fewer reads.  eviction_thld_enter is
-		the min reads that a region must have in order to be considered
-		a candidate for evicting another region.
-
-What:		/sys/class/scsi_device/*/device/hpb_param_sysfs/eviction_thld_exit
-Date:		February 2021
-Contact:	Avri Altman <[email protected]>
-Description:	Same as above for the exiting region. A region is considered to
-		be a candidate for eviction only if it has fewer reads than
-		eviction_thld_exit.
-
-What:		/sys/class/scsi_device/*/device/hpb_param_sysfs/read_timeout_ms
-Date:		February 2021
-Contact:	Avri Altman <[email protected]>
-Description:	In order not to hang on to "cold" regions, we inactivate
-		a region that has no READ access for a predefined amount of
-		time - read_timeout_ms. If read_timeout_ms has expired, and the
-		region is dirty, it is less likely that we can make any use of
-		HPB reading it so we inactivate it.  Still, deactivation has
-		its overhead, and we may still benefit from HPB reading this
-		region if it is clean - see read_timeout_expiries.
-
-What:		/sys/class/scsi_device/*/device/hpb_param_sysfs/read_timeout_expiries
-Date:		February 2021
-Contact:	Avri Altman <[email protected]>
-Description:	If the region read timeout has expired, but the region is clean,
-		just re-wind its timer for another spin.  Do that as long as it
-		is clean and did not exhaust its read_timeout_expiries threshold.
-
-What:		/sys/class/scsi_device/*/device/hpb_param_sysfs/timeout_polling_interval_ms
-Date:		February 2021
-Contact:	Avri Altman <[email protected]>
-Description:	The frequency with which the delayed worker that checks the
-		read_timeouts is awakened.
-
-What:		/sys/class/scsi_device/*/device/hpb_param_sysfs/inflight_map_req
-Date:		February 2021
-Contact:	Avri Altman <[email protected]>
-Description:	In host control mode the host is the originator of map requests.
-		To avoid flooding the device with map requests, use a simple throttling
-		mechanism that limits the number of inflight map requests.
drivers/scsi/ufs/Kconfig +0 -9
index 432df76e6318a..3d777375416c9 100644
@@ -184,15 +184,6 @@ config SCSI_UFS_CRYPTO
 	  capabilities of the UFS device (if present) to perform crypto
 	  operations on data being transferred to/from the device.
 
-config SCSI_UFS_HPB
-	bool "Support UFS Host Performance Booster"
-	depends on SCSI_UFSHCD
-	help
-	  The UFS HPB feature improves random read performance. It caches
-	  L2P (logical to physical) map of UFS to host DRAM. The driver uses HPB
-	  read command by piggybacking physical page number for bypassing FTL (flash
-	  translation layer)'s L2P address translation.
-
 config SCSI_UFS_FAULT_INJECTION
 	bool "UFS Fault Injection Support"
 	depends on SCSI_UFSHCD && FAULT_INJECTION
drivers/scsi/ufs/Makefile +0 -1
index c407da9b51713..006d502360791 100644
@@ -8,7 +8,6 @@ ufshcd-core-y				+= ufshcd.o ufs-sysfs.o
 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_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
drivers/scsi/ufs/ufs-sysfs.c +0 -22
index 5c405ff7b6eaa..386f3569b9ce8 100644
@@ -604,8 +604,6 @@ UFS_DEVICE_DESC_PARAM(device_version, _DEV_VER, 2);
 UFS_DEVICE_DESC_PARAM(number_of_secure_wpa, _NUM_SEC_WPA, 1);
 UFS_DEVICE_DESC_PARAM(psa_max_data_size, _PSA_MAX_DATA, 4);
 UFS_DEVICE_DESC_PARAM(psa_state_timeout, _PSA_TMT, 1);
-UFS_DEVICE_DESC_PARAM(hpb_version, _HPB_VER, 2);
-UFS_DEVICE_DESC_PARAM(hpb_control, _HPB_CONTROL, 1);
 UFS_DEVICE_DESC_PARAM(ext_feature_sup, _EXT_UFS_FEATURE_SUP, 4);
 UFS_DEVICE_DESC_PARAM(wb_presv_us_en, _WB_PRESRV_USRSPC_EN, 1);
 UFS_DEVICE_DESC_PARAM(wb_type, _WB_TYPE, 1);
@@ -638,8 +636,6 @@ static struct attribute *ufs_sysfs_device_descriptor[] = {
 	&dev_attr_number_of_secure_wpa.attr,
 	&dev_attr_psa_max_data_size.attr,
 	&dev_attr_psa_state_timeout.attr,
-	&dev_attr_hpb_version.attr,
-	&dev_attr_hpb_control.attr,
 	&dev_attr_ext_feature_sup.attr,
 	&dev_attr_wb_presv_us_en.attr,
 	&dev_attr_wb_type.attr,
@@ -713,10 +709,6 @@ UFS_GEOMETRY_DESC_PARAM(enh4_memory_max_alloc_units,
 	_ENM4_MAX_NUM_UNITS, 4);
 UFS_GEOMETRY_DESC_PARAM(enh4_memory_capacity_adjustment_factor,
 	_ENM4_CAP_ADJ_FCTR, 2);
-UFS_GEOMETRY_DESC_PARAM(hpb_region_size, _HPB_REGION_SIZE, 1);
-UFS_GEOMETRY_DESC_PARAM(hpb_number_lu, _HPB_NUMBER_LU, 1);
-UFS_GEOMETRY_DESC_PARAM(hpb_subregion_size, _HPB_SUBREGION_SIZE, 1);
-UFS_GEOMETRY_DESC_PARAM(hpb_max_active_regions, _HPB_MAX_ACTIVE_REGS, 2);
 UFS_GEOMETRY_DESC_PARAM(wb_max_alloc_units, _WB_MAX_ALLOC_UNITS, 4);
 UFS_GEOMETRY_DESC_PARAM(wb_max_wb_luns, _WB_MAX_WB_LUNS, 1);
 UFS_GEOMETRY_DESC_PARAM(wb_buff_cap_adj, _WB_BUFF_CAP_ADJ, 1);
@@ -754,10 +746,6 @@ static struct attribute *ufs_sysfs_geometry_descriptor[] = {
 	&dev_attr_enh3_memory_capacity_adjustment_factor.attr,
 	&dev_attr_enh4_memory_max_alloc_units.attr,
 	&dev_attr_enh4_memory_capacity_adjustment_factor.attr,
-	&dev_attr_hpb_region_size.attr,
-	&dev_attr_hpb_number_lu.attr,
-	&dev_attr_hpb_subregion_size.attr,
-	&dev_attr_hpb_max_active_regions.attr,
 	&dev_attr_wb_max_alloc_units.attr,
 	&dev_attr_wb_max_wb_luns.attr,
 	&dev_attr_wb_buff_cap_adj.attr,
@@ -1018,7 +1006,6 @@ UFS_FLAG(disable_fw_update, _PERMANENTLY_DISABLE_FW_UPDATE);
 UFS_FLAG(wb_enable, _WB_EN);
 UFS_FLAG(wb_flush_en, _WB_BUFF_FLUSH_EN);
 UFS_FLAG(wb_flush_during_h8, _WB_BUFF_FLUSH_DURING_HIBERN8);
-UFS_FLAG(hpb_enable, _HPB_EN);
 
 static struct attribute *ufs_sysfs_device_flags[] = {
 	&dev_attr_device_init.attr,
@@ -1032,7 +1019,6 @@ static struct attribute *ufs_sysfs_device_flags[] = {
 	&dev_attr_wb_enable.attr,
 	&dev_attr_wb_flush_en.attr,
 	&dev_attr_wb_flush_during_h8.attr,
-	&dev_attr_hpb_enable.attr,
 	NULL,
 };
 
@@ -1079,7 +1065,6 @@ out:									\
 static DEVICE_ATTR_RO(_name)
 
 UFS_ATTRIBUTE(boot_lun_enabled, _BOOT_LU_EN);
-UFS_ATTRIBUTE(max_data_size_hpb_single_cmd, _MAX_HPB_SINGLE_CMD);
 UFS_ATTRIBUTE(current_power_mode, _POWER_MODE);
 UFS_ATTRIBUTE(active_icc_level, _ACTIVE_ICC_LVL);
 UFS_ATTRIBUTE(ooo_data_enabled, _OOO_DATA_EN);
@@ -1103,7 +1088,6 @@ UFS_ATTRIBUTE(wb_cur_buf, _CURR_WB_BUFF_SIZE);
 
 static struct attribute *ufs_sysfs_attributes[] = {
 	&dev_attr_boot_lun_enabled.attr,
-	&dev_attr_max_data_size_hpb_single_cmd.attr,
 	&dev_attr_current_power_mode.attr,
 	&dev_attr_active_icc_level.attr,
 	&dev_attr_ooo_data_enabled.attr,
@@ -1177,9 +1161,6 @@ UFS_UNIT_DESC_PARAM(provisioning_type, _PROVISIONING_TYPE, 1);
 UFS_UNIT_DESC_PARAM(physical_memory_resourse_count, _PHY_MEM_RSRC_CNT, 8);
 UFS_UNIT_DESC_PARAM(context_capabilities, _CTX_CAPABILITIES, 2);
 UFS_UNIT_DESC_PARAM(large_unit_granularity, _LARGE_UNIT_SIZE_M1, 1);
-UFS_UNIT_DESC_PARAM(hpb_lu_max_active_regions, _HPB_LU_MAX_ACTIVE_RGNS, 2);
-UFS_UNIT_DESC_PARAM(hpb_pinned_region_start_offset, _HPB_PIN_RGN_START_OFF, 2);
-UFS_UNIT_DESC_PARAM(hpb_number_pinned_regions, _HPB_NUM_PIN_RGNS, 2);
 UFS_UNIT_DESC_PARAM(wb_buf_alloc_units, _WB_BUF_ALLOC_UNITS, 4);
 
 static struct attribute *ufs_sysfs_unit_descriptor[] = {
@@ -1197,9 +1178,6 @@ static struct attribute *ufs_sysfs_unit_descriptor[] = {
 	&dev_attr_physical_memory_resourse_count.attr,
 	&dev_attr_context_capabilities.attr,
 	&dev_attr_large_unit_granularity.attr,
-	&dev_attr_hpb_lu_max_active_regions.attr,
-	&dev_attr_hpb_pinned_region_start_offset.attr,
-	&dev_attr_hpb_number_pinned_regions.attr,
 	&dev_attr_wb_buf_alloc_units.attr,
 	NULL,
 };
drivers/scsi/ufs/ufs.h +1 -53

109 lines not on this page · raw message

drivers/scsi/ufs/ufs_quirks.h +0 -6
index 35ec9ea79869a..07f559ac5883a 100644
@@ -116,10 +116,4 @@ struct ufs_dev_fix {
  */
 #define UFS_DEVICE_QUIRK_DELAY_AFTER_LPM        (1 << 11)
 
-/*
- * Some UFS devices require L2P entry should be swapped before being sent to the
- * UFS device for HPB READ command.
- */
-#define UFS_DEVICE_QUIRK_SWAP_L2P_ENTRY_FOR_HPB_READ (1 << 12)
-
 #endif /* UFS_QUIRKS_H_ */
drivers/scsi/ufs/ufshcd.c +2 -74

193 lines not on this page · raw message

drivers/scsi/ufs/ufshcd.h +0 -32
index 41f6e06f91856..69f810b8c27ad 100644
@@ -662,31 +662,6 @@ struct ufs_hba_variant_params {
 	u32 wb_flush_threshold;
 };
 
-#ifdef CONFIG_SCSI_UFS_HPB
-/**
- * struct ufshpb_dev_info - UFSHPB device related info
- * @num_lu: the number of user logical unit to check whether all lu finished
- *          initialization
- * @rgn_size: device reported HPB region size
- * @srgn_size: device reported HPB sub-region size
- * @slave_conf_cnt: counter to check all lu finished initialization
- * @hpb_disabled: flag to check if HPB is disabled
- * @max_hpb_single_cmd: device reported bMAX_DATA_SIZE_FOR_SINGLE_CMD value
- * @is_legacy: flag to check HPB 1.0
- * @control_mode: either host or device
- */
-struct ufshpb_dev_info {
-	int num_lu;
-	int rgn_size;
-	int srgn_size;
-	atomic_t slave_conf_cnt;
-	bool hpb_disabled;
-	u8 max_hpb_single_cmd;
-	bool is_legacy;
-	u8 control_mode;
-};
-#endif
-
 struct ufs_hba_monitor {
 	unsigned long chunk_size;
 
@@ -901,10 +876,6 @@ struct ufs_hba {
 	struct request_queue	*bsg_queue;
 	struct delayed_work rpm_dev_flush_recheck_work;
 
-#ifdef CONFIG_SCSI_UFS_HPB
-	struct ufshpb_dev_info ufshpb_dev;
-#endif
-
 	struct ufs_hba_monitor	monitor;
 
 #ifdef CONFIG_SCSI_UFS_CRYPTO
@@ -1145,9 +1116,6 @@ int ufshcd_read_desc_param(struct ufs_hba *hba,
 			   u8 param_offset,
 			   u8 *param_read_buf,
 			   u8 param_size);
-int ufshcd_query_attr_retry(struct ufs_hba *hba, enum query_opcode opcode,
-			    enum attr_idn idn, u8 index, u8 selector,
-			    u32 *attr_val);
 int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,
 		      enum attr_idn idn, u8 index, u8 selector, u32 *attr_val);
 int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
drivers/scsi/ufs/ufshpb.c deleted +0 -2931

2,295 lines not on this page · raw message

drivers/scsi/ufs/ufshpb.h deleted +0 -323

323 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.30.2

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 5 lines · Christoph Hellwig

The HPB support added this merge window is fundanetally flawed as it uses blk_insert_cloned_request to insert a cloned request onto the same queue as the one that the original request came from, leading to all kinds of issues in blk-mq accounting (in addition to this API being a special case for dm-mpath that should not see other users).

I do not agree with removing the UFS HPB code from the upstream kernel at this time.

One of the HPB users promised to look into removing the blk_insert_cloned_request() call from the UFS HPB code. Shouldn't that person be given the chance to come up with a patch before removal of the UFS HPB code is considered?

Additionally, removing the UFS HPB code from the upstream kernel won't affect UFS users much. As far as I know all HPB users use Android. UFS HPB is supported by Android 12 and will also be supported by Android 13. Whether or not this patch is goes upstream won't affect the Android kernel. I am not aware of any plans to make any changes in the Android kernel UFS HPB code if this patch would be integrated in the upstream kernel.

Bart.

#2 lore raw
Quoted 15 lines · Bart Van Assche
Quoted 5 lines · Christoph Hellwig

The HPB support added this merge window is fundanetally flawed as it uses blk_insert_cloned_request to insert a cloned request onto the same queue as the one that the original request came from, leading to all kinds of issues in blk-mq accounting (in addition to this API being a special case for dm-mpath that should not see other users).

I do not agree with removing the UFS HPB code from the upstream kernel at this time.

One of the HPB users promised to look into removing the blk_insert_cloned_request() call from the UFS HPB code. Shouldn't that person be given the chance to come up with a patch before removal of the UFS HPB code is considered?

Quoted 6 lines

Additionally, removing the UFS HPB code from the upstream kernel won't affect UFS users much. As far as I know all HPB users use Android. UFS HPB is supported by Android 12 and will also be supported by Android 13. Whether or not this patch is goes upstream won't affect the Android kernel. I am not aware of any plans to make any changes in the Android kernel UFS HPB code if this patch would be integrated in the upstream kernel.

Under this line of reasoning, why would upstream take the code at all?

{sigh}

Is there a link to where the HPB developer said they would look into this? Perhaps until that happens this should be marked as BROKEN?

thanks,

greg k-h

#3 lore raw
Quoted 2 lines · Greg Kroah-Hartman

Is there a link to where the HPB developer said they would look into this? Perhaps until that happens this should be marked as BROKEN?

Hi Greg,

Daejun wrote the following on Thursday: "I will find out how to make the HPB code without blk_insert_cloned_request() API." Unfortunately that email was sent as MIME-encoded so it was only received by the people Cc-ed on that email and has not been archived by any of the websites that archives linux-scsi or linux-block emails. The email that I received is available below. I think it is fine to make this email public given the presence of two mailing lists in the Cc-list.

Thanks,

Bart.

-------- Forwarded Message --------
Subject: Re: please revert the UFS HPB support
Date: Fri, 22 Oct 2021 07:41:43 +0900
From: 박대준 <[email protected]>
To: Bart Van Assche <[email protected]>
CC: Christoph Hellwig <[email protected]>, Jens Axboe <[email protected]>, [email protected], [email protected], [email protected], Daejun Park <[email protected]>, Jaegeuk Kim <[email protected]>

Hi Bart,

2021년 10월 22일 (금) 오전 1:23, Bart Van Assche <[email protected] <mailto:[email protected]>>님이 작성:

On 10/21/21 8:17 AM, Christoph Hellwig wrote:
> On Thu, Oct 21, 2021 at 05:15:20PM +0200, Christoph Hellwig wrote:
>>>> I just noticed the UFS HPB support landed in 5.15, and just as >>>> before it is completely broken by allocating another request on >>>> the same device and then reinserting it in the queue. It is bad >>>> enough that we have to live with blk_insert_cloned_request for >>>> dm-mpath, but this is too big of an API abuse to make it into >>>> a release. We need to drop this code ASAP, and I can prepare >>>> a patch for that.
>>>
>>> That sounds awful, do you have a link to the offending commit(s)? >>
>> I'll need to look for it, busy in calls right now, but just grep for >> blk_insert_cloned_request.
>
> Might as well finish the git blame:
>
> commit 41d8a9333cc96f5ad4dd7a52786585338257d9f1
> Author: Daejun Park <[email protected] <mailto:[email protected]>>
> Date: Mon Jul 12 18:00:25 2021 +0900
>
> scsi: ufs: ufshpb: Add HPB 2.0 support
>
> Version 2.0 of HBP supports reads of varying sizes from 4KB to 1MB.
>
> A read operation <= 32KB is supported as single HPB read. A read between
> 36KB and 1MB is supported by a combination of write buffer command and HPB
> read command to deliver more PPN. The write buffer commands may not be
> issued immediately due to busy tags. To use HPB read more aggressively, the
> driver can requeue the write buffer command. The requeue threshold is
> implemented as timeout and can be modified with requeue_timeout_ms entry in
> sysfs.

(+Daejun)

Daejun, can the HPB code be reworked such that it does not use blk_insert_cloned_request()? I'm concerned that if the HPB code is not reworked that it will be removed from the upstream kernel.

Thanks,

Bart.

I will find out how to make the HPB code without blk_insert_cloned_request() API.

Thanks,
Daejun

#4 lore raw
In reply to Greg Kroah-Hartman

Greg,

Quoted 3 lines

Under this line of reasoning, why would upstream take the code at all?

{sigh}

Sigh indeed.

Quoted 2 lines

Is there a link to where the HPB developer said they would look into this? Perhaps until that happens this should be marked as BROKEN?

I say we just mark it broken for now.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#5 lore raw
Quoted 5 lines · Martin K. Petersen

Greg,

Quoted 2 lines

Under this line of reasoning, why would upstream take the code at all?

Quoted 8 lines
Quoted 1 line

{sigh}

Sigh indeed.

Quoted 2 lines

Is there a link to where the HPB developer said they would look into this? Perhaps until that happens this should be marked as BROKEN?

I say we just mark it broken for now.

I've sent a patch.