habanalabs: print the queue id in case of an error
authorDotan Barak <dbarak@habana.ai>
Thu, 6 Aug 2020 06:20:49 +0000 (09:20 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 22 Sep 2020 15:49:49 +0000 (18:49 +0300)
If there is a failure during the testing of a queue,
to ease up debugging - print the queue id.

Signed-off-by: Dotan Barak <dbarak@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c

index 45ba3a5..89d44cd 100644 (file)
@@ -3448,7 +3448,8 @@ static int gaudi_test_queue(struct hl_device *hdev, u32 hw_queue_id)
                                                        &fence_dma_addr);
        if (!fence_ptr) {
                dev_err(hdev->dev,
-                       "Failed to allocate memory for queue testing\n");
+                       "Failed to allocate memory for H/W queue %d testing\n",
+                       hw_queue_id);
                return -ENOMEM;
        }
 
@@ -3459,7 +3460,8 @@ static int gaudi_test_queue(struct hl_device *hdev, u32 hw_queue_id)
                                        GFP_KERNEL, &pkt_dma_addr);
        if (!fence_pkt) {
                dev_err(hdev->dev,
-                       "Failed to allocate packet for queue testing\n");
+                       "Failed to allocate packet for H/W queue %d testing\n",
+                       hw_queue_id);
                rc = -ENOMEM;
                goto free_fence_ptr;
        }
@@ -3476,7 +3478,8 @@ static int gaudi_test_queue(struct hl_device *hdev, u32 hw_queue_id)
                                        pkt_dma_addr);
        if (rc) {
                dev_err(hdev->dev,
-                       "Failed to send fence packet\n");
+                       "Failed to send fence packet to H/W queue %d\n",
+                       hw_queue_id);
                goto free_pkt;
        }
 
index 954f2c0..ac4d44f 100644 (file)
@@ -2946,7 +2946,8 @@ int goya_test_queue(struct hl_device *hdev, u32 hw_queue_id)
                                                        &fence_dma_addr);
        if (!fence_ptr) {
                dev_err(hdev->dev,
-                       "Failed to allocate memory for queue testing\n");
+                       "Failed to allocate memory for H/W queue %d testing\n",
+                       hw_queue_id);
                return -ENOMEM;
        }
 
@@ -2957,7 +2958,8 @@ int goya_test_queue(struct hl_device *hdev, u32 hw_queue_id)
                                        GFP_KERNEL, &pkt_dma_addr);
        if (!fence_pkt) {
                dev_err(hdev->dev,
-                       "Failed to allocate packet for queue testing\n");
+                       "Failed to allocate packet for H/W queue %d testing\n",
+                       hw_queue_id);
                rc = -ENOMEM;
                goto free_fence_ptr;
        }
@@ -2974,7 +2976,8 @@ int goya_test_queue(struct hl_device *hdev, u32 hw_queue_id)
                                        pkt_dma_addr);
        if (rc) {
                dev_err(hdev->dev,
-                       "Failed to send fence packet\n");
+                       "Failed to send fence packet to H/W queue %d\n",
+                       hw_queue_id);
                goto free_pkt;
        }