Skip to contentSkip to conversation

ufs: core: Move the tracing enumeration types into a new file

PATCH Applied Bart Van Assche 3 participants 4 messages Aug 29, 2025 – Sep 10, 2025

Subsystems (2)
lore
Share & tools
lore

Bart Van Assche

author reviewer
#0 lore raw

PATCH 1/1 ufs: core: Move the tracing enumeration types into a new file

The <ufs/ufs.h> header file defines constants and data structures related to the UFS standard. Move the enumeration types related to tracing into a new header file because these are not defined in the UFS standard. An intended side effect of this patch is that the tracing enumeration types are no longer visible to UFS host drivers.

---
 drivers/ufs/core/ufs_trace.h       |  1 +
 drivers/ufs/core/ufs_trace_types.h | 24 ++++++++++++++++++++++++
 include/ufs/ufs.h                  | 17 -----------------
 3 files changed, 25 insertions(+), 17 deletions(-)
 create mode 100644 drivers/ufs/core/ufs_trace_types.h
drivers/ufs/core/ufs_trace.h +1 -0
index caa32e23ffa5..584c2b5c6ad9 100644
@@ -11,6 +11,7 @@
 
 #include <ufs/ufs.h>
 #include <linux/tracepoint.h>
+#include "ufs_trace_types.h"
 
 #define str_opcode(opcode)						\
 	__print_symbolic(opcode,					\
drivers/ufs/core/ufs_trace_types.h new file +24 -0
new file mode 100644
index 000000000000..f2d5ad1d92b9
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _UFS_TRACE_TYPES_H_
+#define _UFS_TRACE_TYPES_H_
+
+enum ufs_trace_str_t {
+	UFS_CMD_SEND,
+	UFS_CMD_COMP,
+	UFS_DEV_COMP,
+	UFS_QUERY_SEND,
+	UFS_QUERY_COMP,
+	UFS_QUERY_ERR,
+	UFS_TM_SEND,
+	UFS_TM_COMP,
+	UFS_TM_ERR
+};
+
+enum ufs_trace_tsf_t {
+	UFS_TSF_CDB,
+	UFS_TSF_OSF,
+	UFS_TSF_TM_INPUT,
+	UFS_TSF_TM_OUTPUT
+};
+
+#endif /* _UFS_TRACE_TYPES_H_ */
include/ufs/ufs.h +0 -17
index 72fd385037a6..245a6a829ce9 100644
@@ -653,21 +653,4 @@ struct ufs_dev_info {
 	bool hid_sup;
 };
 
-/*
- * This enum is used in string mapping in ufs_trace.h.
- */
-enum ufs_trace_str_t {
-	UFS_CMD_SEND, UFS_CMD_COMP, UFS_DEV_COMP,
-	UFS_QUERY_SEND, UFS_QUERY_COMP, UFS_QUERY_ERR,
-	UFS_TM_SEND, UFS_TM_COMP, UFS_TM_ERR
-};
-
-/*
- * Transaction Specific Fields (TSF) type in the UPIU package, this enum is
- * used in ufs_trace.h for UFS command trace.
- */
-enum ufs_trace_tsf_t {
-	UFS_TSF_CDB, UFS_TSF_OSF, UFS_TSF_TM_INPUT, UFS_TSF_TM_OUTPUT
-};
-
 #endif /* End of Header */
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines

The <ufs/ufs.h> header file defines constants and data structures related to the UFS standard. Move the enumeration types related to tracing into a new header file because these are not defined in the UFS standard. An intended side effect of this patch is that the tracing enumeration types are no longer visible to UFS host drivers.

#2 lore raw
In reply to Bart Van Assche

Bart,

Quoted 5 lines

The <ufs/ufs.h> header file defines constants and data structures related to the UFS standard. Move the enumeration types related to tracing into a new header file because these are not defined in the UFS standard. An intended side effect of this patch is that the tracing enumeration types are no longer visible to UFS host drivers.

Applied to 6.18/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen
#3 lore raw
In reply to Bart Van Assche
Quoted 8 lines · Bart Van Assche

The <ufs/ufs.h> header file defines constants and data structures related to the UFS standard. Move the enumeration types related to tracing into a new header file because these are not defined in the UFS standard. An intended side effect of this patch is that the tracing enumeration types are no longer visible to UFS host drivers.

[...]

Applied to 6.18/scsi-queue, thanks!

[1/1] ufs: core: Move the tracing enumeration types into a new file

      https://git.kernel.org/mkp/scsi/c/b620462bba66
Signature · 1 line
Martin K. Petersen