Skip to contentSkip to conversation

accel/amdxdna: spell out the ERT command state values

PATCH New Taimuraz Kaitmazov 1 participant 1 message Aug 26

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

PATCH 1/1 accel/amdxdna: spell out the ERT command state values

enum ert_cmd_state has no explicit values, but the enumerators are written into the command header that user space reads back from the shared command BO, so they are ABI. Inserting a state would silently renumber every value after it.

Assign them, as enum ert_cmd_opcode above already does.

---
 drivers/accel/amdxdna/amdxdna_ctx.h | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/accel/amdxdna/amdxdna_ctx.h +11 -10
index b6bef3af7dab..ef49b0c8a9d5 100644
@@ -22,17 +22,18 @@ enum ert_cmd_opcode {
 	ERT_INVALID_CMD	= ~0U,
 };
 
+/* Reported to user space in the command header, so the values are ABI. */
 enum ert_cmd_state {
-	ERT_CMD_STATE_INVALID,
-	ERT_CMD_STATE_NEW,
-	ERT_CMD_STATE_QUEUED,
-	ERT_CMD_STATE_RUNNING,
-	ERT_CMD_STATE_COMPLETED,
-	ERT_CMD_STATE_ERROR,
-	ERT_CMD_STATE_ABORT,
-	ERT_CMD_STATE_SUBMITTED,
-	ERT_CMD_STATE_TIMEOUT,
-	ERT_CMD_STATE_NORESPONSE,
+	ERT_CMD_STATE_INVALID = 0,
+	ERT_CMD_STATE_NEW = 1,
+	ERT_CMD_STATE_QUEUED = 2,
+	ERT_CMD_STATE_RUNNING = 3,
+	ERT_CMD_STATE_COMPLETED = 4,
+	ERT_CMD_STATE_ERROR = 5,
+	ERT_CMD_STATE_ABORT = 6,
+	ERT_CMD_STATE_SUBMITTED = 7,
+	ERT_CMD_STATE_TIMEOUT = 8,
+	ERT_CMD_STATE_NORESPONSE = 9,
 };
 
 /*
Signature · 1 line
2.55.0