From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796343531; b=pYyy+har3byg+wF9edd9O6+UYGr4WzdVaZMHbw3fQj6t7Xj3DDozOshNRuAxlgMa631v 2uE5+A64zDT1uvRkeu1gAIhy/oe5FsCd7DRublpQhayOl4Ukdpg62h/bQey2789q/B+AZ h7CMD1estygCiSANg8rIdKDW/7tKd0P9UX7uHrf3MVOXUKvbkWwLge+8CGqnOWDlxUe1S KxQvpBg5Wv9ePrMhom+oYuSDGFckC0cNP277iAG245PhdmTykeh9DZAEIfFP7fxMqssG4 6GcmlZegyaBiJt1agOzZoZRA9JWp5IjtmW/gNSlrCb+h2Wv2TsSWAdtI5TXODi3rJgQ== 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-Forwarded-Encrypted: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=ZlSCC3JTFmH+eqjGrYFLDQcPmCSXOdyrslQilbSbk5Izu/eKDlnV71w09ly08X/ZXq7A ySDFrdsNEV77fGl8+LxbZDaJ/kiVFdJGG1848BZB3C50IDrcSXfPYaHUGh1jCB8IWrTdN gZLk3Krt9pE/K6B/FJtgTuO+Kf1dTQyWhRRBzbugu+rSjEbpJafNC6jbb1T9tpNXLr192 NLsD0zH+rrkMbw76oTorKxhDoY2aL6QCseu6uObufvRbLI8KauoBl54UV2QYkonzgBLmX dGw4vtKhhrTPCSMbPqTp5ALm6l2SKLlC/LD6LxiQEXaeTdd7CnU9mc0MqRXFGLkoCsg== 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.180 Received: from mail-dy1-f180.google.com (mail-dy1-f180.google.com [74.125.82.180]) (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 05CBB606A332 for ; Fri, 4 Dec 2026 00:18:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 05CBB606A332 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-f180.google.com with SMTP id 5a478bee46e88-3874cf36e63so469476eec.0 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=iyZOXWahxffcX2pgANgC9wBBDQ982a3e27BFUZZTvaiYSVFxXh7x0e3eL24jKz4S8H 8uIrcK6bMWQ5/vQQ/T0rqpOuWVsdAHVR6Vl6zksn51Rczd5UaFG/wKgZ6/MeehX4eSK+ FP6sLaelwFc4dCcpHQzvGYaz5GSNVcR2cOABTHvBP5plqurwN506dXbMaAjtxXWXFMEc dJfLFTYdiseZucmKC54Tr0o6XsR5zaStO5gtCyb9y75cWy2KyG31Qq9lJH8wUNB1nsnh TbXhyG9YwWSZf25QbfdaSO9wYuwfvPrAkxwvTRC5+iOfoXkuTVp8xVwgG8w9QkvCwqV4 Am+g== X-Forwarded-Encrypted: i=1; AL+hErEcwhlTlzKkPDJs/isHP8kU8wWj/x9OnxxXYcXi+bzH+1ecThVG85XkNsmoiCmWnueDNKfMQnffG3g=@vger.kernel.org X-Gm-Message-State: APuU4Z9o4JPef0hPsalloQrmgmwW72+vnScQ2c1pNCOUuwFFT1gR2gHa N1E5xYZlVXL4TNfRMnen4baGiFIn1abW2U8GE0PHOlP/gGSTec25cF4e X-Gm-Gg: AZFdTZemdFis3zm5SCQqGjfXazgBy+AD35L/Y7ulBmvgZn1FSluJgMqUqspkgwFer5e YoDi2cdDa5l4FDob+zxiYJV0qGRczxJpmjsPJdhTVEHKw3Z7UmIly3C4LqBd25h8NueM9GNChSO fsqy+KlW9TMcz051JcVkw/lijOJV7DUK0CSILCjtQwY0KAiXsjJkWwVmn0gfEmuhtioHKQFiY8T od7hKN20rYGuYfEBIJr6yZ4s+yPO/rRlu9DEQQ0zjOhPatUyNk8Q9oACx1aS+3plSpe29LLsto8 jhnLSsfYKSi9FF4I/48v3S0dhiF/459wzsDFAo7jSIAAPY2cQAkuOxyCpkiUmz6aipo0PKZihoX Y7aK95fYyhjEMmOIltiOahvBTgZJ2VG9CePsGqZMygjKGaODC90EzmfwGizC9upPsIE7Hh1qKMg vPpeMGqSS2IC15FT0T37APTy4p8cJUrasC//gRGps3sYC4Z9oxol/YZlDa7OqXL8svJBIYneJR2 JmAilgUXY06WGEGaLoVH1sxXnL2496TpxJNYbYL25xE9CFgX/tozWpj1ONW2fHUDFuI8tLCd8hw P6LyFy8s3YJW1kbuO+jaTywIo+ykyI8MSjcNUvAzH3PY9z0NkKZI/jvM2/f4A/uMl+TqtBQmF6k pzX57zS97/LGFRQQUMnIPIBQNcNZf7Q== 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-usb@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