habanalabs: print CS type when it is stuck
authorOded Gabbay <ogabbay@kernel.org>
Mon, 16 Nov 2020 08:25:53 +0000 (10:25 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 30 Nov 2020 08:47:36 +0000 (10:47 +0200)
We have several types of command submissions and the user wants to know
which type of command submission has not finished in time when that
event occurs. This is very helpful for debug.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/command_submission.c

index 749ec6c95fc23d31ac09b614cc2d5bddb130d9a2..7309dd2b88a9a952239614c46ef274b24edf4c46 100644 (file)
@@ -418,9 +418,31 @@ static void cs_timedout(struct work_struct *work)
 
        hdev = cs->ctx->hdev;
 
-       dev_err(hdev->dev,
-               "Command submission %llu has not finished in time!\n",
-               cs->sequence);
+       switch (cs->type) {
+       case CS_TYPE_SIGNAL:
+               dev_err(hdev->dev,
+                       "Signal command submission %llu has not finished in time!\n",
+                       cs->sequence);
+               break;
+
+       case CS_TYPE_WAIT:
+               dev_err(hdev->dev,
+                       "Wait command submission %llu has not finished in time!\n",
+                       cs->sequence);
+               break;
+
+       case CS_TYPE_COLLECTIVE_WAIT:
+               dev_err(hdev->dev,
+                       "Collective Wait command submission %llu has not finished in time!\n",
+                       cs->sequence);
+               break;
+
+       default:
+               dev_err(hdev->dev,
+                       "Command submission %llu has not finished in time!\n",
+                       cs->sequence);
+               break;
+       }
 
        cs_put(cs);