Commit 34a5fab7 authored by Omer Shpigelman's avatar Omer Shpigelman Committed by Oded Gabbay

habanalabs: remove redundant CPU checks

This patch removes redundant CPU availability checks in:
goya_test_queues() - will be done in goya_test_cpu_queue().
goya_ring_doorbell() - was done earlier in goya_send_cpu_message().
Signed-off-by: default avatarOmer Shpigelman <oshpigelman@habana.ai>
Reviewed-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent cfc2f350
...@@ -2629,7 +2629,6 @@ static int goya_cb_mmap(struct hl_device *hdev, struct vm_area_struct *vma, ...@@ -2629,7 +2629,6 @@ static int goya_cb_mmap(struct hl_device *hdev, struct vm_area_struct *vma,
void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi) void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi)
{ {
u32 db_reg_offset, db_value; u32 db_reg_offset, db_value;
bool invalid_queue = false;
switch (hw_queue_id) { switch (hw_queue_id) {
case GOYA_QUEUE_ID_DMA_0: case GOYA_QUEUE_ID_DMA_0:
...@@ -2653,10 +2652,7 @@ void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi) ...@@ -2653,10 +2652,7 @@ void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi)
break; break;
case GOYA_QUEUE_ID_CPU_PQ: case GOYA_QUEUE_ID_CPU_PQ:
if (hdev->cpu_queues_enable) db_reg_offset = mmCPU_IF_PF_PQ_PI;
db_reg_offset = mmCPU_IF_PF_PQ_PI;
else
invalid_queue = true;
break; break;
case GOYA_QUEUE_ID_MME: case GOYA_QUEUE_ID_MME:
...@@ -2696,12 +2692,8 @@ void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi) ...@@ -2696,12 +2692,8 @@ void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi)
break; break;
default: default:
invalid_queue = true;
}
if (invalid_queue) {
/* Should never get here */ /* Should never get here */
dev_err(hdev->dev, "h/w queue %d is invalid. Can't set pi\n", dev_err(hdev->dev, "H/W queue %d is invalid. Can't set pi\n",
hw_queue_id); hw_queue_id);
return; return;
} }
...@@ -2990,11 +2982,9 @@ int goya_test_queues(struct hl_device *hdev) ...@@ -2990,11 +2982,9 @@ int goya_test_queues(struct hl_device *hdev)
ret_val = -EINVAL; ret_val = -EINVAL;
} }
if (hdev->cpu_queues_enable) { rc = goya_test_cpu_queue(hdev);
rc = goya_test_cpu_queue(hdev); if (rc)
if (rc) ret_val = -EINVAL;
ret_val = -EINVAL;
}
return ret_val; return ret_val;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment