From: Martin K. Petersen Date: Tue, 29 Apr 2025 00:56:57 +0000 (-0400) Subject: Merge branch '6.15/scsi-fixes' into 6.16/scsi-staging X-Git-Tag: v6.16-rc1~116^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c400df513b7c2ba9f2240eb9c325fa21aa8d950;p=thirdparty%2Flinux.git Merge branch '6.15/scsi-fixes' into 6.16/scsi-staging Pull in fixes from 6.15 and resolve a few conflicts so we can have a clean base for UFS patches. Signed-off-by: Martin K. Petersen --- 3c400df513b7c2ba9f2240eb9c325fa21aa8d950 diff --cc Documentation/ABI/testing/sysfs-driver-ufs index e7b49bc894f57,e36d2de16cbda..d4140dc6c5ba2 --- a/Documentation/ABI/testing/sysfs-driver-ufs +++ b/Documentation/ABI/testing/sysfs-driver-ufs @@@ -1605,51 -1605,34 +1605,83 @@@ Description The attribute is read/write. + What: /sys/bus/platform/drivers/ufshcd/*/device_lvl_exception_count + What: /sys/bus/platform/devices/*.ufs/device_lvl_exception_count + Date: March 2025 + Contact: Bao D. Nguyen + Description: + This attribute is applicable to ufs devices compliant to the + JEDEC specifications version 4.1 or later. The + device_lvl_exception_count is a counter indicating the number of + times the device level exceptions have occurred since the last + time this variable is reset. Writing a 0 value to this + attribute will reset the device_lvl_exception_count. If the + device_lvl_exception_count reads a positive value, the user + application should read the device_lvl_exception_id attribute to + know more information about the exception. + + The attribute is read/write. + + What: /sys/bus/platform/drivers/ufshcd/*/device_lvl_exception_id + What: /sys/bus/platform/devices/*.ufs/device_lvl_exception_id + Date: March 2025 + Contact: Bao D. Nguyen + Description: + Reading the device_lvl_exception_id returns the + qDeviceLevelExceptionID attribute of the ufs device JEDEC + specification version 4.1. The definition of the + qDeviceLevelExceptionID is the ufs device vendor specific + implementation. Refer to the device manufacturer datasheet for + more information on the meaning of the qDeviceLevelExceptionID + attribute value. + + The attribute is read only. ++ +What: /sys/bus/platform/drivers/ufshcd/*/wb_resize_enable +What: /sys/bus/platform/devices/*.ufs/wb_resize_enable +Date: April 2025 +Contact: Huan Tang +Description: + The host can enable the WriteBooster buffer resize by setting this + attribute. + + ======== ====================================== + idle There is no resize operation + decrease Decrease WriteBooster buffer size + increase Increase WriteBooster buffer size + ======== ====================================== + + The file is write only. + +What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_resize_hint +What: /sys/bus/platform/devices/*.ufs/attributes/wb_resize_hint +Date: April 2025 +Contact: Huan Tang +Description: + wb_resize_hint indicates hint information about which type of resize + for WriteBooster buffer is recommended by the device. + + ========= ====================================== + keep Recommend keep the buffer size + decrease Recommend to decrease the buffer size + increase Recommend to increase the buffer size + ========= ====================================== + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_resize_status +What: /sys/bus/platform/devices/*.ufs/attributes/wb_resize_status +Date: April 2025 +Contact: Huan Tang +Description: + The host can check the resize operation status of the WriteBooster + buffer by reading this attribute. + + ================ ======================================== + idle Resize operation is not issued + in_progress Resize operation in progress + complete_success Resize operation completed successfully + general_failure Resize operation general failure + ================ ======================================== + + The file is read only. diff --cc drivers/ufs/core/ufshcd.c index be65fc4b5ccd3,5cb6132b8147a..dc55c94fa45e5 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@@ -6080,22 -6107,7 +6104,22 @@@ int ufshcd_wb_toggle_buf_flush(struct u return ret; } +int ufshcd_wb_set_resize_en(struct ufs_hba *hba, enum wb_resize_en en_mode) +{ + int ret; + u8 index; + + index = ufshcd_wb_get_query_index(hba); + ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_WRITE_ATTR, + QUERY_ATTR_IDN_WB_BUF_RESIZE_EN, index, 0, &en_mode); + if (ret) + dev_err(hba->dev, "%s: Enable WB buf resize operation failed %d\n", + __func__, ret); + + return ret; +} + - static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba, + static bool ufshcd_wb_curr_buff_threshold_check(struct ufs_hba *hba, u32 avail_buf) { u32 cur_buf; diff --cc include/ufs/ufs.h index 9188f7aa99dab,1c47136d8715f..c0c59a8f72560 --- a/include/ufs/ufs.h +++ b/include/ufs/ufs.h @@@ -181,9 -181,7 +181,10 @@@ enum attr_idn QUERY_ATTR_IDN_WB_BUFF_LIFE_TIME_EST = 0x1E, QUERY_ATTR_IDN_CURR_WB_BUFF_SIZE = 0x1F, QUERY_ATTR_IDN_TIMESTAMP = 0x30, + QUERY_ATTR_IDN_DEV_LVL_EXCEPTION_ID = 0x34, + QUERY_ATTR_IDN_WB_BUF_RESIZE_HINT = 0x3C, + QUERY_ATTR_IDN_WB_BUF_RESIZE_EN = 0x3D, + QUERY_ATTR_IDN_WB_BUF_RESIZE_STATUS = 0x3E, }; /* Descriptor idn for Query requests */