summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/command_submission.c
diff options
context:
space:
mode:
authorOfir Bitton <obitton@habana.ai>2020-07-05 12:35:51 +0200
committerOded Gabbay <oded.gabbay@gmail.com>2020-07-24 19:31:37 +0200
commit5574cb2194b13de78df68cd32655ddbe619b1251 (patch)
tree06fbeb940ec1a0c8eb172743859e105b29cd72df /drivers/misc/habanalabs/command_submission.c
parenthabanalabs: halt device CPU only upon certain reset (diff)
downloadlinux-5574cb2194b13de78df68cd32655ddbe619b1251.tar.xz
linux-5574cb2194b13de78df68cd32655ddbe619b1251.zip
habanalabs: Assign each CQ with its own work queue
We identified a possible race during job completion when working with a single multi-threaded work queue. In order to overcome this race we suggest using a single threaded work queue per completion queue, hence we guarantee jobs completion in order. Signed-off-by: Ofir Bitton <obitton@habana.ai> Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/misc/habanalabs/command_submission.c')
-rw-r--r--drivers/misc/habanalabs/command_submission.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/command_submission.c b/drivers/misc/habanalabs/command_submission.c
index 7769a1aacca1..c605be89f764 100644
--- a/drivers/misc/habanalabs/command_submission.c
+++ b/drivers/misc/habanalabs/command_submission.c
@@ -487,10 +487,12 @@ static void cs_rollback(struct hl_device *hdev, struct hl_cs *cs)
void hl_cs_rollback_all(struct hl_device *hdev)
{
+ int i;
struct hl_cs *cs, *tmp;
/* flush all completions */
- flush_workqueue(hdev->cq_wq);
+ for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++)
+ flush_workqueue(hdev->cq_wq[i]);
/* Make sure we don't have leftovers in the H/W queues mirror list */
list_for_each_entry_safe(cs, tmp, &hdev->hw_queues_mirror_list,