]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
accel/ivpu: replace use of system_wq with system_percpu_wq
authorMarco Crivellari <marco.crivellari@suse.com>
Wed, 29 Oct 2025 16:56:42 +0000 (17:56 +0100)
committerKarol Wachowski <karol.wachowski@linux.intel.com>
Thu, 30 Oct 2025 07:40:40 +0000 (08:40 +0100)
Currently if a user enqueue a work item using schedule_delayed_work() the
used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
schedule_work() that is using system_wq and queue_work(), that makes use
again of WORK_CPU_UNBOUND.

This lack of consistency cannot be addressed without refactoring the API.

system_wq should be the per-cpu workqueue, yet in this name nothing makes
that clear, so replace system_wq with system_percpu_wq.

The old wq (system_wq) will be kept for a few release cycles.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20251029165642.364488-3-marco.crivellari@suse.com
drivers/accel/ivpu/ivpu_hw_btrs.c
drivers/accel/ivpu/ivpu_ipc.c
drivers/accel/ivpu/ivpu_job.c
drivers/accel/ivpu/ivpu_mmu.c
drivers/accel/ivpu/ivpu_pm.c

index aa33f562d29c12f0ae3801204992d980b1e91326..2085edbfd40adf7070052a331b9bea27cd162abf 100644 (file)
@@ -673,7 +673,7 @@ bool ivpu_hw_btrs_irq_handler_lnl(struct ivpu_device *vdev, int irq)
 
        if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, SURV_ERR, status)) {
                ivpu_dbg(vdev, IRQ, "Survivability IRQ\n");
-               queue_work(system_wq, &vdev->irq_dct_work);
+               queue_work(system_percpu_wq, &vdev->irq_dct_work);
        }
 
        if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, FREQ_CHANGE, status)) {
index 5f00809d448afb4f57bf0b92da3fa18bb7b18235..1f13bf95b2b322ec10eb1524cecac222d8ea3e2a 100644 (file)
@@ -459,7 +459,7 @@ void ivpu_ipc_irq_handler(struct ivpu_device *vdev)
                }
        }
 
-       queue_work(system_wq, &vdev->irq_ipc_work);
+       queue_work(system_percpu_wq, &vdev->irq_ipc_work);
 }
 
 void ivpu_ipc_irq_work_fn(struct work_struct *work)
index 4eb7287cd083641d1c65a215052a62f2ac57fcc8..081819886313fe07093cde5ee603cf25d55c6f81 100644 (file)
@@ -591,7 +591,7 @@ bool ivpu_job_handle_engine_error(struct ivpu_device *vdev, u32 job_id, u32 job_
                 * status and ensure both are handled in the same way
                 */
                job->file_priv->has_mmu_faults = true;
-               queue_work(system_wq, &vdev->context_abort_work);
+               queue_work(system_percpu_wq, &vdev->context_abort_work);
                return true;
        }
        default:
index 5ea010568faa451d8c218b74410729a9a79073b5..e1baf6b64935137ac26967adc90f05f2b0f28534 100644 (file)
@@ -970,7 +970,7 @@ void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev)
                }
        }
 
-       queue_work(system_wq, &vdev->context_abort_work);
+       queue_work(system_percpu_wq, &vdev->context_abort_work);
 }
 
 void ivpu_mmu_evtq_dump(struct ivpu_device *vdev)
index b8ec6bf87f58d994b2a0dd59bc90074114980824..480c075d87f69927243b846bdfd37084c541db9a 100644 (file)
@@ -226,7 +226,8 @@ void ivpu_start_job_timeout_detection(struct ivpu_device *vdev)
        unsigned long timeout_ms = ivpu_tdr_timeout_ms ? ivpu_tdr_timeout_ms : vdev->timeout.tdr;
 
        /* No-op if already queued */
-       queue_delayed_work(system_wq, &vdev->pm->job_timeout_work, msecs_to_jiffies(timeout_ms));
+       queue_delayed_work(system_percpu_wq, &vdev->pm->job_timeout_work,
+                          msecs_to_jiffies(timeout_ms));
 }
 
 void ivpu_stop_job_timeout_detection(struct ivpu_device *vdev)