Skip to contentSkip to conversation

habanalabs: expose a single cs seq in staged submissions

PATCH New Oded Gabbay 1 participant 1 message Sep 14, 2021 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 habanalabs: expose a single cs seq in staged submissions

From: Ofir Bitton <[email protected]>

Staged submission consists of multiple command submissions. In order to be explicit, driver should return a single cs sequence for every cs in the submission, or else user may try to wait on an internal CS rather than waiting for the whole submission.

---
 drivers/misc/habanalabs/common/command_submission.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/misc/habanalabs/common/command_submission.c +6 -0
index a4ed91ed991d..91b57544f7c6 100644
@@ -1295,6 +1295,12 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
 	if (rc)
 		goto free_cs_object;
 
+	/* If this is a staged submission we must return the staged sequence
+	 * rather than the internal CS sequence
+	 */
+	if (cs->staged_cs)
+		*cs_seq = cs->staged_sequence;
+
 	/* Validate ALL the CS chunks before submitting the CS */
 	for (i = 0 ; i < num_chunks ; i++) {
 		struct hl_cs_chunk *chunk = &cs_chunk_array[i];
Signature · 1 line
2.17.1