[PATCH] accel: habanalabs: use alloc_ordered_workqueue()

Shi Hao posted 1 patch 3 months, 1 week ago
drivers/accel/habanalabs/common/device.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] accel: habanalabs: use alloc_ordered_workqueue()
Posted by Shi Hao 3 months, 1 week ago
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.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
---
 drivers/accel/habanalabs/common/device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
index 999c92d7036e..d100a59c31fb 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -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
Re: [PATCH] accel: habanalabs: use alloc_ordered_workqueue()
Posted by Sinyuk, Konstantin 2 months, 1 week ago
On 11/2/2025 2:25 PM, Shi Hao wrote:
> 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.
> 
> Signed-off-by: Shi Hao <i.shihao.999@gmail.com>

Applied to accel/habanalabs-next, thanks.