Linux USB
 help / color / mirror / Atom feed
* [PATCH 0/8] MSI Claw suspend, resume and ROM commit fixes
@ 2026-12-04  0:18 Derek J. Clark
  2026-12-04  0:18 ` [PATCH 1/8] HID: hid-msi: Queue the RGB work item on system_dfl_wq Derek J. Clark
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Derek J. Clark @ 2026-12-04  0:18 UTC (permalink / raw)
  To: jikos, bentiss
  Cc: linux-input, kernel, gregkh, linux-usb, pgriffais,
	derekjohn.clark

The Claw's configuration driver talks to the MCU over a single control
interface with one command outstanding at a time. Suspend and resume break
that assumption in three places:
  - A resume that resets the device leaves the driver holding state the
    MCU has thrown away.
  - A reply can still be in flight when we suspend, and a store issued
    against the suspending interface waits its full timeout before it
    fails.
  - An RGB write issued while suspended is dropped after the driver has
    already stored the new value, so sysfs reports a setting the MCU never
    received.

On top of that four write paths end with SYNC_TO_ROM, which wears on the
internal flash for changes that only need to live in the MCU's working
copy, the RGB family reads and writes its state with the wrong lock or no
lock at all, and the RGB work item sits on the deprecated system_wq.

This series fixes the above problems in 8 patches:

Patch 1: Queue the RGB work item on system_dfl_wq
Patch 2: Move the ROM commit to an explicit apply attribute
Patch 3: Protect the RGB state with frame_lock
Patch 4: Re-init on reset during resume
Patch 5: Drain in-flight MCU traffic before suspend
Patch 6: Defer RGB updates while the MCU is suspended
Patch 7: Switch the RGB LED to brightness_set_blocking
Patch 8: Add RESET_RESUME quirk for MSI Claw

Greg, patch 8 is included in the series so it stays testable as a whole.
If you prefer, I can send it to you on its own through the usb tree, just
let me know.

Testing was done on an MSI Claw 8 AI+ and on an MSI Claw A8, on hid
for-next and 7.3.5-valve1 with this series applied. The attribute suite
exercises every sysfs file the driver exposes in both xinput and dinput,
rejects the values it should reject, blinks the LED through the led-core
timer path, and suspends and resumes with RGB state pending, with no
failures. The USB quirk was found by running usbcore.quirks=0db0:1902:b
on the MSI Claw A8 before the entry went into the table.

Two patches against this driver are on the list at the same time. Kenhou
Iijima is guarding against delayed 0x06 ACKs [1] and Ana Veto raises a
uevent when the MCU changes the mode by itself [2]. Neither is a dependency
of this series. Deciding which command a delayed ACK belongs to is [1]'s
subject and not something these patches settle. Protocol timings are kept
out of the patches for that reason and will be posted on that thread.

This series does not fix everything around the commit. The driver clears
its orphan flag when a waited command times out and when the 25 ms hold
before the next command expires, which leaves the MCU's late answer
unattributed. That is the same state machine [1] works on and belongs
there.

LLM Disclosure: I used a local LLM agent for this series. It worked
interactively from my instructions. I used it to discover and validate the
bugs and to brainstorm options for resolving them. Additionally, I ran
multiple iterations of the series through Sashiko locally, but due to the
multi-hour timeline with my setup I found it to be impractical and have not
run it against the latest version.

[1] https://lore.kernel.org/all/20261201164931.12935-1-kenhou@kenhou.net
[2] https://lore.kernel.org/all/20261117132448.57489-1-green.koala2979@fastmail.com/

Derek J. Clark (8):
  HID: hid-msi: Queue the RGB work item on system_dfl_wq
  HID: hid-msi: Move the ROM commit to an explicit apply attribute
  HID: hid-msi: Protect the RGB state with frame_lock
  HID: hid-msi: Re-init on reset during resume
  HID: hid-msi: Drain in-flight MCU traffic before suspend
  HID: hid-msi: Defer RGB updates while the MCU is suspended
  HID: hid-msi: Switch the RGB LED to brightness_set_blocking
  USB: core: quirks: Add RESET_RESUME quirk for MSI Claw

 drivers/hid/hid-msi.c     | 355 +++++++++++++++++++++++++++++---------
 drivers/usb/core/quirks.c |   6 +
 2 files changed, 227 insertions(+), 86 deletions(-)


base-commit: 47d0d5ce3cfca63a04eabcbeef7086d06240ff97
-- 
2.56.0

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

end of thread, other threads:[~2026-12-04  0:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  0:18 [PATCH 0/8] MSI Claw suspend, resume and ROM commit fixes Derek J. Clark
2026-12-04  0:18 ` [PATCH 1/8] HID: hid-msi: Queue the RGB work item on system_dfl_wq Derek J. Clark
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

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