public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq
@ 2025-11-05 15:20 Marco Crivellari
  2025-11-05 16:44 ` Jernej Škrabec
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marco Crivellari @ 2025-11-05 15:20 UTC (permalink / raw)
  To: linux-kernel, linux-phy, linux-arm-kernel, linux-sunxi
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Vinod Koul, Kishon Vijay Abraham I, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland

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>
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index 59d38d88efb0..e2fbf8ccf99e 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -359,7 +359,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
 		/* Force ISCR and cable state updates */
 		data->id_det = -1;
 		data->vbus_det = -1;
-		queue_delayed_work(system_wq, &data->detect, 0);
+		queue_delayed_work(system_percpu_wq, &data->detect, 0);
 	}
 
 	return 0;
@@ -482,7 +482,7 @@ static int sun4i_usb_phy_power_on(struct phy *_phy)
 
 	/* We must report Vbus high within OTG_TIME_A_WAIT_VRISE msec. */
 	if (phy->index == 0 && sun4i_usb_phy0_poll(data))
-		mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME);
+		mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME);
 
 	return 0;
 }
@@ -503,7 +503,7 @@ static int sun4i_usb_phy_power_off(struct phy *_phy)
 	 * Vbus gpio to not trigger an edge irq on Vbus off, so force a rescan.
 	 */
 	if (phy->index == 0 && !sun4i_usb_phy0_poll(data))
-		mod_delayed_work(system_wq, &data->detect, POLL_TIME);
+		mod_delayed_work(system_percpu_wq, &data->detect, POLL_TIME);
 
 	return 0;
 }
@@ -542,7 +542,7 @@ static int sun4i_usb_phy_set_mode(struct phy *_phy,
 
 	data->id_det = -1; /* Force reprocessing of id */
 	data->force_session_end = true;
-	queue_delayed_work(system_wq, &data->detect, 0);
+	queue_delayed_work(system_percpu_wq, &data->detect, 0);
 
 	return 0;
 }
@@ -654,7 +654,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work)
 		extcon_set_state_sync(data->extcon, EXTCON_USB, vbus_det);
 
 	if (sun4i_usb_phy0_poll(data))
-		queue_delayed_work(system_wq, &data->detect, POLL_TIME);
+		queue_delayed_work(system_percpu_wq, &data->detect, POLL_TIME);
 }
 
 static irqreturn_t sun4i_usb_phy0_id_vbus_det_irq(int irq, void *dev_id)
@@ -662,7 +662,7 @@ static irqreturn_t sun4i_usb_phy0_id_vbus_det_irq(int irq, void *dev_id)
 	struct sun4i_usb_phy_data *data = dev_id;
 
 	/* vbus or id changed, let the pins settle and then scan them */
-	mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME);
+	mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME);
 
 	return IRQ_HANDLED;
 }
@@ -676,7 +676,7 @@ static int sun4i_usb_phy0_vbus_notify(struct notifier_block *nb,
 
 	/* Properties on the vbus_power_supply changed, scan vbus_det */
 	if (val == PSY_EVENT_PROP_CHANGED && psy == data->vbus_power_supply)
-		mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME);
+		mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME);
 
 	return NOTIFY_OK;
 }
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq
  2025-11-05 15:20 [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq Marco Crivellari
@ 2025-11-05 16:44 ` Jernej Škrabec
  2026-01-13  9:07 ` Marco Crivellari
  2026-01-14 14:01 ` Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Jernej Škrabec @ 2025-11-05 16:44 UTC (permalink / raw)
  To: linux-kernel, linux-phy, linux-arm-kernel, linux-sunxi,
	Marco Crivellari
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Vinod Koul, Kishon Vijay Abraham I, Chen-Yu Tsai, Samuel Holland

Dne sreda, 5. november 2025 ob 16:20:23 Srednjeevropski standardni čas je Marco Crivellari napisal(a):
> 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>

Best regards,
Jernej




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq
  2025-11-05 15:20 [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq Marco Crivellari
  2025-11-05 16:44 ` Jernej Škrabec
@ 2026-01-13  9:07 ` Marco Crivellari
  2026-01-14 14:01 ` Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Marco Crivellari @ 2026-01-13  9:07 UTC (permalink / raw)
  To: linux-kernel, linux-phy, linux-arm-kernel, linux-sunxi
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Michal Hocko, Vinod Koul,
	Kishon Vijay Abraham I, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland

On Wed, Nov 5, 2025 at 4:20 PM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> [...]
>  drivers/phy/allwinner/phy-sun4i-usb.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)


Gentle ping.

Thanks!

-- 

Marco Crivellari

L3 Support Engineer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq
  2025-11-05 15:20 [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq Marco Crivellari
  2025-11-05 16:44 ` Jernej Škrabec
  2026-01-13  9:07 ` Marco Crivellari
@ 2026-01-14 14:01 ` Vinod Koul
  2026-01-14 14:15   ` Marco Crivellari
  2 siblings, 1 reply; 5+ messages in thread
From: Vinod Koul @ 2026-01-14 14:01 UTC (permalink / raw)
  To: linux-kernel, linux-phy, linux-arm-kernel, linux-sunxi,
	Marco Crivellari
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Michal Hocko, Kishon Vijay Abraham I,
	Jernej Skrabec, Samuel Holland, Chen-Yu Tsai


On Wed, 05 Nov 2025 16:20:23 +0100, Marco Crivellari wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] phy: sun4i-usb: replace use of system_wq with system_percpu_wq
      commit: 877686f9f42b58b04e4e25d07034bc95cadc20f3

Best regards,
-- 
~Vinod




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq
  2026-01-14 14:01 ` Vinod Koul
@ 2026-01-14 14:15   ` Marco Crivellari
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Crivellari @ 2026-01-14 14:15 UTC (permalink / raw)
  To: Vinod Koul
  Cc: linux-kernel, linux-phy, linux-arm-kernel, linux-sunxi, Tejun Heo,
	Lai Jiangshan, Frederic Weisbecker, Sebastian Andrzej Siewior,
	Michal Hocko, Kishon Vijay Abraham I, Jernej Skrabec,
	Samuel Holland, Chen-Yu Tsai

On Wed, Jan 14, 2026 at 3:01 PM Vinod Koul <vkoul@kernel.org> wrote:
>
> [...]
> Applied, thanks!
>
> [1/1] phy: sun4i-usb: replace use of system_wq with system_percpu_wq
>       commit: 877686f9f42b58b04e4e25d07034bc95cadc20f3

Many thanks!

-- 

Marco Crivellari

L3 Support Engineer


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-14 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 15:20 [PATCH] phy: sun4i-usb: replace use of system_wq with system_percpu_wq Marco Crivellari
2025-11-05 16:44 ` Jernej Škrabec
2026-01-13  9:07 ` Marco Crivellari
2026-01-14 14:01 ` Vinod Koul
2026-01-14 14:15   ` Marco Crivellari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox