From nobody Tue Jun 16 17:01:46 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F6C3389473 for ; Thu, 30 Apr 2026 10:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777545308; cv=none; b=IMzUij660sbpRSGCD6rN3elZYsMpnlVUh9jp6xQVrPyqn/MAlUAw3hCoh3R2b2xszpSox6eXfLGhZtF5sti+daH61GWYO79xZLunRuk77RL8JD4B/176SD81Tgh06TW/XCP+VjrbGmIW+huW8KMR31DTdv8l9XAurYus3EwFSJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777545308; c=relaxed/simple; bh=SJuhX+SqFvxNQS9A3xSufmHeYirD5Wod+dB22sGnJXk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YMmS90eupEkgTislov/fr8u5sIvWvIdxGqrXjAIPg9fPu2MlU8RX+mNMbXKYSx5zDNVJ/m2UTEkuW/X5pR3rosefgF6xlaXESWSK9doCvvgRwEPwos5RjA/+in3vf5W+BD0gq1iPvjtWG405bhB4LwUND9pA2QzhnzhNv+02Gk8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=gA6rbREj; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="gA6rbREj" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-43d73422431so677058f8f.2 for ; Thu, 30 Apr 2026 03:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777545304; x=1778150104; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9MMDcbCnN6B5xSu+JFTFRjKxTGCN7slC3w+efbXWDzs=; b=gA6rbREjcVT+dU99l2ajn5wg1CzJkKfZeRwG9fhzVCNq/rwQp3Ym0LmC0bGx+POEgV tFDkNwdO8ZXbhlXbGbkWk9KzI+4PbCDdLW2F6dk7FC+1BwcxyPGi9SR8SXBi+3Drv7e0 KLUR+70OcKCDiJWih0B+UfDojNWNJSmC5U1Ov4MHyERuGunDShYvbjIjaJUfw9LCq2gQ ZX9MGrgcPJm9nUJHaOVMFiSX8kRx13Raynx20IehYjFalVEqyEpu8PCcKIY7dm4MHA6Y COyU98BARdk5mzU9p7PCUVN7dMwZzN/c3/Yus+JEP7jS2KYOAABmLdV/fiiYFHBsAs20 UTXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777545304; x=1778150104; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9MMDcbCnN6B5xSu+JFTFRjKxTGCN7slC3w+efbXWDzs=; b=KF1Uj6tEC9OwS6j37/sTNGZeJJtsAOX1qztIVB7GXoiCSBa3Ye+utFtv5x345zqo4E GK+5XIpJ4J/FxDmV/HpoBclC/WeJQqDKJnZTJUa/iwC9RTCe8Sovt+rkzHFh1zByMvkI HU+Tw8pY7ECC08/9C1ClQTalhlaOIgGG4qJSFuyA6Wopak0OX4vRD4yQroYGvUEOHXK4 H8bgIvIeY81xnXDvKGCUq6RjKidHb2RjsFnPBixjYYWgnHCXwVGHrr8lfDigt3n1+uHO 0xn6DWGTWorgy4mGq0Jy3xXmPGrZrblZt8RM9BhEkQ4akYbAkQ60QyJjjYXpLQifoaX+ VQtQ== X-Gm-Message-State: AOJu0YzOTPag2BssA5uiDVraq3W3kGDvKCKA6DgjhxpKCcjevK90wzLX doxwQmiVB8q5ADZzSKTfW3umqbc+NOxjoPTWV/kL1LE1vKYNjRDoTOZ2w00M82BADug30rtyMik 9dM1Czyg= X-Gm-Gg: AeBDieu6EQNFeCh2taTu8UvTChfk5HMEun6cZarm/aOtHcCq8pGF3ZvjLrTNPdXbIvh OUGc+ZNYN+Y4ruTS+PRkt2Ti/0TRnenq75UGhQci8Qa9lhH+HmUGngcc8tTyc55CfW1CZ30CjF7 O6OQOqjNl2d+Mj7HV6y9WEjrojhxNWjqvtvPJ+OkGpf6yBuLN6f2Ruqxd24PJvhPZs9GPsUkkK8 8OCTYGBeiWAtu7LFGrFfrWAqVIffiZGMezAEjt8Ba0Q8p/JdwBhhQZxd4jDBKYSzSRuCKT4uyVR 23Si5OsQ5Agb4PmWwaEOY5yFIP/ehi19Acp44v10Rf9Xtg2/uLZ/Z2darIJFLeKQMk7Vj2/axST nZ/4zh/JfuJVXmaquOyo0CJYg0u0vvWqG95nTSNFnFdtWKMpjvvfxkFrD5dXytDlkU8EHohLfdt RUQuB52ZZXZhGBPTrJDZQ34Riuj3rZe7SXTWba X-Received: by 2002:a05:6000:2c11:b0:43d:d037:d59c with SMTP id ffacd0b85a97d-4493d02b4c7mr3864269f8f.16.1777545304567; Thu, 30 Apr 2026 03:35:04 -0700 (PDT) Received: from linux ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-447b72176fesm11515172f8f.17.2026.04.30.03.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 03:35:04 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Vinod Koul , Neil Armstrong Subject: [RFC PATCH] phy: ti: tusb1210: Move long delayed work on system_dfl_long_wq Date: Thu, 30 Apr 2026 12:34:55 +0200 Message-ID: <20260430103455.185238-1-marco.crivellari@suse.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently the code enqueue work items using {queue|mod}_delayed_work(), using system_long_wq. This workqueue should be used when long works are expected, but it is a per-cpu workqueue. This is important because queue_delayed_work() queue the work using: queue_delayed_work_on(WORK_CPU_UNBOUND, ...); Note that WORK_CPU_UNBOUND =3D NR_CPUS. This would end up calling __queue_delayed_work() that does: if (housekeeping_enabled(HK_TYPE_TIMER)) { // [....] } else { if (likely(cpu =3D=3D WORK_CPU_UNBOUND)) add_timer_global(timer); else add_timer_on(timer, cpu); } So when cpu =3D=3D WORK_CPU_UNBOUND the timer is global and is not using a specific CPU. Later, when __queue_work() is called: if (req_cpu =3D=3D WORK_CPU_UNBOUND) { if (wq->flags & WQ_UNBOUND) cpu =3D wq_select_unbound_cpu(raw_smp_processor_id()); else cpu =3D raw_smp_processor_id(); } Because the wq is not unbound, it takes the CPU where the timer fired and enqueue the work on that CPU. The consequence of all of this is that the work can run anywhere, depending on where the timer fired. Recently, a new unbound workqueue specific for long running work has been added: c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works= ") So change system_long_wq with system_dfl_long_wq so that the work may benefit from scheduler task placement. Signed-off-by: Marco Crivellari --- drivers/phy/ti/phy-tusb1210.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/phy/ti/phy-tusb1210.c b/drivers/phy/ti/phy-tusb1210.c index c3ae9d7948d7..9956921c094b 100644 --- a/drivers/phy/ti/phy-tusb1210.c +++ b/drivers/phy/ti/phy-tusb1210.c @@ -197,7 +197,7 @@ static void tusb1210_chg_det_set_state(struct tusb1210 = *tusb, tusb1210_chg_det_states[new_state], delay_ms); =20 tusb->chg_det_state =3D new_state; - mod_delayed_work(system_long_wq, &tusb->chg_det_work, + mod_delayed_work(system_dfl_long_wq, &tusb->chg_det_work, msecs_to_jiffies(delay_ms)); } =20 @@ -380,7 +380,7 @@ static int tusb1210_psy_notifier(struct notifier_block = *nb, struct power_supply *psy =3D ptr; =20 if (psy !=3D tusb->psy && psy->desc->type =3D=3D POWER_SUPPLY_TYPE_USB) - queue_delayed_work(system_long_wq, &tusb->chg_det_work, 0); + queue_delayed_work(system_dfl_long_wq, &tusb->chg_det_work, 0); =20 return NOTIFY_OK; } @@ -458,7 +458,7 @@ static void tusb1210_probe_charger_detect(struct tusb12= 10 *tusb) */ tusb->chg_det_state =3D TUSB1210_CHG_DET_DISCONNECTED; INIT_DELAYED_WORK(&tusb->chg_det_work, tusb1210_chg_det_work); - queue_delayed_work(system_long_wq, &tusb->chg_det_work, 2 * HZ); + queue_delayed_work(system_dfl_long_wq, &tusb->chg_det_work, 2 * HZ); =20 tusb->psy_nb.notifier_call =3D tusb1210_psy_notifier; power_supply_reg_notifier(&tusb->psy_nb); --=20 2.53.0