From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796343531; b=wUne8hoy1d/j0poXk/npww+suakde+N3s7PLNHGuTXFVJFXcX3meHBahC1C0r74T7M/4 YT97GIWVSlazj9KRKnC6vnwx8Zc8Z0BXnvdTq4igxgdNTlNJ9G69IzQQv1qpF9rL0sMBH 6yKsQvyh+YNf31TqazH+7nhIIcjUNmxscSWysk1/cj7HXsiscIXfJEDR3yqneNxF+16fw 2PILb5Pr7F+g8BUwy+dDYBXD/qm9jYtr9bM+MeRFVpS0aLzMcI9hFzp2DkbcGDBjNhDR+ oG6JB5LgdIHJBUzv0chNG8XtNi4q/+/JtT0RAjVP3mTpfNP8SY/tO1VVxhTgp2tc3lw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796343531; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=qdCi4olV6vCFmPXIYmgOCJIcgYPzodqYsgdvB9L8GP4=; b=z/mky/+eZh4BL2fk5rByNQLy7ALkebGnbXsVdGidCTFCRNJ2NTYIWjvq41ff1wy3YzDs OLqBkbjA4kIPLnfwyiJRLnrQeXxabCBDO1C/BUDpNu/UTeWw41aZclBJzOJb02xXuzSV+ ExVAZ8n/nFq7W3wSnxtlXb/IpQALE3a/hew8uX9aA9A9i49oU8l8uqeeyvmbFlRtbZTe1 Ckd5kCWRzo8ODdSHOouZlpY4CwLHEPJn8qLC3FoWeGRhv3jSROs6kGIgSqtP5GoysWeMP LmOG9KQZKqi4320GkyyRO47G7wSKgsHMBVJWD2UMiiGfdOF62H82VDFEjqjie8hC+tQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=X48ys0P5; arc=none smtp.remote-ip=74.125.82.172 Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 147B4606A333 for ; Fri, 4 Dec 2026 00:18:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 147B4606A333 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=X48ys0P5 Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-38699cf08dfso411425eec.1 for ; Thu, 03 Dec 2026 16:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796343530; x=1796948330; 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:content-type; bh=qdCi4olV6vCFmPXIYmgOCJIcgYPzodqYsgdvB9L8GP4=; b=X48ys0P5t762rxANpO4l4307GcOiGujV4fdTJPbVjSDZLtnIaNyd7C/cZ88ddOdHDM 9aULKj4qj0HUtM8S7J6gkHzbs9D4xgImPz9+Y4S/BJf+qs1qKWLlf37rHHv57wb6TRNa hl0LkX9rnMVP9WA2cyz1S5ZQZSN0winw9wWBFXljL8gAe9S67bBujsCLLzo0fmp/PqjS VOzhiAZu0jDcVebJAU5/QJlQb51r2g/T2CV+Vlu8xjI+bV08TOB+c5hXAgrClT29/cfu BrDfFinAxBPsoI2Qy7ZXbYVg4DGwFbS7LgFiK4jlAiu1qzKAYXboGBDfG1fHsfnuJmdL /xrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796343530; x=1796948330; 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:content-type; bh=qdCi4olV6vCFmPXIYmgOCJIcgYPzodqYsgdvB9L8GP4=; b=FgPSXTb23SM0I/XKdPdtjTE5gmz4jqCtdxuikkEpII7IMc3qNIFJCar5ANUh9x8z5u 7Yrf8VSEQgpao+CgAsGLKu7oHl5SueyPK5ZBQFi00/+4dJsor/ItUBpAnHIGWlmM3c0o est4YPIYiWI7q2yCQ6x3Vn8LeJ/KfucNI0K4HVL8RzJdZAPAfNV7zQcoWSn+f0Nu4HQB 9Zy5zLh1KUofGchiErVtdsWpJs3epgN/HCu80kJiqJqALt1qZ4u31BBeP+NI8DhhC5WE UoXhBuYpp2gwnOh1vA1CtYf+039jseNmMl4el6Yr/7rAZqCfPGFl4WHJUCfb+S82+fQ3 0oFQ== X-Gm-Message-State: APuU4Z8fjq/oQUN0mSuo6el7+YM9FMrso4iF2oA2eA9GsMfkBws7Dtn8 6NlJ0f4JiNeA5ksnHqjEzoSIA3vKu+63l5JtKA/gJ59dANlmo4a1qwff X-Gm-Gg: AZFdTZcqUy1tWDWltIwOib+pvYI3BNEg5ZXyKiM7KIfiM2Nxk84vr+RWGQ/dnZqthiB R3g8lt+HVM2iLygngtE5nPKilcW8+wK9avuwjZNn6xVGGscvtFMP4ETJB6lYSP0wud9UTmyg+Cv v2AKtrwtxn8UkIrK0C/T06vt1NTtK6SBFXBmpNViyoGUOhxWf78LLmxmKXn+b6JAKFzHT3xTCAz IQIR5BW7Fnd1jOP2KLJRGS1bxMyR+TaLUeMiAOpPQBMGb+01zLaZVIvSpk7iRy0LlWIpFmjbfyj 95Mz8kS2OOzNcQu+F5gSKwI9fgeXjGRMNQBzRZyIK/jOsUi7RCiB6p6ug2lfI9XWItAJ9UY8Q1o iVuvKLsn007p8QUd5KtDKqL++rXHx1/pdOxeBz6I9yP8ZKX+di/OEYZGMRv5ddcrNSpKeTbjZIk v4pldRKv41Cyv9+xSLsn6WGrtFk1BMD6kzxs1eyARWIttSsPBYnhEC9n7O57duT+bcjrH9jknCb m6kmaP51JEh5ymhTqXsvbqHmSVPvtlQX9Tv1Nu/RLIbACow0YPFcTDENtgVdNvSvRMZs7s6e9bw +WcJTwDokGdzsGktEaHffNOCXUIqMHGBXPVx3QZHu0ZN5d6gE2wej5Mry+jd4Fr5QEStSKWhqhJ aQ58GINVIaaBPhLpJZC42evbzqBzLmw== X-Received: by 2002:a05:693c:4146:10b0:36e:2b8b:a098 with SMTP id 5a478bee46e88-3875218f8femr436634eec.31.1796343530061; Thu, 03 Dec 2026 16:18:50 -0800 (PST) Received: from lappy.taila8a9bd.ts.net (108-228-232-20.lightspeed.sndgca.sbcglobal.net. [108.228.232.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-387521bdedbsm1130836eec.12.2026.12.03.16.18.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 16:18:49 -0800 (PST) From: "Derek J. Clark" 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 0/8] MSI Claw suspend, resume and ROM commit fixes Date: Thu, 3 Dec 2026 16:18:38 -0800 Message-ID: <20261204001846.3801336-1-derekjohn.clark@gmail.com> X-Mailer: git-send-email 2.56.0 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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