linux-next: manual merge of the scsi-mkp tree with the scsi-fixes and scsi trees

From: Stephen Rothwell
Date: Mon Apr 14 2025 - 00:56:56 EST


Hi all,

Today's linux-next merge of the scsi-mkp tree got conflicts in:

Documentation/ABI/testing/sysfs-driver-ufs
drivers/ufs/core/ufshcd.c
include/ufs/ufs.h

between commits:

bdab40480b14 ("scsi: ufs: core: Rename ufshcd_wb_presrv_usrspc_keep_vcc_on()")
1fd2e77b8897 ("scsi: ufs: core: Add device level exception support")

from the scsi-fixes and scsi trees and commit:

500d4b742e0c ("scsi: ufs: core: Add WB buffer resize support")

from the scsi-mkp tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc Documentation/ABI/testing/sysfs-driver-ufs
index e36d2de16cbd,e7b49bc894f5..000000000000
--- a/Documentation/ABI/testing/sysfs-driver-ufs
+++ b/Documentation/ABI/testing/sysfs-driver-ufs
@@@ -1605,34 -1605,51 +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 <quic_nguyenb@xxxxxxxxxxx>
+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 <quic_nguyenb@xxxxxxxxxxx>
+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 <tanghuan@xxxxxxxx>
+ 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 <tanghuan@xxxxxxxx>
+ 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 <tanghuan@xxxxxxxx>
+ 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 ca2b0aae9d11,be65fc4b5ccd..000000000000
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@@ -6105,7 -6080,22 +6102,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 1c47136d8715,9188f7aa99da..000000000000
--- a/include/ufs/ufs.h
+++ b/include/ufs/ufs.h
@@@ -181,7 -181,9 +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 */

Attachment: pgpjWE1g02m3o.pgp
Description: OpenPGP digital signature