]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: replace use of system_wq with system_dfl_wq
authorMarco Crivellari <marco.crivellari@suse.com>
Mon, 29 Sep 2025 15:50:53 +0000 (17:50 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 15 Oct 2025 09:47:31 +0000 (10:47 +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 consistentcy cannot be addressed without refactoring the API.

system_wq is a per-CPU worqueue, replaced by system_percpu_wq. Despite that,
system_wq in this change has been replaced by system_dfl_wq, because there
aren't per-cpu variables.

The old wq will be kept for a few release cylces.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Link: https://patch.msgid.link/20250929155053.400342-2-marco.crivellari@suse.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 files changed:
sound/soc/codecs/aw88081.c
sound/soc/codecs/aw88166.c
sound/soc/codecs/aw88261.c
sound/soc/codecs/aw88395/aw88395.c
sound/soc/codecs/aw88399.c
sound/soc/codecs/cs42l43-jack.c
sound/soc/codecs/cs42l43.c
sound/soc/codecs/es8326.c
sound/soc/codecs/rt5663.c
sound/soc/intel/boards/sof_es8336.c
sound/soc/sof/intel/cnl.c
sound/soc/sof/intel/hda-ipc.c

index d61a7b8c5470fd658cf1b565e6fed849bb05e123..34316748bbd156f229d8f923201623d15bc9d73b 100644 (file)
@@ -779,7 +779,7 @@ static void aw88081_start(struct aw88081 *aw88081, bool sync_start)
        if (sync_start == AW88081_SYNC_START)
                aw88081_start_pa(aw88081);
        else
-               queue_delayed_work(system_wq,
+               queue_delayed_work(system_dfl_wq,
                        &aw88081->start_work,
                        AW88081_START_WORK_DELAY_MS);
 }
index 28f62b991ef2b7b2c9bd51c242d9fd5760822128..86b9d0709e508f53fd6c9e6f2a056abcd872aabe 100644 (file)
@@ -1310,7 +1310,7 @@ static void aw88166_start(struct aw88166 *aw88166, bool sync_start)
        if (sync_start == AW88166_SYNC_START)
                aw88166_start_pa(aw88166);
        else
-               queue_delayed_work(system_wq,
+               queue_delayed_work(system_dfl_wq,
                        &aw88166->start_work,
                        AW88166_START_WORK_DELAY_MS);
 }
index de11ae8dd9d9f793b30f7ce92db611ec4d156ef7..ece6b4411c33838fad3c19836507f4110625876c 100644 (file)
@@ -705,7 +705,7 @@ static void aw88261_start(struct aw88261 *aw88261, bool sync_start)
        if (sync_start == AW88261_SYNC_START)
                aw88261_start_pa(aw88261);
        else
-               queue_delayed_work(system_wq,
+               queue_delayed_work(system_dfl_wq,
                        &aw88261->start_work,
                        AW88261_START_WORK_DELAY_MS);
 }
index fb563b4c697180e3768a9e7b798ab6f05c4a552d..727aae2dd72769343377bee68090847a8467cce6 100644 (file)
@@ -75,7 +75,7 @@ static void aw88395_start(struct aw88395 *aw88395, bool sync_start)
        if (sync_start == AW88395_SYNC_START)
                aw88395_start_pa(aw88395);
        else
-               queue_delayed_work(system_wq,
+               queue_delayed_work(system_dfl_wq,
                        &aw88395->start_work,
                        AW88395_START_WORK_DELAY_MS);
 }
index 58846feb013d13dd38dafa4ec86b4b50b941bfd0..6a05dbe5ee71fda3ba1cc3a304ad531bcd65ebb4 100644 (file)
@@ -1340,7 +1340,7 @@ static void aw88399_start(struct aw88399 *aw88399, bool sync_start)
        if (sync_start == AW88399_SYNC_START)
                aw88399_start_pa(aw88399);
        else
-               queue_delayed_work(system_wq,
+               queue_delayed_work(system_dfl_wq,
                        &aw88399->start_work,
                        AW88399_START_WORK_DELAY_MS);
 }
index 867e23d4fb8d8bd01a4757589289f927947f25dd..68a4ce7c2732793e4236a9a9203d22ba42d5404b 100644 (file)
@@ -300,7 +300,7 @@ irqreturn_t cs42l43_bias_detect_clamp(int irq, void *data)
 {
        struct cs42l43_codec *priv = data;
 
-       queue_delayed_work(system_wq, &priv->bias_sense_timeout,
+       queue_delayed_work(system_dfl_wq, &priv->bias_sense_timeout,
                           msecs_to_jiffies(1000));
 
        return IRQ_HANDLED;
index b61df09f20cf49a1c1303ebc89cdfffe32a0ed6c..a11d8ed8fa4e2f538a0c47ee5ee79446e6059ebc 100644 (file)
@@ -161,7 +161,7 @@ static void cs42l43_hp_ilimit_clear_work(struct work_struct *work)
        priv->hp_ilimit_count--;
 
        if (priv->hp_ilimit_count)
-               queue_delayed_work(system_wq, &priv->hp_ilimit_clear_work,
+               queue_delayed_work(system_dfl_wq, &priv->hp_ilimit_clear_work,
                                   msecs_to_jiffies(CS42L43_HP_ILIMIT_DECAY_MS));
 
        snd_soc_dapm_mutex_unlock(dapm);
@@ -179,7 +179,7 @@ static irqreturn_t cs42l43_hp_ilimit(int irq, void *data)
 
        if (priv->hp_ilimit_count < CS42L43_HP_ILIMIT_MAX_COUNT) {
                if (!priv->hp_ilimit_count)
-                       queue_delayed_work(system_wq, &priv->hp_ilimit_clear_work,
+                       queue_delayed_work(system_dfl_wq, &priv->hp_ilimit_clear_work,
                                           msecs_to_jiffies(CS42L43_HP_ILIMIT_DECAY_MS));
 
                priv->hp_ilimit_count++;
index 78c4e68f600249d9f9345a8fbb8e2f48e78d6c22..f3b25220141b5492c7c927d2d92a700bbeba4854 100644 (file)
@@ -812,12 +812,12 @@ static void es8326_jack_button_handler(struct work_struct *work)
                        press_count = 0;
                }
                button_to_report = cur_button;
-               queue_delayed_work(system_wq, &es8326->button_press_work,
+               queue_delayed_work(system_dfl_wq, &es8326->button_press_work,
                                   msecs_to_jiffies(35));
        } else if (prev_button != cur_button) {
                /* mismatch, detect again */
                prev_button = cur_button;
-               queue_delayed_work(system_wq, &es8326->button_press_work,
+               queue_delayed_work(system_dfl_wq, &es8326->button_press_work,
                                   msecs_to_jiffies(35));
        } else {
                /* released or no pressed */
@@ -912,7 +912,7 @@ static void es8326_jack_detect_handler(struct work_struct *work)
                                        (ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
                        regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x1f);
                        regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x0d);
-                       queue_delayed_work(system_wq, &es8326->jack_detect_work,
+                       queue_delayed_work(system_dfl_wq, &es8326->jack_detect_work,
                                        msecs_to_jiffies(400));
                        es8326->hp = 1;
                        goto exit;
@@ -923,7 +923,7 @@ static void es8326_jack_detect_handler(struct work_struct *work)
                        regmap_write(es8326->regmap, ES8326_INT_SOURCE,
                                        (ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
                        es8326_enable_micbias(es8326->component);
-                       queue_delayed_work(system_wq, &es8326->button_press_work, 10);
+                       queue_delayed_work(system_dfl_wq, &es8326->button_press_work, 10);
                        goto exit;
                }
                if ((iface & ES8326_HPBUTTON_FLAG) == 0x01) {
@@ -958,10 +958,10 @@ static irqreturn_t es8326_irq(int irq, void *dev_id)
                goto out;
 
        if (es8326->jack->status & SND_JACK_HEADSET)
-               queue_delayed_work(system_wq, &es8326->jack_detect_work,
+               queue_delayed_work(system_dfl_wq, &es8326->jack_detect_work,
                                   msecs_to_jiffies(10));
        else
-               queue_delayed_work(system_wq, &es8326->jack_detect_work,
+               queue_delayed_work(system_dfl_wq, &es8326->jack_detect_work,
                                   msecs_to_jiffies(300));
 
 out:
index 45057562c0c81c3aa7fd16fe900c602dd09e0575..50fdeb8f06061d20a6fc607c38bdd3718742a681 100644 (file)
@@ -1859,7 +1859,7 @@ static irqreturn_t rt5663_irq(int irq, void *data)
        dev_dbg(regmap_get_device(rt5663->regmap), "%s IRQ queue work\n",
                __func__);
 
-       queue_delayed_work(system_wq, &rt5663->jack_detect_work,
+       queue_delayed_work(system_dfl_wq, &rt5663->jack_detect_work,
                msecs_to_jiffies(250));
 
        return IRQ_HANDLED;
@@ -1974,7 +1974,7 @@ static void rt5663_jack_detect_work(struct work_struct *work)
                                cancel_delayed_work_sync(
                                        &rt5663->jd_unplug_work);
                        } else {
-                               queue_delayed_work(system_wq,
+                               queue_delayed_work(system_dfl_wq,
                                        &rt5663->jd_unplug_work,
                                        msecs_to_jiffies(500));
                        }
@@ -2024,7 +2024,7 @@ static void rt5663_jd_unplug_work(struct work_struct *work)
                                    SND_JACK_BTN_0 | SND_JACK_BTN_1 |
                                    SND_JACK_BTN_2 | SND_JACK_BTN_3);
        } else {
-               queue_delayed_work(system_wq, &rt5663->jd_unplug_work,
+               queue_delayed_work(system_dfl_wq, &rt5663->jd_unplug_work,
                        msecs_to_jiffies(500));
        }
 }
index 10b189ea88dba8bf181b4f2a6562d42acf997724..41b7545581e02af8ceb8e8292e01df3c75638ced 100644 (file)
@@ -163,7 +163,7 @@ static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w,
 
        priv->speaker_en = !SND_SOC_DAPM_EVENT_ON(event);
 
-       queue_delayed_work(system_wq, &priv->pcm_pop_work, msecs_to_jiffies(70));
+       queue_delayed_work(system_dfl_wq, &priv->pcm_pop_work, msecs_to_jiffies(70));
        return 0;
 }
 
index 385e5339f0a4b7a26ac5677cc3c4d7f74c8a511a..c4b58738d74b37e1b954efedabd1db22a647abe2 100644 (file)
@@ -329,7 +329,7 @@ int cnl_ipc_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg)
         * CTX_SAVE IPC, which is sent before the DSP enters D3.
         */
        if (hdr->cmd != (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE))
-               mod_delayed_work(system_wq, &hdev->d0i3_work,
+               mod_delayed_work(system_dfl_wq, &hdev->d0i3_work,
                                 msecs_to_jiffies(SOF_HDA_D0I3_WORK_DELAY_MS));
 
        return 0;
index f3fbf43a70c2bb573502f9e97b17df412733a9fc..94425c51086170b61af5a88ce58a591461431277 100644 (file)
@@ -96,7 +96,7 @@ void hda_dsp_ipc4_schedule_d0i3_work(struct sof_intel_hda_dev *hdev,
        if (hda_dsp_ipc4_pm_msg(msg_data->primary))
                return;
 
-       mod_delayed_work(system_wq, &hdev->d0i3_work,
+       mod_delayed_work(system_dfl_wq, &hdev->d0i3_work,
                         msecs_to_jiffies(SOF_HDA_D0I3_WORK_DELAY_MS));
 }
 EXPORT_SYMBOL_NS(hda_dsp_ipc4_schedule_d0i3_work, "SND_SOC_SOF_INTEL_HDA_COMMON");