]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: xhci: replace use of system_wq with system_percpu_wq
authorMarco Crivellari <marco.crivellari@suse.com>
Wed, 19 Nov 2025 14:24:05 +0000 (16:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2025 13:53:00 +0000 (14:53 +0100)
Currently if a user enqueues 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.

This continues the effort to refactor workqueue APIs, which began with
the introduction of new workqueues and a new alloc_workqueue flag in:

commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")

Switch to using system_percpu_wq because system_wq is going away as part of
a workqueue restructuring.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20251119142417.2820519-12-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-dbgcap.c
drivers/usb/host/xhci-ring.c

index ecda964e018ac69255dfda1742ffef23836ea287..9da4f3b452cb742e4ba2a2257b8c5ae6808c0b11 100644 (file)
@@ -374,7 +374,7 @@ int dbc_ep_queue(struct dbc_request *req)
                ret = dbc_ep_do_queue(req);
        spin_unlock_irqrestore(&dbc->lock, flags);
 
-       mod_delayed_work(system_wq, &dbc->event_work, 0);
+       mod_delayed_work(system_percpu_wq, &dbc->event_work, 0);
 
        trace_xhci_dbc_queue_request(req);
 
@@ -677,7 +677,7 @@ static int xhci_dbc_start(struct xhci_dbc *dbc)
                return ret;
        }
 
-       return mod_delayed_work(system_wq, &dbc->event_work,
+       return mod_delayed_work(system_percpu_wq, &dbc->event_work,
                                msecs_to_jiffies(dbc->poll_interval));
 }
 
@@ -1023,7 +1023,7 @@ static void xhci_dbc_handle_events(struct work_struct *work)
                return;
        }
 
-       mod_delayed_work(system_wq, &dbc->event_work,
+       mod_delayed_work(system_percpu_wq, &dbc->event_work,
                         msecs_to_jiffies(poll_interval));
 }
 
@@ -1274,7 +1274,7 @@ static ssize_t dbc_poll_interval_ms_store(struct device *dev,
 
        dbc->poll_interval = value;
 
-       mod_delayed_work(system_wq, &dbc->event_work, 0);
+       mod_delayed_work(system_percpu_wq, &dbc->event_work, 0);
 
        return size;
 }
index 5acec91438113cb09f1a5e524134a15ff7f11a90..f1582360d96aeecf8d5360e181192726eb2bf9ba 100644 (file)
@@ -435,7 +435,7 @@ void xhci_ring_cmd_db(struct xhci_hcd *xhci)
 
 static bool xhci_mod_cmd_timer(struct xhci_hcd *xhci)
 {
-       return mod_delayed_work(system_wq, &xhci->cmd_timer,
+       return mod_delayed_work(system_percpu_wq, &xhci->cmd_timer,
                        msecs_to_jiffies(xhci->current_cmd->timeout_ms));
 }