From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Tristan Lobb <tristan.lobb@it-lobb.de>,
Jiri Kosina <jkosina@suse.com>, Sasha Levin <sashal@kernel.org>,
jikos@kernel.org, bentiss@kernel.org,
linux-input@vger.kernel.org
Subject: [PATCH AUTOSEL 6.17-5.4] HID: quirks: avoid Cooler Master MM712 dongle wakeup bug
Date: Mon, 27 Oct 2025 20:38:54 -0400 [thread overview]
Message-ID: <20251028003940.884625-10-sashal@kernel.org> (raw)
In-Reply-To: <20251028003940.884625-1-sashal@kernel.org>
From: Tristan Lobb <tristan.lobb@it-lobb.de>
[ Upstream commit 0be4253bf878d9aaa2b96031ac8683fceeb81480 ]
The Cooler Master Mice Dongle includes a vendor defined HID interface
alongside its mouse interface. Not polling it will cause the mouse to
stop responding to polls on any interface once woken up again after
going into power saving mode.
Add the HID_QUIRK_ALWAYS_POLL quirk alongside the Cooler Master VID and
the Dongle's PID.
Signed-off-by: Tristan Lobb <tristan.lobb@it-lobb.de>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## BACKPORT RECOMMENDATION: **YES**
Based on comprehensive analysis using semantic code analysis tools and
repository examination, this commit **SHOULD** be backported to stable
kernel trees.
---
## DETAILED ANALYSIS
### 1. SEMANTIC TOOLS USED
**MCP Semcode Tools:**
- `mcp__semcode__grep_functions`: Searched for all uses of
HID_QUIRK_ALWAYS_POLL across the HID subsystem - found 5 usage sites
in usbhid/hid-core.c
- `mcp__semcode__find_function`: Located the `hid_lookup_quirk()`
function (drivers/hid/hid-quirks.c:1297-1332) to understand quirk
application mechanism
- `mcp__semcode__find_callers`: Identified 3 callers of
`hid_lookup_quirk()` - `__hid_device_probe()`, `hid_add_device()`, and
`usbhid_parse()` - confirming quirks are applied during device
initialization
**Standard Tools:**
- `Grep`: Found HID_QUIRK_ALWAYS_POLL definition (BIT(10) in
include/linux/hid.h:383) and 45+ existing quirk entries using this
flag
- `Read`: Examined usbhid/hid-core.c implementation (lines 680-763,
1165-1224) to understand quirk behavior
- Git analysis: Reviewed commit history showing this is a well-
established pattern with many similar commits
### 2. CODE CHANGE ANALYSIS
**What Changed:**
- **drivers/hid/hid-ids.h** (+3 lines): Added vendor ID (0x2516) and
product ID (0x01b7) definitions for Cooler Master
- **drivers/hid/hid-quirks.c** (+1 line): Added quirk table entry
mapping the device to HID_QUIRK_ALWAYS_POLL
**Change Size:** 4 lines added, 0 lines removed (0.075% addition to hid-
quirks.c)
### 3. FUNCTIONAL IMPACT
**What HID_QUIRK_ALWAYS_POLL Does (verified via semantic analysis):**
From examining `drivers/hid/usbhid/hid-core.c`:
- **usbhid_start() (line 1170-1182)**: Immediately starts input polling
and sets `needs_remote_wakeup`, keeping device active from
initialization
- **usbhid_open() (line 689-692)**: Skips normal power management setup,
preventing device sleep
- **usbhid_close() (line 752-760)**: Does NOT stop polling or cancel
URBs when interface closes - device stays active
- **usbhid_stop() (line 1219-1222)**: Only clears polling when device is
fully stopped
**Effect:** Device continuously polls and never enters power-saving
mode, preventing wakeup bugs.
### 4. BUG FIXED
**User-Visible Problem:**
The Cooler Master MM712 dongle has a vendor-defined HID interface
alongside its mouse interface. If not continuously polled, the mouse
completely stops responding after waking from power-saving mode,
rendering it unusable.
**Severity:** HIGH for affected users - device becomes completely non-
functional after entering power save
**Affected Hardware:** Only Cooler Master MM712 wireless mouse dongle
(USB VID:PID = 0x2516:0x01b7)
### 5. IMPACT SCOPE (via semantic analysis)
**Callers of quirk system:**
- `hid_lookup_quirk()` is called during device probe/initialization by 3
functions
- Quirks are matched via exact USB VID/PID comparison in the
`hid_quirks[]` static table
- **Result:** This change ONLY affects devices with exact VID/PID match
(0x2516:0x01b7)
**Regression Risk:** **NEAR ZERO**
- Cannot affect any other devices - quirk is device-specific via
hardware ID matching
- Uses 100% existing code paths - no new logic introduced
- 45+ other devices already use identical HID_QUIRK_ALWAYS_POLL
mechanism successfully
**Dependencies:** **NONE**
- HID_QUIRK_ALWAYS_POLL has existed since early quirk system
implementation
- All code paths already present in stable kernels
- No API changes, no struct changes, no architectural changes
### 6. STABLE TREE COMPLIANCE
**Criteria Assessment:**
✅ **Fixes user-visible bug:** YES - mouse stops working after power save
✅ **Obviously correct:** YES - uses established pattern, 45+ similar
devices
✅ **Small and contained:** YES - only 4 lines, single quirk entry
✅ **No new features:** YES - purely a hardware compatibility fix
✅ **Low regression risk:** YES - device-specific, cannot affect others
✅ **Real-world impact:** YES - device unusable without fix
✅ **Self-contained:** YES - no dependencies on other commits
❌ **Explicit stable tag:** NO - but not required for autosel or manual
selection
### 7. HISTORICAL PRECEDENT
**Similar commits in kernel history (verified via git log):**
Found 20+ nearly identical commits adding HID_QUIRK_ALWAYS_POLL for
mice/keyboards:
- ADATA XPG wireless gaming mice (multiple commits: fa9fdeea1b7d6,
cea2bda9d89b3, etc.)
- Lenovo PixArt optical mice (6c46659b46cc9, 8ca621939d766,
b2fc347e2126b, etc.)
- Dell, HP, Microsoft, Logitech mice (multiple devices)
- Chicony, Primax, KYE mice (multiple devices)
**Pattern:** These hardware compatibility quirks are routinely added and
are excellent backport candidates due to:
- User-facing functionality fixes
- Zero risk to other hardware
- Minimal code size
- Well-tested mechanism
### 8. BACKPORT JUSTIFICATION
**Strong reasons FOR backporting:**
1. **Real user impact:** Users with this hardware experience complete
device failure after power save - this is not a minor inconvenience
but a critical functionality loss
2. **Surgical precision:** The fix is perfectly targeted - only affects
the specific broken hardware, impossible to cause regressions on
other systems
3. **Battle-tested mechanism:** HID_QUIRK_ALWAYS_POLL is used by 45+
devices successfully. The code paths are mature and stable.
4. **Trivial to apply:** 4 lines of code, no conflicts expected, no
dependencies on other changes
5. **Follows stable rules:** This is a bug fix, not a feature. It's
small, obvious, and important.
6. **Cost/benefit ratio:** Minimal backport effort vs significant user
experience improvement
**Arguments AGAINST backporting:**
1. No explicit "Cc: stable@vger.kernel.org" tag (but this is common for
autosel-eligible fixes)
**Verdict:** The arguments for backporting overwhelmingly outweigh the
single minor argument against.
---
## RECOMMENDATION SUMMARY
**Backport Status: YES**
This commit is an **excellent candidate** for stable backporting. It
fixes a critical hardware compatibility bug affecting Cooler Master
MM712 dongle users, is completely self-contained, carries near-zero
regression risk, and follows a well-established kernel pattern for
handling power management issues in HID devices. The change is surgical,
minimal, and addresses a real user-facing problem that renders hardware
unusable.
drivers/hid/hid-ids.h | 3 +++
drivers/hid/hid-quirks.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index ded5348d190c5..cca5e841bf50c 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -342,6 +342,9 @@
#define USB_DEVICE_ID_CODEMERCS_IOW_FIRST 0x1500
#define USB_DEVICE_ID_CODEMERCS_IOW_LAST 0x15ff
+#define USB_VENDOR_ID_COOLER_MASTER 0x2516
+#define USB_DEVICE_ID_COOLER_MASTER_MICE_DONGLE 0x01b7
+
#define USB_VENDOR_ID_CORSAIR 0x1b1c
#define USB_DEVICE_ID_CORSAIR_K90 0x1b02
#define USB_DEVICE_ID_CORSAIR_K70R 0x1b09
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index ffd034566e2e1..d7105a8395982 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -57,6 +57,7 @@ static const struct hid_device_id hid_quirks[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE), HID_QUIRK_NOGET },
{ HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS), HID_QUIRK_NOGET },
{ HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_THROTTLE), HID_QUIRK_NOGET },
+ { HID_USB_DEVICE(USB_VENDOR_ID_COOLER_MASTER, USB_DEVICE_ID_COOLER_MASTER_MICE_DONGLE), HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70RGB), HID_QUIRK_NO_INIT_REPORTS },
--
2.51.0
next prev parent reply other threads:[~2025-10-28 0:40 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 0:38 [PATCH AUTOSEL 6.17-6.1] smb/server: fix possible memory leak in smb2_read() Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17-5.4] NFS4: Fix state renewals missing after boot Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17-6.12] drm/amdgpu: remove two invalid BUG_ON()s Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17-5.15] NFS: check if suid/sgid was cleared after a write as needed Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17-6.12] HID: logitech-hidpp: Add HIDPP_QUIRK_RESET_HI_RES_SCROLL Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17-5.4] ASoC: max98090/91: fixed max98091 ALSA widget powering up/down Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17] ALSA: hda/realtek: Fix mute led for HP Omen 17-cb0xxx Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17-5.10] RISC-V: clear hot-unplugged cores from all task mm_cpumasks to avoid rfence errors Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17] ASoC: nau8821: Avoid unnecessary blocking in IRQ handler Sasha Levin
2025-10-28 0:38 ` Sasha Levin [this message]
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17] drm/amdkfd: fix suspend/resume all calls in mes based eviction path Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17-6.12] exfat: fix improper check of dentry.stream.valid_size Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17] io_uring: fix unexpected placement on same size resizing Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17] drm/amd: Disable ASPM on SI Sasha Levin
2025-10-28 0:38 ` [PATCH AUTOSEL 6.17-6.6] riscv: acpi: avoid errors caused by probing DT devices when ACPI is used Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17-6.1] drm/amd/pm: Disable MCLK switching on SI at high pixel clocks Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17-6.12] drm/amdgpu: hide VRAM sysfs attributes on GPUs without VRAM Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17] fs: return EOPNOTSUPP from file_setattr/file_getattr syscalls Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17-6.12] NFS4: Apply delay_retrans to async operations Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17-6.1] drm/amdgpu: Fix NULL pointer dereference in VRAM logic for APU devices Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17] ixgbe: handle IXGBE_VF_FEATURES_NEGOTIATE mbox cmd Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17] ixgbe: handle IXGBE_VF_GET_PF_LINK_STATE mailbox operation Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17-6.6] HID: quirks: Add ALWAYS_POLL quirk for VRS R295 steering wheel Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17-6.12] HID: nintendo: Wait longer for initial probe Sasha Levin
2025-10-28 0:39 ` [PATCH AUTOSEL 6.17-6.1] smb/server: fix possible refcount leak in smb2_sess_setup() Sasha Levin
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=20251028003940.884625-10-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=jkosina@suse.com \
--cc=linux-input@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=tristan.lobb@it-lobb.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).