From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381333; b=U2dbn++WQ5DMlCaiKt0Qt9F+L3KW6IdVwRH1/FKcnvpVYuxVDCoizbZ1NyHovEXj/i1W jOs43d0OAyMFU0+9VBdBFrcFWiph2QMpIdSoZzvls0EBnu0wWP3PKYOt6xfAOUP+L/4om hB1x0kOK0fDTX2Qr3KkARHGlDXwzFf8+YCJST2B/yAeq5pD0E5p7JXNK1OYEaKLAoEmXE aVDXbhSBuP05qZ2ekeArH1yff7wnI7dNrQk8QR/vJ1GmDEZ5Xtwme79HFCgeIWj7PxAuK EOrqoJiEY9kvqn8l6dSvRLcwCVCU80aQ43uX/8sFGF0dtbyctzX4i9AxXthCioSMe/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381333; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:Content-Language:To:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=u/M65bKaP2fNEpDre6ffJNbw43SdDQMfECPP766G4Ck=; b=GnczJzxbIk/IehvY4EUpVJe+93YxSBDES+M68QhIQDb7QBpCLw5qHwLumEXjDx/hClzs LsepUrI7hTbf3k4coSYuT2cj/yKiv2QBtXbR1UaH9G4c3YyIA3+8Q7o8d4usmcNevnHER 2fmiGV/3kCtAZBpgDSw5S/7yejGjAytxFDDqc67yn3/Hem6jwhLIn85U9hp3Ficd253C+ Z4RmrOeVR4eXSN4cVdmfa222b7yQBwv8cVqdtNfvYvOdsr8hYy52QadM4NDJPbflrS06C fQrB4FHmpbX9AFDQjzOdnPxOX/hPh9XG9MA5L/d6HPCnFf8naUu8HeQrIq27tmA5DqA== 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="hOSdwRi/"; arc=none smtp.remote-ip=209.85.215.171 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 0DA89606A322 for ; Fri, 4 Dec 2026 10:48:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0DA89606A322 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=hOSdwRi/ Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-cd6acc50b8dso505434a12.3 for ; Fri, 04 Dec 2026 02:48:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796381332; x=1796986132; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to:content-type; bh=u/M65bKaP2fNEpDre6ffJNbw43SdDQMfECPP766G4Ck=; b=hOSdwRi/UwPlMr+7ucLI75GMrI84e5hKbPvbwZ1+vpx9pKsMBHT7i/VVj+fwFHr9dq r405e5qLLFAmap4/nDEvjZPrgvmmPNpDJdhkIyxmPeJ0oNUeXzI28Va6N/5zC2idO3/n atXnrJGZTk/6LsO46SonnR/CK3ssjyAu6DaGUMCkVhwrP9QlRvF2yX+FnIKvudgsGDj8 pnHTQdmPPJAfDs88Z7FxN45UWA5LSRPevL4ULj0vFpjYWqAVrcZkScINPxncVjIbuFhz ZOO5U7rbtijVbioQk/HKjFTXkh64GNObYzWg3Kn/1w5oUWAbz7KUQF9dUbWVU+LoUlOK du+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796381332; x=1796986132; h=content-transfer-encoding:content-type:in-reply-to:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=u/M65bKaP2fNEpDre6ffJNbw43SdDQMfECPP766G4Ck=; b=auTYbN/5/qaggsrKuGOMqKtRSk5mlsHu2acqngMQ4A1FgOLVPPFCZnea/FDn/SFXij 8eLy4JRgE5kJZ2vidiWMNKiMh+lrX211H3iTiuHhwwwz93eV3iKG9z2j+7YxINIYwj6o 7gu/hq/0eNVsbzODBk6CHGs71b9kcfy3k2+R+BnVZd2o3WlGofG1X805wb/o6gzz5Elp WnNzc/GIm0HOfwuiiP9dpQIMbghgyC6UJNT3FHadfdDwtP7VeVG8SnYRdwMyzRfKUsVw iETbN7Ey7KrvNINNIynHyEjDNRZXYMGAvIDjpnmpsRvpAr46+qt9rzeAS8W8cIDbQj4i DUfg== X-Gm-Message-State: AB4q+uFoMvGtexrFhURyQGR+vzL8eoWPOkKC5Fyyrqa/ip0ZSgvWnnh5 YN2OCWQgjYT+jblkb/i6DcGEgGeeuNYhfXEDQr0laOOhQDoQhCc1HN9UmONMPQ== X-Gm-Gg: AZFdTZfvKDj1Nf8LJc/PV4m2tsxFRYYeR7ok5Qvo3pXSBjHB/4cp4cUn8OAdeZHJQFv /xu6l528wY+KRE+Z2LNBTsRFF4Y+0Frh58j0qV9dnyovIma6psF+6xLH5spnzwvMaE13UVIlm2A 8DXGuDS/nYdI1WpBzyq68VNlprlQ5D87yhL2LQLV1slGT8oCfDe2gSxIKT9DTgOSk6boR/NTXI4 tqx8ftwi3OwfGoECKJco4Uw5fM049Pi7fnFSHtIy3L5tRvYF2dqVr1dSdjO+tFFp0GOHrKNitbI XfXRsbM0Gq3nXtBeHJRKV5Y3dzCHaCkDCf7jCaiOMG+xEfXN91UgVgEP9NjrVKsTf1nByhM8YQU Fg287Y9/PzbB6hmlvd9Ly3M7oeeEYTSYGhUP++4eTLolyLqkn16ocwDY0qQLZqAOPo5M9/77nl2 ENfhS2ZzNk2gHzpIQXQQzykRdSEOKCn1HOwVFsfhTlZXTbSPmHRCXTOFRx1CPqe64i07x1wLDR1 oXRnJtEyijm9PN/bq3BBD6M7mxLNOCJxzvxnS95ggLvIXHrfA3eOTCdbN8xPzocy2vJb2r8H2Qn MfKKWfgaYw4a0rUonDT30IUWdJNSTizR/MSulg0UUWp/beuuck6dDnPH+dtvIWhd+ztm6JntkH2 7fxX/hrE= X-Received: by 2002:a17:90b:278b:b0:3b4:22d:e078 with SMTP id 98e67ed59e1d1-3b5e05675a5mr1459816a91.1.1796381331973; Fri, 04 Dec 2026 02:48:51 -0800 (PST) Received: from ?IPV6:2001:ee0:4f8a:bda0:4602:d12c:afc8:c959? ([2001:ee0:4f8a:bda0:4602:d12c:afc8:c959]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d32fe5sm9196316a91.7.2026.12.04.02.48.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 02:48:51 -0800 (PST) Message-ID: <4cc9a208-fce2-47ee-8ce4-d1d6f3097fa0@gmail.com> Date: Fri, 4 Dec 2026 17:48:49 +0700 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] HID: steelseries: Fix Arctis 7 battery reading 3% on overlapping requests Content-Language: en-US To: linux-input@vger.kernel.org References: <20261203-arctis7-battery-v2-1-5ea29f516329@netixx.it> From: =?UTF-8?B?VHLhuqduIE5hbSBUdeG6pW4=?= In-Reply-To: <20261203-arctis7-battery-v2-1-5ea29f516329@netixx.it> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thank you, I can confirm this patch fixes the transmitter disappearing when turning off the headset. Tested on Arch Linux kernel 7.3.6. Tested-by: Trần Nam Tuấn On 12/4/26 1:23 AM, Martin Oberleiter via B4 Relay wrote: > From: Martin Oberleiter > > The Arctis 7 (2018) status poll sends the connection (0x14) and battery > (0x18) requests back to back. The transmitter answers the connection > request within about a millisecond, but if the battery request arrives > before that answer has gone out, it sends the connection reply relabeled > with the 0x18 command byte. The "connected" status byte (0x03) is then > parsed as a battery level of 3%, followed some 30 ms later by the real > battery reply: > > req 06 14 > req 06 18 > rx 06 18 03 19 01 ... <- connection reply, relabeled > rx 06 18 4b 00 c8 ... <- real battery reply (75%) > > On a 1038:12ad transmitter this happened on roughly every third poll, so > the reported capacity flipped between 3% and the real value every few > seconds and the desktop kept raising low battery notifications. > > Since the same driver change, users have also reported the transmitter > flooding the log with "input irq status -75 received", its port being > "disabled by hub (EMI?)", and the transmitter disappearing when the > headset is switched off, as tracked in the bug below. The -75 flood and > the port disable were seen here too, shortly after plugging in the > transmitter with the unpatched driver, and have not been seen with this > patch applied. Users in the bug report confirm that the patch resolves > the disconnects for them. > > Wait for the connection reply before sending the battery request, and > only send it if that reply says the headset is connected. The driver's > battery request then no longer overlaps its connection request, and it > is not sent once the transmitter has reported the headset as off (the > transmitter answers it with 0 in that state). If no connection reply > arrives within 100 ms, skip the battery request for this poll. Waiting > for the reply rather than sleeping for a fixed time avoids guessing how > long the transmitter takes to answer. > > Userspace talking to the transmitter through hidraw at the same time > (e.g. HeadsetControl) can still overlap with the driver's requests; > that is not addressed here. > > Tested on a 1038:12ad transmitter: the capacity stays stable while the > headset is on, keeps its last value when it is switched off, and shows > the real value right after it is switched back on. > > The issue was diagnosed and the fix and this changelog were written > with the help of an AI coding assistant (Claude Code), from kernel logs > and instrumented builds of the driver on the affected hardware. > > Fixes: 7e749a797282 ("HID: steelseries: Add support for Arctis 7 (2018)") > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222298 > Cc: stable@vger.kernel.org > Signed-off-by: Martin Oberleiter > --- > Changes in v2: > - Rebased onto hid.git for-7.4/upstream-fixes. No code changes. > - Changelog now also covers the -75 floods, port disables and > disconnects tracked in bugzilla 222298, which users there report > this patch fixes; added Closes: and Cc: stable. > > Erik, I missed your "[PATCH] HID: steelseries: space Arctis 7 status > requests" from 24 October when I sent v1, sorry about that. Both patches > target the same overlap. Yours spaces the two requests by 10 ms; this one > waits for the connection reply and does not ask for the battery while > the headset is off. I'm happy to go with whichever you and the > maintainers prefer. The testers in bug 222298 ran this one. > > Michal, thanks for raising the -75 reports on the list. The transmitter > here showed both the -75 flood and "disabled by hub (EMI?)" with the > unpatched driver, on a root port and not behind a hub, and neither > again since running this patch. > > On for-next, the patch has a trivial context conflict with the Arctis > Pro Wireless support patch, as both add an include next to > linux/device.h. > --- > drivers/hid/hid-steelseries-arctis.c | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/drivers/hid/hid-steelseries-arctis.c b/drivers/hid/hid-steelseries-arctis.c > index df61fa33d..7b83ff8a3 100644 > --- a/drivers/hid/hid-steelseries-arctis.c > +++ b/drivers/hid/hid-steelseries-arctis.c > @@ -6,6 +6,7 @@ > * Copyright (c) 2026 Sriman Achanta > */ > > +#include > #include > #include > #include > @@ -47,6 +48,7 @@ struct steelseries_device { > bool battery_charging; > > spinlock_t lock; > + struct completion connection_reply; > bool removed; > }; > > @@ -101,16 +103,44 @@ static int steelseries_arctis_1_request_status(struct hid_device *hdev) > return steelseries_send_output_report(hdev, data, sizeof(data)); > } > > +#define STEELSERIES_ARCTIS_7_REPLY_TIMEOUT_MS 100 > + > static int steelseries_arctis_7_2018_request_status(struct hid_device *hdev) > { > + struct steelseries_device *sd = hid_get_drvdata(hdev); > const u8 connection[] = { 0x06, 0x14 }; > const u8 battery[] = { 0x06, 0x18 }; > + unsigned long flags; > + bool connected; > int ret; > > + reinit_completion(&sd->connection_reply); > + > ret = steelseries_send_output_report(hdev, connection, sizeof(connection)); > if (ret) > return ret; > > + /* > + * A request that reaches the transmitter before it has answered the > + * previous one is answered with that stale reply relabeled with the > + * new command byte, so a "connected" (0x03) reply to 0x14 would read > + * as 3% battery. With the headset off, the battery reply is 0. Only > + * ask for the battery once the connection reply is in and says the > + * headset is connected. > + */ > + if (!wait_for_completion_timeout(&sd->connection_reply, > + msecs_to_jiffies(STEELSERIES_ARCTIS_7_REPLY_TIMEOUT_MS))) { > + hid_dbg(hdev, "No connection status reply, skipping battery request\n"); > + return -ETIMEDOUT; > + } > + > + spin_lock_irqsave(&sd->lock, flags); > + connected = sd->headset_connected; > + spin_unlock_irqrestore(&sd->lock, flags); > + > + if (!connected) > + return 0; > + > return steelseries_send_output_report(hdev, battery, sizeof(battery)); > } > > @@ -175,6 +205,7 @@ static void steelseries_arctis_7_2018_parse_status(struct steelseries_device *sd > case 0x14: > /* 0x03 means that the headset is connected to the transmitter. */ > sd->headset_connected = data[2] == 0x03; > + complete(&sd->connection_reply); > break; > case 0x18: > if (!sd->headset_connected) > @@ -518,6 +549,7 @@ static int steelseries_arctis_probe(struct hid_device *hdev, > sd->hdev = hdev; > sd->info = info; > spin_lock_init(&sd->lock); > + init_completion(&sd->connection_reply); > INIT_DELAYED_WORK(&sd->status_work, steelseries_status_timer_work_handler); > > ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); > > --- > base-commit: b8d126a64d8e5f5f3b81ac3f5d89fb69d8954df7 > change-id: 20261029-arctis7-battery-1322f43fedce > > Best regards, > -- > Martin Oberleiter