Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: sun4i-usb: replace use of system_wq with system_percpu_wq

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 patch continues the effort to refactor worqueue APIs, which has begun
with the change introducing new workqueues and a new alloc_workqueue flag:

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

Replace system_wq with system_percpu_wq, keeping the same behavior.
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>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://patch.msgid.link/20251105152023.259813-1-marco.crivellari@suse.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Marco Crivellari and committed by
Vinod Koul
877686f9 add66a66

+7 -7
+7 -7
drivers/phy/allwinner/phy-sun4i-usb.c
··· 359 359 /* Force ISCR and cable state updates */ 360 360 data->id_det = -1; 361 361 data->vbus_det = -1; 362 - queue_delayed_work(system_wq, &data->detect, 0); 362 + queue_delayed_work(system_percpu_wq, &data->detect, 0); 363 363 } 364 364 365 365 return 0; ··· 482 482 483 483 /* We must report Vbus high within OTG_TIME_A_WAIT_VRISE msec. */ 484 484 if (phy->index == 0 && sun4i_usb_phy0_poll(data)) 485 - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); 485 + mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME); 486 486 487 487 return 0; 488 488 } ··· 503 503 * Vbus gpio to not trigger an edge irq on Vbus off, so force a rescan. 504 504 */ 505 505 if (phy->index == 0 && !sun4i_usb_phy0_poll(data)) 506 - mod_delayed_work(system_wq, &data->detect, POLL_TIME); 506 + mod_delayed_work(system_percpu_wq, &data->detect, POLL_TIME); 507 507 508 508 return 0; 509 509 } ··· 542 542 543 543 data->id_det = -1; /* Force reprocessing of id */ 544 544 data->force_session_end = true; 545 - queue_delayed_work(system_wq, &data->detect, 0); 545 + queue_delayed_work(system_percpu_wq, &data->detect, 0); 546 546 547 547 return 0; 548 548 } ··· 654 654 extcon_set_state_sync(data->extcon, EXTCON_USB, vbus_det); 655 655 656 656 if (sun4i_usb_phy0_poll(data)) 657 - queue_delayed_work(system_wq, &data->detect, POLL_TIME); 657 + queue_delayed_work(system_percpu_wq, &data->detect, POLL_TIME); 658 658 } 659 659 660 660 static irqreturn_t sun4i_usb_phy0_id_vbus_det_irq(int irq, void *dev_id) ··· 662 662 struct sun4i_usb_phy_data *data = dev_id; 663 663 664 664 /* vbus or id changed, let the pins settle and then scan them */ 665 - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); 665 + mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME); 666 666 667 667 return IRQ_HANDLED; 668 668 } ··· 676 676 677 677 /* Properties on the vbus_power_supply changed, scan vbus_det */ 678 678 if (val == PSY_EVENT_PROP_CHANGED && psy == data->vbus_power_supply) 679 - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); 679 + mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME); 680 680 681 681 return NOTIFY_OK; 682 682 }