Skip to contentSkip to conversation

accel: habanalabs: use alloc_ordered_workqueue()

PATCH Applied Shi Hao 2 participants 2 messages Nov 2, 2025 – Nov 29, 2025

Subsystems (2)
lore
Share & tools
lore

Shi Hao

author
#0 lore raw

PATCH 1/1 accel: habanalabs: use alloc_ordered_workqueue()

Replace the deprecated create_singlethread_workqueue() functions with alloc_ordered_workqueue() since it aligns with current workqueue API modernization efforts. The conversion is safe since destroy_workqueue() is used for cleanup in both cases.

No functional changes intended.

---
 drivers/accel/habanalabs/common/device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/accel/habanalabs/common/device.c +3 -3
index 999c92d7036e..d100a59c31fb 100644
@@ -903,7 +903,7 @@ static int device_early_init(struct hl_device *hdev)
 
 	for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++) {
 		snprintf(workq_name, 32, "hl%u-free-jobs-%u", hdev->cdev_idx, (u32) i);
-		hdev->cq_wq[i] = create_singlethread_workqueue(workq_name);
+		hdev->cq_wq[i] = alloc_ordered_workqueue(workq_name, 0);
 		if (hdev->cq_wq[i] == NULL) {
 			dev_err(hdev->dev, "Failed to allocate CQ workqueue\n");
 			rc = -ENOMEM;
@@ -912,7 +912,7 @@ static int device_early_init(struct hl_device *hdev)
 	}
 
 	snprintf(workq_name, 32, "hl%u-events", hdev->cdev_idx);
-	hdev->eq_wq = create_singlethread_workqueue(workq_name);
+	hdev->eq_wq = alloc_ordered_workqueue(workq_name, 0);
 	if (hdev->eq_wq == NULL) {
 		dev_err(hdev->dev, "Failed to allocate EQ workqueue\n");
 		rc = -ENOMEM;
@@ -958,7 +958,7 @@ static int device_early_init(struct hl_device *hdev)
 	hl_mem_mgr_init(hdev->dev, &hdev->kernel_mem_mgr);
 
 	snprintf(workq_name, 32, "hl%u_device_reset", hdev->cdev_idx);
-	hdev->reset_wq = create_singlethread_workqueue(workq_name);
+	hdev->reset_wq = alloc_ordered_workqueue(workq_name, 0);
 	if (!hdev->reset_wq) {
 		rc = -ENOMEM;
 		dev_err(hdev->dev, "Failed to create device reset WQ\n");

--
2.51.0

maintainer Applied
#1 lore raw
Quoted 8 lines · Shi Hao

Replace the deprecated create_singlethread_workqueue() functions with alloc_ordered_workqueue() since it aligns with current workqueue API modernization efforts. The conversion is safe since destroy_workqueue() is used for cleanup in both cases.

No functional changes intended.

Applied to accel/habanalabs-next, thanks.