All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Derek J. Clark" <derekjohn.clark@gmail.com>
To: jikos@kernel.org, bentiss@kernel.org
Cc: linux-input@vger.kernel.org,
	kernel@lists.opengamingcollective.org,
	gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	pgriffais@valvesoftware.com, derekjohn.clark@gmail.com
Subject: [PATCH 1/8] HID: hid-msi: Queue the RGB work item on system_dfl_wq
Date: Thu,  3 Dec 2026 16:18:39 -0800	[thread overview]
Message-ID: <20261204001846.3801336-2-derekjohn.clark@gmail.com> (raw)
In-Reply-To: <20261204001846.3801336-1-derekjohn.clark@gmail.com>

system_wq is deprecated. Queuing work on it warns:

workqueue: work func claw_rgb_queue_fn [hid_msi] enqueued on deprecated
workqueue. Use system_{percpu|dfl}_wq instead.

The RGB work item writes up to eight HID reports to the MCU and blocks
waiting for each reply, so move it to system_dfl_wq. That is the unbound
system workqueue, and other HID drivers queue comparable MCU transactions
there.

The ordering comments name system_wq as the workqueue the paired stores
run on. The configuration work is queued with schedule_delayed_work(),
which now uses system_percpu_wq, so rename the workqueue to the one those
pairs now run on.

Fixes: f27e2e3c80ed ("HID: hid-msi: Add RGB control interface")
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
---
 drivers/hid/hid-msi.c | 54 +++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/hid/hid-msi.c b/drivers/hid/hid-msi.c
index 23d731f700c9..d4128955e463 100644
--- a/drivers/hid/hid-msi.c
+++ b/drivers/hid/hid-msi.c
@@ -685,7 +685,7 @@ static ssize_t gamepad_mode_store(struct device *dev, struct device_attribute *a
 	int i, ret = -EINVAL;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -714,7 +714,7 @@ static ssize_t gamepad_mode_show(struct device *dev,
 	int ret, i;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -760,7 +760,7 @@ static ssize_t mkeys_function_store(struct device *dev, struct device_attribute
 	int i, ret = -EINVAL;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -789,7 +789,7 @@ static ssize_t mkeys_function_show(struct device *dev, struct device_attribute *
 	int ret, i;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -832,7 +832,7 @@ static ssize_t reset_store(struct device *dev, struct device_attribute *attr,
 	int ret;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -889,7 +889,7 @@ static int claw_mkey_store(struct device *dev, const char *buf, u8 mkey)
 	int ret, key_count, i;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -939,7 +939,7 @@ static int claw_mkey_show(struct device *dev, char *buf, enum claw_key_index m_k
 	u8 *codes;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -1034,7 +1034,7 @@ static ssize_t rumble_intensity_left_store(struct device *dev,
 	int ret;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -1077,7 +1077,7 @@ static ssize_t rumble_intensity_left_show(struct device *dev,
 	u8 val;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -1108,7 +1108,7 @@ static ssize_t rumble_intensity_right_store(struct device *dev,
 	int ret;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -1151,7 +1151,7 @@ static ssize_t rumble_intensity_right_show(struct device *dev,
 	u8 val;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->gp_registered))
 			return -ENODEV;
 	}
@@ -1472,7 +1472,7 @@ static void claw_rgb_queue_fn(struct work_struct *work)
 		return;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->rgb_registered))
 			return;
 	}
@@ -1492,7 +1492,7 @@ static ssize_t effect_store(struct device *dev,
 	int ret;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->rgb_registered))
 			return -ENODEV;
 	}
@@ -1504,7 +1504,7 @@ static ssize_t effect_store(struct device *dev,
 	scoped_guard(spinlock_irqsave, &drvdata->profile_lock)
 		drvdata->rgb_effect = ret;
 
-	mod_delayed_work(system_wq, &drvdata->rgb_queue, msecs_to_jiffies(50));
+	mod_delayed_work(system_dfl_wq, &drvdata->rgb_queue, msecs_to_jiffies(50));
 
 	return count;
 }
@@ -1517,7 +1517,7 @@ static ssize_t effect_show(struct device *dev,
 	struct claw_drvdata *drvdata = container_of(led_mc, struct claw_drvdata, led_mc);
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->rgb_registered))
 			return -ENODEV;
 	}
@@ -1556,7 +1556,7 @@ static ssize_t enabled_store(struct device *dev,
 	int ret;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->rgb_registered))
 			return -ENODEV;
 	}
@@ -1568,7 +1568,7 @@ static ssize_t enabled_store(struct device *dev,
 	scoped_guard(spinlock_irqsave, &drvdata->profile_lock)
 		drvdata->rgb_enabled = val;
 
-	mod_delayed_work(system_wq, &drvdata->rgb_queue, msecs_to_jiffies(50));
+	mod_delayed_work(system_dfl_wq, &drvdata->rgb_queue, msecs_to_jiffies(50));
 
 	return count;
 }
@@ -1581,7 +1581,7 @@ static ssize_t enabled_show(struct device *dev,
 	struct claw_drvdata *drvdata = container_of(led_mc, struct claw_drvdata, led_mc);
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->rgb_registered))
 			return -ENODEV;
 	}
@@ -1607,7 +1607,7 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
 	int ret;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->rgb_registered))
 			return -ENODEV;
 	}
@@ -1625,7 +1625,7 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
 	scoped_guard(spinlock_irqsave, &drvdata->profile_lock)
 		drvdata->rgb_speed = speed;
 
-	mod_delayed_work(system_wq, &drvdata->rgb_queue, msecs_to_jiffies(50));
+	mod_delayed_work(system_dfl_wq, &drvdata->rgb_queue, msecs_to_jiffies(50));
 
 	return count;
 }
@@ -1639,7 +1639,7 @@ static ssize_t speed_show(struct device *dev, struct device_attribute *attr,
 	u8 speed = 20 - drvdata->rgb_speed;
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->rgb_registered))
 			return -ENODEV;
 	}
@@ -1662,12 +1662,12 @@ static void claw_led_brightness_set(struct led_classdev *led_cdev,
 	struct claw_drvdata *drvdata = container_of(led_mc, struct claw_drvdata, led_mc);
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		if (!smp_load_acquire(&drvdata->rgb_registered))
 			return;
 	}
 
-	mod_delayed_work(system_wq, &drvdata->rgb_queue, msecs_to_jiffies(50));
+	mod_delayed_work(system_dfl_wq, &drvdata->rgb_queue, msecs_to_jiffies(50));
 }
 
 static struct attribute *claw_rgb_attrs[] = {
@@ -1786,9 +1786,9 @@ static void cfg_resume_fn(struct work_struct *work)
 	struct claw_drvdata *drvdata = container_of(dwork, struct claw_drvdata, cfg_resume);
 
 	guard(spinlock_irqsave)(&drvdata->registration_lock);
-	    /* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+	    /* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 	if (!smp_load_acquire(&drvdata->gp_registered) ||
-	    /* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+	    /* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 	    !smp_load_acquire(&drvdata->rgb_registered))
 		schedule_delayed_work(&drvdata->cfg_setup, msecs_to_jiffies(500));
 }
@@ -1936,11 +1936,11 @@ static void claw_remove(struct hid_device *hdev)
 	cancel_delayed_work_sync(&drvdata->cfg_setup);
 
 	scoped_guard(spinlock_irqsave, &drvdata->registration_lock) {
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		gp_registered = smp_load_acquire(&drvdata->gp_registered);
 		/* Pairs with smp_load_acquire in attribute show/store functions */
 		smp_store_release(&drvdata->gp_registered, false);
-		/* Pairs with smp_store_release from cfg_setup_fn in system_wq context */
+		/* Pairs with smp_store_release from cfg_setup_fn in system_percpu_wq context */
 		rgb_registered = smp_load_acquire(&drvdata->rgb_registered);
 		/* Pairs with smp_load_acquire in attribute show/store functions */
 		smp_store_release(&drvdata->rgb_registered, false);
-- 
2.56.0


  reply	other threads:[~2026-12-04  0:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  0:18 [PATCH 0/8] MSI Claw suspend, resume and ROM commit fixes Derek J. Clark
2026-12-04  0:18 ` Derek J. Clark [this message]
2026-12-04  0:18 ` [PATCH 2/8] HID: hid-msi: Move the ROM commit to an explicit apply attribute Derek J. Clark
2026-12-04  0:35   ` sashiko-bot
2026-12-04  0:18 ` [PATCH 3/8] HID: hid-msi: Protect the RGB state with frame_lock Derek J. Clark
2026-12-04  0:18 ` [PATCH 4/8] HID: hid-msi: Re-init on reset during resume Derek J. Clark
2026-12-04  0:37   ` sashiko-bot
2026-12-04  0:18 ` [PATCH 5/8] HID: hid-msi: Drain in-flight MCU traffic before suspend Derek J. Clark
2026-12-04  0:38   ` sashiko-bot
2026-12-04  0:18 ` [PATCH 6/8] HID: hid-msi: Defer RGB updates while the MCU is suspended Derek J. Clark
2026-12-04  0:32   ` sashiko-bot
2026-12-04  0:18 ` [PATCH 7/8] HID: hid-msi: Switch the RGB LED to brightness_set_blocking Derek J. Clark
2026-12-04  0:39   ` sashiko-bot
2026-12-04  0:18 ` [PATCH 8/8] USB: core: quirks: Add RESET_RESUME quirk for MSI Claw Derek J. Clark
2026-12-04  0:39 ` [PATCH 0/8] MSI Claw suspend, resume and ROM commit fixes sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204001846.3801336-2-derekjohn.clark@gmail.com \
    --to=derekjohn.clark@gmail.com \
    --cc=bentiss@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jikos@kernel.org \
    --cc=kernel@lists.opengamingcollective.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pgriffais@valvesoftware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.