* [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes
@ 2026-11-20 8:40 Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 01/14] HID: logitech-hidpp: fix G920 force-feedback initialization timeout Dmitry Torokhov
` (14 more replies)
0 siblings, 15 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
Per Jiri Kosina's request, the v2 series has been split into this
14-patch bug-fix series targeting v7.4 and a separate 18-patch rework
and cleanup series targeting v7.5. The open-evdev-across-unbind
force-feedback teardown use-after-free (v2 patch 22/33) is now handled
in input core ("Input: destroy force-feedback device on input
unregistration") and has been dropped.
This series starts from Gideon Heinz's report of Logitech G920
force-feedback initialization timing out in v7.3 and addresses several
pre-existing bugs and lifetime races in hid-logitech-hidpp.
The force-feedback and teardown fixes temporarily enable device I/O
around g920_get_config() in hidpp_input_configured(), switch
hidpp_ff_queue_work() to GFP_ATOMIC since callbacks run under the input
event spinlock, drain the G920 FF workqueue before closing the HID
transport on input close, synchronously disable driver work items and
disconnect input devices with device I/O enabled before stopping the
transport on removal and probe failure, avoid storing an ERR_PTR in
battery->ps on registration failure, avoid NULL pointer subtraction in
the HID++ 1.0 consumer keys report fixup, and fix an off-by-one in G920
slot tracking that made the 63rd user effect in slot 64 unusable and
leaked it across reopen.
The transport and battery fixes update hidpp_send_message_sync() to stop
retrying timeouts and transport errors, initialize response buffers
before publishing send_receive_buf to eliminate races with concurrent or
spurious packets, fix HID++ 1.0 battery mileage event parsing and state
updates, properly propagate negative errors in ADC measurement (0x1f20)
queries, mark devices online on unified battery (0x1004) events while
gating 0x1000/0x1004 dispatch, fix K750 solar battery feature lookup and
reconnect handling, and expose and correctly map the charge_type
property for the battery voltage (0x1001) feature.
Note that device removal teardown still has limitations due to how HID
core's hid_device_io_start() and hid_device_io_stop() (via
driver_input_lock) gate both driver raw command/response I/O and
subdriver event forwarding, disabling I/O before .remove() and
hid_disconnect(). For instance, HIDPP_QUIRK_DELAYED_INIT devm-managed
input devices are still unregistered after hid_hw_stop(), and
hidpp_connect_event() publishes hidpp->input before input registration
completes. Resolving these teardown edge cases cleanly will require
follow-up work in HID core and driver input registration.
Thanks.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
Changes in v3:
- Split out the 14 bug fixes into this series for v7.4 per Jiri Kosina,
moving the 18 rework and cleanup patches into a separate series for
v7.5 and dropping v2 patch 22/33 in favor of input core teardown.
- Collected Tested-by tags from Gideon Heinz on all unchanged patches in
this series (omitted from patches 12 and 14 which were updated after
v2 testing).
- Gated event dispatch in hidpp_raw_hidpp_event() on
HIDPP_CAPABILITY_UNIFIED_BATTERY so 0x1000 and 0x1004 events are
routed to their respective handlers instead of cross-corrupting
battery state.
- In hidpp20_battery_map_status_voltage(), set charge_type to unknown
when status is unknown, to none when discharging, full, or not
charging, and to standard, fast, or trickle only when charging.
- Reset charge_type to unknown on wireless disconnect in
hidpp_connect_event().
- Link to v2: https://patch.msgid.link/20261110-hid-logitech-hidpp-v2-0-30743e91d83b@gmail.com
Changes in v2:
- Rebased the series on top of linux-next.
- Collected Tested-by tags from Gideon Heinz for 17 v1 patches (omitted
from patch 4 where hidpp_remove() was significantly altered).
- Reorganized the series to place all 14 stable bug fixes upfront,
followed by next refactorings and modernizations.
- Updated hidpp_remove() to enable device I/O while draining work
items and disconnecting hidinput so in-flight transfers and
force-feedback teardown can receive device replies (noting that
complete resolution of delayed-init and transport teardown ordering
requires follow-up work in HID core).
- Stopped retrying non-busy errors (timeouts and negative transport
failures) in hidpp_send_message_sync().
- Initialized response buffers before publishing send_receive_buf to
prevent stale response reads on concurrent or spurious events.
- Fixed HID++ 1.0 battery mileage event parsing to read capacity from
the correct report byte and update battery state.
- Handled negative transport and timeout errors properly in ADC
measurement (0x1f20) queries.
- Marked devices online when receiving unified battery (0x1004) events.
- Fixed K750 solar battery feature lookup and reconnect handling.
- Exposed charge_type property for battery voltage (0x1001) feature.
- Link to v1: https://patch.msgid.link/20261109061103.2887636-1-dmitry.torokhov@gmail.com
---
Dmitry Torokhov (14):
HID: logitech-hidpp: fix G920 force-feedback initialization timeout
HID: logitech-hidpp: use GFP_ATOMIC in hidpp_ff_queue_work()
HID: logitech-hidpp: drain G920 FF workqueue before closing transport
HID: logitech-hidpp: disable works before stopping transport
HID: logitech-hidpp: do not store ERR_PTR in battery->ps
HID: logitech-hidpp: avoid NULL subtraction in consumer key report fixup
HID: logitech-hidpp: fix off-by-one in G920 force-feedback slot tracking
HID: logitech-hidpp: do not retry timeouts and transport errors in hidpp_send_message_sync()
HID: logitech-hidpp: initialize response buffer before publishing send_receive_buf
HID: logitech-hidpp: fix HID++ 1.0 battery mileage event parsing
HID: logitech-hidpp: handle negative errors in hidpp20_get_adc_measurement_1f20()
HID: logitech-hidpp: mark device online on unified battery 0x1004 events
HID: logitech-hidpp: fix K750 solar battery feature lookup and reconnect
HID: logitech-hidpp: expose charge_type property for battery voltage feature
drivers/hid/hid-logitech-hidpp.c | 150 ++++++++++++++++++++++++++++-----------
1 file changed, 107 insertions(+), 43 deletions(-)
---
base-commit: 84abb955b1015477aa11a96e2f3ac1b938b77f48
change-id: 20261110-hid-logitech-hidpp-6884bfb6a348
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 01/14] HID: logitech-hidpp: fix G920 force-feedback initialization timeout
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 02/14] HID: logitech-hidpp: use GFP_ATOMIC in hidpp_ff_queue_work() Dmitry Torokhov
` (13 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
Commit 544315e40172 ("HID: logitech-hidpp: move FF initialization to
.input_configured()") moved Logitech G920 force-feedback querying and
initialization into hidpp_input_configured(), which runs during
hid_connect(). Because hidpp_probe() calls hid_device_io_stop() across
hid_connect(), incoming HID++ responses from the device are blocked
and g920_get_config() times out with -ETIMEDOUT.
Temporarily re-enable HID device I/O around g920_get_config() in
hidpp_input_configured() so the hardware configuration queries receive
their replies during input setup.
Fixes: 544315e40172 ("HID: logitech-hidpp: move FF initialization to .input_configured()")
Reported-by: Gideon Heinz <gideonheinz02@gmail.com>
Closes: https://lore.kernel.org/r/CAPb1+K1-pirdLGZ1wTUw26G6pvhg7rGP3QZ172ys5DB7rNCf5w@mail.gmail.com
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 60fc6b86a085..85d8d168ff15 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4096,7 +4096,9 @@ static int hidpp_input_configured(struct hid_device *hdev, struct hid_input *hid
if (!list_is_first(&hidinput->list, &hdev->inputs))
return 0;
+ hid_device_io_start(hdev);
ret = g920_get_config(hidpp, &data);
+ hid_device_io_stop(hdev);
if (!ret)
ret = hidpp_ff_init(hidpp, &data);
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 02/14] HID: logitech-hidpp: use GFP_ATOMIC in hidpp_ff_queue_work()
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 01/14] HID: logitech-hidpp: fix G920 force-feedback initialization timeout Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 03/14] HID: logitech-hidpp: drain G920 FF workqueue before closing transport Dmitry Torokhov
` (12 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
Force-feedback playback, gain, and autocenter updates are invoked by the
input force-feedback core while holding the input device event spinlock
with interrupts disabled. Allocating work items with GFP_KERNEL in
hidpp_ff_queue_work() can therefore sleep in atomic context.
Allocate work items with GFP_ATOMIC instead so force-feedback commands
can be queued safely while event locks are held.
Fixes: ff21a635dd1a ("HID: logitech-hidpp: Force feedback support for the Logitech G920")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 85d8d168ff15..d9342a3e8122 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2542,9 +2542,10 @@ static void hidpp_ff_work_handler(struct work_struct *w)
static int hidpp_ff_queue_work(struct hidpp_ff_private_data *data, int effect_id, u8 command, u8 *params, u8 size)
{
- struct hidpp_ff_work_data *wd = kzalloc_obj(*wd);
+ struct hidpp_ff_work_data *wd;
int s;
+ wd = kzalloc_obj(*wd, GFP_ATOMIC);
if (!wd)
return -ENOMEM;
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 03/14] HID: logitech-hidpp: drain G920 FF workqueue before closing transport
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 01/14] HID: logitech-hidpp: fix G920 force-feedback initialization timeout Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 02/14] HID: logitech-hidpp: use GFP_ATOMIC in hidpp_ff_queue_work() Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport Dmitry Torokhov
` (11 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
Probe no longer keeps the HID transport open indefinitely, so the
underlying USB interrupt IN endpoint only stays active while the HID
transport is held open. When the last input user closes the device
after input core flushes active effects, or when the device is
inhibited with commands still queued, releasing the HID transport
shuts down transport I/O unless another client holds it open. Queued
force-feedback commands then fail to receive their HID++ replies,
causing command timeouts and leaving stale slot mappings behind.
Override the input open and close callbacks once G920 force feedback is
initialized so the force-feedback send queue drains completely before
closing the HID transport.
Fixes: 91cf9a98ae41 ("HID: logitech-hidpp: make .probe usbhid capable")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index d9342a3e8122..d5f53b35ac6f 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2815,6 +2815,22 @@ static void hidpp_ff_destroy(struct ff_device *ff)
kfree(data->effect_ids);
}
+static int g920_input_open(struct input_dev *dev)
+{
+ struct hid_device *hid = input_get_drvdata(dev);
+
+ return hid_hw_open(hid);
+}
+
+static void g920_input_close(struct input_dev *dev)
+{
+ struct hid_device *hid = input_get_drvdata(dev);
+ struct hidpp_ff_private_data *data = dev->ff->private;
+
+ flush_workqueue(data->wq);
+ hid_hw_close(hid);
+}
+
static int hidpp_ff_init(struct hidpp_device *hidpp,
struct hidpp_ff_private_data *data)
{
@@ -2897,6 +2913,9 @@ static int hidpp_ff_init(struct hidpp_device *hidpp,
ff->set_autocenter = hidpp_ff_set_autocenter;
ff->destroy = hidpp_ff_destroy;
+ dev->open = g920_input_open;
+ dev->close = g920_input_close;
+
/* Create sysfs interface */
error = device_create_file(&(hidpp->hid_dev->dev), &dev_attr_range);
if (error)
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (2 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 03/14] HID: logitech-hidpp: drain G920 FF workqueue before closing transport Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 13:51 ` Jiri Kosina
2026-11-20 8:40 ` [PATCH v3 05/14] HID: logitech-hidpp: do not store ERR_PTR in battery->ps Dmitry Torokhov
` (10 subsequent siblings)
14 siblings, 1 reply; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
Device removal and the probe error unwind path cancel the connect-event
and hi-res-reset work items only after closing and stopping the HID
transport, leaving in-flight work handlers able to issue HID++ transfers
or register power-supply and input devices while transport teardown is
underway. Moving cancel_work_sync() ahead of transport shutdown is not
sufficient because incoming reports remain active until the transport
stops and can re-schedule the work items before hid_hw_stop() completes.
Disable both work items synchronously before closing or stopping the
HID transport on device removal and on the post-I/O probe failure path,
and drop the unreachable cancellations from early transport start and
open failure paths where incoming packets have not been enabled yet.
On device removal where HID core enters with device I/O stopped and
driver_input_lock held, temporarily re-enable device I/O to flush
pending work handlers and disconnect input devices before stopping the
transport. Clear HID_CLAIMED_INPUT and hidpp->input upfront so incoming
reports can still wake synchronous commands without dispatching events
to the disconnecting input device.
Fixes: 7bfd2927adca ("HID: hid-logitech-hidpp: Add basic support for Logitech G920")
Fixes: ed80cc4667ac ("HID: logitech-hidpp: Add HIDPP_QUIRK_RESET_HI_RES_SCROLL")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index d5f53b35ac6f..0e1a9fd98faf 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4805,13 +4805,13 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
return ret;
hid_hw_init_fail:
+ disable_work_sync(&hidpp->work);
+ disable_work_sync(&hidpp->reset_hi_res_work);
hid_hw_close(hdev);
hid_hw_open_fail:
hid_hw_stop(hdev);
hid_hw_start_fail:
sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group);
- cancel_work_sync(&hidpp->work);
- cancel_work_sync(&hidpp->reset_hi_res_work);
mutex_destroy(&hidpp->send_mutex);
return ret;
}
@@ -4819,15 +4819,26 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
static void hidpp_remove(struct hid_device *hdev)
{
struct hidpp_device *hidpp = hid_get_drvdata(hdev);
+ bool claimed_input;
if (!hidpp)
return hid_hw_stop(hdev);
sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group);
+ claimed_input = hdev->claimed & HID_CLAIMED_INPUT;
+ hdev->claimed &= ~HID_CLAIMED_INPUT;
+ if (claimed_input)
+ hidpp->input = NULL;
+
+ hid_device_io_start(hdev);
+ disable_work_sync(&hidpp->work);
+ disable_work_sync(&hidpp->reset_hi_res_work);
+ if (claimed_input)
+ hidinput_disconnect(hdev);
+ hid_device_io_stop(hdev);
+
hid_hw_stop(hdev);
- cancel_work_sync(&hidpp->work);
- cancel_work_sync(&hidpp->reset_hi_res_work);
mutex_destroy(&hidpp->send_mutex);
}
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 05/14] HID: logitech-hidpp: do not store ERR_PTR in battery->ps
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (3 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 06/14] HID: logitech-hidpp: avoid NULL subtraction in consumer key report fixup Dmitry Torokhov
` (9 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
When power supply registration fails, storing the error pointer directly
in the battery supply field leaves it non-NULL. Callers such as the
connect handler and battery event handlers only check for non-NULL
before notifying the power supply core, causing an error-pointer
dereference oops and blocking retries on subsequent reconnect events.
Capture the registered power supply pointer in a local variable and
publish it to device state only after registration and sysfs linking
succeed.
Fixes: a52ec107fa81 ("HID: logitech-hidpp: create the battery for all types of HID++ devices")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 0e1a9fd98faf..6ac41b7d76ee 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4333,6 +4333,7 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
struct power_supply_desc *desc = &hidpp->battery.desc;
enum power_supply_property *battery_props;
struct hidpp_battery *battery;
+ struct power_supply *ps;
unsigned int num_battery_props;
unsigned long n;
int ret;
@@ -4413,15 +4414,16 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
desc->type = POWER_SUPPLY_TYPE_BATTERY;
desc->use_for_apm = 0;
- battery->ps = devm_power_supply_register(&hidpp->hid_dev->dev,
- &battery->desc,
- &cfg);
- if (IS_ERR(battery->ps))
- return PTR_ERR(battery->ps);
+ ps = devm_power_supply_register(&hidpp->hid_dev->dev,
+ &battery->desc,
+ &cfg);
+ if (IS_ERR(ps))
+ return PTR_ERR(ps);
- power_supply_powers(battery->ps, &hidpp->hid_dev->dev);
+ power_supply_powers(ps, &hidpp->hid_dev->dev);
+ battery->ps = ps;
- return ret;
+ return 0;
}
/* Get name + serial for USB and Bluetooth HID++ devices */
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 06/14] HID: logitech-hidpp: avoid NULL subtraction in consumer key report fixup
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (4 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 05/14] HID: logitech-hidpp: do not store ERR_PTR in battery->ps Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 07/14] HID: logitech-hidpp: fix off-by-one in G920 force-feedback slot tracking Dmitry Torokhov
` (8 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
Report fixup runs for all 27 MHz devices because the keyboard quirk
is only determined later after parsing the report descriptor. For mice
and other devices without the consumer collection, searching for the
descriptor fragment returns NULL, yet the remaining length calculation
subtracts the base descriptor pointer from NULL before checking the
search result, triggering pointer-subtraction undefined behavior.
Ensure the search result is non-NULL before computing the remaining
descriptor length.
Fixes: 42bc4f3129e6 ("HID: logitech-hidpp: add support for HID++ 1.0 consumer keys reports")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 6ac41b7d76ee..53c171dfcf96 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -3872,11 +3872,9 @@ static u8 *hidpp10_consumer_keys_report_fixup(struct hidpp_device *hidpp,
0x26, 0x00 /* LOGICAL_MAX (... */
};
char *consumer_rdesc, *rdesc = (char *)_rdesc;
- unsigned int size;
consumer_rdesc = strnstr(rdesc, consumer_rdesc_start, *rsize);
- size = *rsize - (consumer_rdesc - rdesc);
- if (consumer_rdesc && size >= 25) {
+ if (consumer_rdesc && *rsize - (consumer_rdesc - rdesc) >= 25) {
consumer_rdesc[15] = 0x7f;
consumer_rdesc[16] = 0x10;
consumer_rdesc[20] = 0x7f;
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 07/14] HID: logitech-hidpp: fix off-by-one in G920 force-feedback slot tracking
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (5 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 06/14] HID: logitech-hidpp: avoid NULL subtraction in consumer key report fixup Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 08/14] HID: logitech-hidpp: do not retry timeouts and transport errors in hidpp_send_message_sync() Dmitry Torokhov
` (7 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
Logitech G920 firmware reports 64 total 1-based hardware effect slots,
reserving one slot for the built-in autocenter spring while allocating
the remaining 63 user effects across 1-based slots 2 through 64. Because
the driver subtracts the reserved slot count upfront before sizing and
bounds-checking its slot mapping table, the 63rd concurrent user effect
is assigned hardware slot 64 and exceeds the stored limit, so its slot
mapping is never recorded or released and remains leaked in wheel memory
across device close and reopen.
Keep the full hardware slot count for table sizing, lookups, and slot
bounds checks, and withhold the reserved slot count only when creating
the input force-feedback device.
Fixes: ff21a635dd1a ("HID: logitech-hidpp: Force feedback support for the Logitech G920")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 53c171dfcf96..0264e4541edf 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2872,7 +2872,7 @@ static int hidpp_ff_init(struct hidpp_device *hidpp,
for (j = 0; hidpp_ff_effects_v2[j] >= 0; j++)
set_bit(hidpp_ff_effects_v2[j], dev->ffbit);
- error = input_ff_create(dev, num_slots);
+ error = input_ff_create(dev, num_slots - HIDPP_FF_RESERVED_SLOTS);
if (error) {
hid_err(dev, "Failed to create FF device!\n");
@@ -3486,7 +3486,7 @@ static int g920_get_config(struct hidpp_device *hidpp,
return -EPROTO;
}
- data->num_effects = response.fap.params[0] - HIDPP_FF_RESERVED_SLOTS;
+ data->num_effects = response.fap.params[0];
/* reset all forces */
ret = hidpp_send_fap_command_sync(hidpp, data->feature_index,
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 08/14] HID: logitech-hidpp: do not retry timeouts and transport errors in hidpp_send_message_sync()
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (6 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 07/14] HID: logitech-hidpp: fix off-by-one in G920 force-feedback slot tracking Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 09/14] HID: logitech-hidpp: initialize response buffer before publishing send_receive_buf Dmitry Torokhov
` (6 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
When a transport failure or timeout occurs, the synchronous send helper
clears the response buffer, setting its report ID to zero. Because the
retry loop only inspects valid HID++ short, long, and very long report
IDs to decide whether to return, a cleared buffer misses both checks and
falls through to the busy-retry path. Every transport error and timeout
is therefore misidentified as a busy error and retried three times while
holding the send mutex.
Return immediately when the low-level helper reports success or a
negative error code, and only retry when the device responds with an
explicit busy protocol error.
Fixes: aba7963544d4 ("HID: logitech-hidpp: Do not assume FAP in hidpp_send_message_sync()")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 0264e4541edf..c486488efe99 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -364,6 +364,9 @@ static int hidpp_send_message_sync(struct hidpp_device *hidpp,
do {
ret = __do_hidpp_send_message_sync(hidpp, message, response);
+ if (ret <= 0)
+ break;
+
if (response->report_id == REPORT_ID_HIDPP_SHORT &&
ret != HIDPP_ERROR_BUSY)
break;
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 09/14] HID: logitech-hidpp: initialize response buffer before publishing send_receive_buf
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (7 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 08/14] HID: logitech-hidpp: do not retry timeouts and transport errors in hidpp_send_message_sync() Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 10/14] HID: logitech-hidpp: fix HID++ 1.0 battery mileage event parsing Dmitry Torokhov
` (5 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel
__do_hidpp_send_message_sync() publishes send_receive_buf before
initializing the response buffer. hidpp_raw_hidpp_event() runs in IRQ or
softirq context without taking send_mutex whenever the mutex is locked,
reading question and answer from send_receive_buf. If an incoming report
arrives after send_receive_buf is published but before response is
populated, hidpp_match_answer() inspects uninitialized memory.
Initialize response with the outgoing message and clear answer_available
before publishing send_receive_buf with release semantics, clear the
pointer with WRITE_ONCE() on completion, and read it once with acquire
semantics in the event handler.
Fixes: 2f31c5252910 ("HID: Introduce hidpp, a module to handle Logitech hid++ devices")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index c486488efe99..16dcd79059d5 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -300,14 +300,17 @@ static int __do_hidpp_send_message_sync(struct hidpp_device *hidpp,
__must_hold(&hidpp->send_mutex);
- hidpp->send_receive_buf = response;
- hidpp->answer_available = false;
-
/*
* So that we can later validate the answer when it arrives
* in hidpp_raw_event
*/
*response = *message;
+ hidpp->answer_available = false;
+ /*
+ * Pairs with smp_load_acquire() in hidpp_raw_hidpp_event() to ensure
+ * the response buffer initialization is visible before publishing.
+ */
+ smp_store_release(&hidpp->send_receive_buf, response);
ret = __hidpp_send_report(hidpp->hid_dev, message);
if (ret) {
@@ -342,7 +345,7 @@ static int __do_hidpp_send_message_sync(struct hidpp_device *hidpp,
ret = 0;
out:
- hidpp->send_receive_buf = NULL;
+ WRITE_ONCE(hidpp->send_receive_buf, NULL);
return ret;
}
@@ -4148,12 +4151,16 @@ static int hidpp_raw_hidpp_event(struct hidpp_device *hidpp, u8 *data,
* previously sent command.
*/
if (unlikely(mutex_is_locked(&hidpp->send_mutex))) {
- question = hidpp->send_receive_buf;
- answer = hidpp->send_receive_buf;
-
+ /*
+ * Pairs with smp_store_release() in __do_hidpp_send_message_sync()
+ * to ensure the initialized response buffer is observed.
+ */
+ question = smp_load_acquire(&hidpp->send_receive_buf);
if (!question)
return 0;
+ answer = question;
+
/*
* Check for a correct hidpp20 answer or the corresponding
* error
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 10/14] HID: logitech-hidpp: fix HID++ 1.0 battery mileage event parsing
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (8 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 09/14] HID: logitech-hidpp: initialize response buffer before publishing send_receive_buf Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 11/14] HID: logitech-hidpp: handle negative errors in hidpp20_get_adc_measurement_1f20() Dmitry Torokhov
` (4 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
In HID++ 1.0 battery mileage event notifications (register 0x0d), the
register address occupies the sub_id field rather than reg_address, so
the payload bytes start at rawbytes[1] (parameter p0). The driver
previously read capacity from report->rap.params[0] (rawbytes[2]),
extracting parameter p1 instead of the battery mileage percentage.
Additionally, when a change was detected, hidpp10_battery_event()
updated level and status but neglected to update battery.capacity,
leaving capacity frozen and triggering spurious power supply updates on
every subsequent event.
Read capacity from report->rawbytes[1] and store the updated capacity in
hidpp->battery.capacity when changed.
Fixes: 7f7ce2a258b4 ("HID: logitech-hidpp: enable HID++ 1.0 battery reporting")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 16dcd79059d5..0ec2f2fd6dec 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -829,7 +829,7 @@ static int hidpp10_battery_event(struct hidpp_device *hidpp, u8 *data, int size)
status = hidpp10_battery_status_map_status(report->rawbytes[2]);
break;
case HIDPP_REG_BATTERY_MILEAGE:
- capacity = report->rap.params[0];
+ capacity = report->rawbytes[1];
level = hidpp->battery.level;
status = hidpp10_battery_mileage_map_status(report->rawbytes[3]);
break;
@@ -846,6 +846,7 @@ static int hidpp10_battery_event(struct hidpp_device *hidpp, u8 *data, int size)
status == POWER_SUPPLY_STATUS_FULL;
if (changed) {
+ hidpp->battery.capacity = capacity;
hidpp->battery.level = level;
hidpp->battery.status = status;
if (hidpp->battery.ps)
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 11/14] HID: logitech-hidpp: handle negative errors in hidpp20_get_adc_measurement_1f20()
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (9 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 10/14] HID: logitech-hidpp: fix HID++ 1.0 battery mileage event parsing Dmitry Torokhov
@ 2026-11-20 8:40 ` Dmitry Torokhov
2026-11-20 8:41 ` [PATCH v3 12/14] HID: logitech-hidpp: mark device online on unified battery 0x1004 events Dmitry Torokhov
` (3 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:40 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
When hidpp_send_fap_command_sync() fails with a negative transport or
timeout error (-ETIMEDOUT, -ENODEV, etc.),
hidpp20_get_adc_measurement_1f20() only checked if (ret > 0) for
protocol errors and fell through. It then parsed zeroed response
parameters (0 mV) and returned true, marking a disconnected or
unresponsive device online and triggering spurious "possibly using the
wrong voltage curve" warnings.
Return false whenever ret is non-zero, logging the debug message only
when ret is a positive protocol error.
Fixes: c361982a13c9 ("HID: logitech-hidpp: Add support for ADC measurement feature")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 0ec2f2fd6dec..28402baf04fb 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -1952,9 +1952,10 @@ static bool hidpp20_get_adc_measurement_1f20(struct hidpp_device *hidpp,
CMD_ADC_MEASUREMENT_GET_ADC_MEASUREMENT,
NULL, 0, &response);
- if (ret > 0) {
- hid_dbg(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
- __func__, ret);
+ if (ret) {
+ if (ret > 0)
+ hid_dbg(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
+ __func__, ret);
return false;
}
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 12/14] HID: logitech-hidpp: mark device online on unified battery 0x1004 events
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (10 preceding siblings ...)
2026-11-20 8:40 ` [PATCH v3 11/14] HID: logitech-hidpp: handle negative errors in hidpp20_get_adc_measurement_1f20() Dmitry Torokhov
@ 2026-11-20 8:41 ` Dmitry Torokhov
2026-11-20 8:41 ` [PATCH v3 13/14] HID: logitech-hidpp: fix K750 solar battery feature lookup and reconnect Dmitry Torokhov
` (2 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:41 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
When a wireless device disconnects, its battery state is marked offline.
However, when the device reconnects and sends an unsolicited unified
battery status event (feature 0x1004), hidpp20_battery_event_1004()
never updated hidpp->battery.online to true and did not include the
online state in the changed check.
As a result, sysfs POWER_SUPPLY_PROP_ONLINE stayed 0, power supply
listeners were not notified of the online transition, and the 0 to 1
online transition check in hidpp_raw_hidpp_event() failed to schedule
reset_hi_res_work to reconfigure high-resolution scrolling on reconnect.
Furthermore, both feature 0x1000 and feature 0x1004 share the same
hidpp->battery.feature_index, event ID 0x00, and return 0 from their
event handlers. Because hidpp_raw_hidpp_event() previously called both
handlers unconditionally, an event on a 0x1000 device also matched
hidpp20_battery_event_1004(), corrupting the online state and decoded
battery status.
Include !hidpp->battery.online in the changed check and mark
hidpp->battery.online true when receiving a 0x1004 status event.
Gate the event dispatch in hidpp_raw_hidpp_event() on
HIDPP_CAPABILITY_UNIFIED_BATTERY so 0x1000 and 0x1004 events are routed
to their respective handlers.
Fixes: e037acf0b1ae ("HID: logitech-hidpp: add support for Unified Battery (1004) feature")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 28402baf04fb..c960d26a41dd 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -1761,12 +1761,15 @@ static int hidpp20_battery_event_1004(struct hidpp_device *hidpp,
status = hidpp20_unifiedbattery_map_status(hidpp, params[2], params[3]);
level = hidpp20_unifiedbattery_map_level(hidpp, params[1]);
- changed = status != hidpp->battery.status ||
+ changed = !hidpp->battery.online ||
+ status != hidpp->battery.status ||
(state_of_charge != hidpp->battery.capacity &&
hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_PERCENTAGE) ||
(level != hidpp->battery.level &&
hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_LEVEL_STATUS);
+ hidpp->battery.online = true;
+
if (changed) {
hidpp->battery.capacity = state_of_charge;
hidpp->battery.status = status;
@@ -4200,10 +4203,10 @@ static int hidpp_raw_hidpp_event(struct hidpp_device *hidpp, u8 *data,
last_online = hidpp->battery.online;
if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP20_BATTERY) {
- ret = hidpp20_battery_event_1000(hidpp, data, size);
- if (ret != 0)
- return ret;
- ret = hidpp20_battery_event_1004(hidpp, data, size);
+ if (hidpp->capabilities & HIDPP_CAPABILITY_UNIFIED_BATTERY)
+ ret = hidpp20_battery_event_1004(hidpp, data, size);
+ else
+ ret = hidpp20_battery_event_1000(hidpp, data, size);
if (ret != 0)
return ret;
ret = hidpp_solar_battery_event(hidpp, data, size);
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 13/14] HID: logitech-hidpp: fix K750 solar battery feature lookup and reconnect
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (11 preceding siblings ...)
2026-11-20 8:41 ` [PATCH v3 12/14] HID: logitech-hidpp: mark device online on unified battery 0x1004 events Dmitry Torokhov
@ 2026-11-20 8:41 ` Dmitry Torokhov
2026-11-20 8:41 ` [PATCH v3 14/14] HID: logitech-hidpp: expose charge_type property for battery voltage feature Dmitry Torokhov
2026-11-20 12:14 ` [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Jiri Kosina
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:41 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
In hidpp_solar_request_battery_event(), the driver checked whether
hidpp->battery.feature_index == 0xff instead of checking
solar_feature_index, causing it to re-query the root feature table
unnecessarily or misidentify whether the solar feature was resolved.
Furthermore, in hidpp_connect_event(), the HIDPP20_BATTERY block lacked
a branch for HIDPP_QUIRK_CLASS_K750, causing wireless reconnects of a
K750 keyboard to fall through to hidpp20_query_battery_info_1000() which
fails because the K750 does not implement feature 0x1000.
Check solar_feature_index in hidpp_solar_request_battery_event() and
re-enable solar battery reporting via the solar request helper on K750
reconnects.
Fixes: 696ecef9b587 ("HID: logitech-hidpp: add support for battery status for the K750")
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index c960d26a41dd..dbf8f15f5a5b 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2122,7 +2122,7 @@ static int hidpp_solar_request_battery_event(struct hidpp_device *hidpp)
u8 params[2] = { 1, 1 };
int ret;
- if (hidpp->battery.feature_index == 0xff) {
+ if (hidpp->battery.solar_feature_index == 0xff) {
ret = hidpp_root_get_feature(hidpp,
HIDPP_PAGE_SOLAR_KEYBOARD,
&hidpp->battery.solar_feature_index);
@@ -4582,7 +4582,9 @@ static void hidpp_connect_event(struct work_struct *work)
else
hidpp10_query_battery_status(hidpp);
} else if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP20_BATTERY) {
- if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_VOLTAGE)
+ if (hidpp->quirks & HIDPP_QUIRK_CLASS_K750)
+ hidpp_solar_request_battery_event(hidpp);
+ else if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_VOLTAGE)
hidpp20_query_battery_voltage_info(hidpp);
else if (hidpp->capabilities & HIDPP_CAPABILITY_UNIFIED_BATTERY)
hidpp20_query_battery_info_1004(hidpp);
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 14/14] HID: logitech-hidpp: expose charge_type property for battery voltage feature
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (12 preceding siblings ...)
2026-11-20 8:41 ` [PATCH v3 13/14] HID: logitech-hidpp: fix K750 solar battery feature lookup and reconnect Dmitry Torokhov
@ 2026-11-20 8:41 ` Dmitry Torokhov
2026-11-20 12:14 ` [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Jiri Kosina
14 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 8:41 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Gideon Heinz
Cc: Filipe Laíns, Bastien Nocera, Hans de Goede, Edwin Velds,
Stuart Hayhurst, Andrey Smirnov, linux-input, linux-kernel,
stable
Commit be281368f297 ("hid-logitech-hidpp: read battery voltage from
newer devices") added support for the 0x1001 battery voltage feature,
populated battery->charge_type, and handled POWER_SUPPLY_PROP_CHARGE_TYPE
in hidpp_battery_get_property(). However, it did not add a placeholder
slot in hidpp_battery_props[] or register POWER_SUPPLY_PROP_CHARGE_TYPE
in hidpp_initialize_battery() when HIDPP_CAPABILITY_BATTERY_VOLTAGE is
set. Consequently, the charge_type attribute was never exposed via
sysfs. Furthermore, hidpp20_battery_voltage_event() only checked
whether voltage or status changed before updating cached battery values
and notifying user space, ignoring changes in level and charge_type.
Additionally, hidpp20_battery_map_status_voltage() unconditionally set
charge_type to standard (or fast/trickle) charging even when the device
was discharging, full, not charging, or in an unknown status, and
hidpp_connect_event() left charge_type stale on wireless disconnect.
Add a placeholder slot to hidpp_battery_props[], update the fixed
property count in hidpp_initialize_battery(), append
POWER_SUPPLY_PROP_CHARGE_TYPE when HIDPP_CAPABILITY_BATTERY_VOLTAGE is
set, and include level and charge_type in the change detection condition
in hidpp20_battery_voltage_event(). In
hidpp20_battery_map_status_voltage(), map charge_type to unknown when
status is unknown, to none when discharging, full, or not charging, and
to standard, fast, or trickle only when charging. Reset charge_type to
unknown on wireless disconnect in hidpp_connect_event().
Fixes: be281368f297 ("hid-logitech-hidpp: read battery voltage from newer devices")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-logitech-hidpp.c | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index dbf8f15f5a5b..966c5932528d 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -1428,12 +1428,17 @@ static int hidpp20_battery_map_status_voltage(u8 data[3], int *voltage,
else
status = POWER_SUPPLY_STATUS_DISCHARGING;
- *charge_type = POWER_SUPPLY_CHARGE_TYPE_STANDARD;
- if (test_bit(3, &flags)) {
- *charge_type = POWER_SUPPLY_CHARGE_TYPE_FAST;
- }
- if (test_bit(4, &flags)) {
- *charge_type = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
+ if (status == POWER_SUPPLY_STATUS_CHARGING) {
+ if (test_bit(4, &flags))
+ *charge_type = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
+ else if (test_bit(3, &flags))
+ *charge_type = POWER_SUPPLY_CHARGE_TYPE_FAST;
+ else
+ *charge_type = POWER_SUPPLY_CHARGE_TYPE_STANDARD;
+ } else if (status == POWER_SUPPLY_STATUS_UNKNOWN) {
+ *charge_type = POWER_SUPPLY_CHARGE_TYPE_UNKNOWN;
+ } else {
+ *charge_type = POWER_SUPPLY_CHARGE_TYPE_NONE;
}
if (test_bit(5, &flags)) {
*level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL;
@@ -1553,7 +1558,10 @@ static int hidpp20_battery_voltage_event(struct hidpp_device *hidpp,
hidpp->battery.online = status != POWER_SUPPLY_STATUS_NOT_CHARGING;
- if (voltage != hidpp->battery.voltage || status != hidpp->battery.status) {
+ if (voltage != hidpp->battery.voltage ||
+ status != hidpp->battery.status ||
+ level != hidpp->battery.level ||
+ charge_type != hidpp->battery.charge_type) {
hidpp->battery.voltage = voltage;
hidpp->battery.capacity = hidpp20_map_battery_capacity(hidpp->hid_dev,
voltage);
@@ -1795,6 +1803,7 @@ static enum power_supply_property hidpp_battery_props[] = {
0, /* placeholder for POWER_SUPPLY_PROP_CAPACITY, */
0, /* placeholder for POWER_SUPPLY_PROP_CAPACITY_LEVEL, */
0, /* placeholder for POWER_SUPPLY_PROP_VOLTAGE_NOW, */
+ 0, /* placeholder for POWER_SUPPLY_PROP_CHARGE_TYPE, */
};
static int hidpp_battery_get_property(struct power_supply *psy,
@@ -4398,7 +4407,7 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
if (!battery_props)
return -ENOMEM;
- num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 3;
+ num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 4;
if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE ||
hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_PERCENTAGE ||
@@ -4416,6 +4425,10 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
battery_props[num_battery_props++] =
POWER_SUPPLY_PROP_VOLTAGE_NOW;
+ if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_VOLTAGE)
+ battery_props[num_battery_props++] =
+ POWER_SUPPLY_PROP_CHARGE_TYPE;
+
battery = &hidpp->battery;
n = atomic_inc_return(&battery_no) - 1;
@@ -4511,6 +4524,7 @@ static void hidpp_connect_event(struct work_struct *work)
hidpp->battery.online = false;
hidpp->battery.status = POWER_SUPPLY_STATUS_UNKNOWN;
hidpp->battery.level = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN;
+ hidpp->battery.charge_type = POWER_SUPPLY_CHARGE_TYPE_UNKNOWN;
power_supply_changed(hidpp->battery.ps);
}
return;
--
2.56.1.750.gf70dc682cf-goog
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
` (13 preceding siblings ...)
2026-11-20 8:41 ` [PATCH v3 14/14] HID: logitech-hidpp: expose charge_type property for battery voltage feature Dmitry Torokhov
@ 2026-11-20 12:14 ` Jiri Kosina
14 siblings, 0 replies; 22+ messages in thread
From: Jiri Kosina @ 2026-11-20 12:14 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Benjamin Tissoires, Gideon Heinz, Filipe Laíns,
Bastien Nocera, Hans de Goede, Edwin Velds, Stuart Hayhurst,
Andrey Smirnov, linux-input, linux-kernel, stable
On Fri, 20 Nov 2026, Dmitry Torokhov wrote:
> Per Jiri Kosina's request, the v2 series has been split into this
> 14-patch bug-fix series targeting v7.4 and a separate 18-patch rework
> and cleanup series targeting v7.5. The open-evdev-across-unbind
> force-feedback teardown use-after-free (v2 patch 22/33) is now handled
> in input core ("Input: destroy force-feedback device on input
> unregistration") and has been dropped.
>
> This series starts from Gideon Heinz's report of Logitech G920
> force-feedback initialization timing out in v7.3 and addresses several
> pre-existing bugs and lifetime races in hid-logitech-hidpp.
>
> The force-feedback and teardown fixes temporarily enable device I/O
> around g920_get_config() in hidpp_input_configured(), switch
> hidpp_ff_queue_work() to GFP_ATOMIC since callbacks run under the input
> event spinlock, drain the G920 FF workqueue before closing the HID
> transport on input close, synchronously disable driver work items and
> disconnect input devices with device I/O enabled before stopping the
> transport on removal and probe failure, avoid storing an ERR_PTR in
> battery->ps on registration failure, avoid NULL pointer subtraction in
> the HID++ 1.0 consumer keys report fixup, and fix an off-by-one in G920
> slot tracking that made the 63rd user effect in slot 64 unusable and
> leaked it across reopen.
>
> The transport and battery fixes update hidpp_send_message_sync() to stop
> retrying timeouts and transport errors, initialize response buffers
> before publishing send_receive_buf to eliminate races with concurrent or
> spurious packets, fix HID++ 1.0 battery mileage event parsing and state
> updates, properly propagate negative errors in ADC measurement (0x1f20)
> queries, mark devices online on unified battery (0x1004) events while
> gating 0x1000/0x1004 dispatch, fix K750 solar battery feature lookup and
> reconnect handling, and expose and correctly map the charge_type
> property for the battery voltage (0x1001) feature.
>
> Note that device removal teardown still has limitations due to how HID
> core's hid_device_io_start() and hid_device_io_stop() (via
> driver_input_lock) gate both driver raw command/response I/O and
> subdriver event forwarding, disabling I/O before .remove() and
> hid_disconnect(). For instance, HIDPP_QUIRK_DELAYED_INIT devm-managed
> input devices are still unregistered after hid_hw_stop(), and
> hidpp_connect_event() publishes hidpp->input before input registration
> completes. Resolving these teardown edge cases cleanly will require
> follow-up work in HID core and driver input registration.
>
> Thanks.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> Changes in v3:
> - Split out the 14 bug fixes into this series for v7.4 per Jiri Kosina,
> moving the 18 rework and cleanup patches into a separate series for
> v7.5 and dropping v2 patch 22/33 in favor of input core teardown.
> - Collected Tested-by tags from Gideon Heinz on all unchanged patches in
> this series (omitted from patches 12 and 14 which were updated after
> v2 testing).
> - Gated event dispatch in hidpp_raw_hidpp_event() on
> HIDPP_CAPABILITY_UNIFIED_BATTERY so 0x1000 and 0x1004 events are
> routed to their respective handlers instead of cross-corrupting
> battery state.
> - In hidpp20_battery_map_status_voltage(), set charge_type to unknown
> when status is unknown, to none when discharging, full, or not
> charging, and to standard, fast, or trickle only when charging.
> - Reset charge_type to unknown on wireless disconnect in
> hidpp_connect_event().
> - Link to v2: https://patch.msgid.link/20261110-hid-logitech-hidpp-v2-0-30743e91d83b@gmail.com
Applied to hid.git#for-7.4/upstream-fixes.
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport
2026-11-20 8:40 ` [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport Dmitry Torokhov
@ 2026-11-20 13:51 ` Jiri Kosina
2026-11-20 18:08 ` Dmitry Torokhov
0 siblings, 1 reply; 22+ messages in thread
From: Jiri Kosina @ 2026-11-20 13:51 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Benjamin Tissoires, Gideon Heinz, Filipe Laíns,
Bastien Nocera, Hans de Goede, Edwin Velds, Stuart Hayhurst,
Andrey Smirnov, linux-input, linux-kernel, stable
On Fri, 20 Nov 2026, Dmitry Torokhov wrote:
> Device removal and the probe error unwind path cancel the connect-event
> and hi-res-reset work items only after closing and stopping the HID
> transport, leaving in-flight work handlers able to issue HID++ transfers
> or register power-supply and input devices while transport teardown is
> underway. Moving cancel_work_sync() ahead of transport shutdown is not
> sufficient because incoming reports remain active until the transport
> stops and can re-schedule the work items before hid_hw_stop() completes.
>
> Disable both work items synchronously before closing or stopping the
> HID transport on device removal and on the post-I/O probe failure path,
> and drop the unreachable cancellations from early transport start and
> open failure paths where incoming packets have not been enabled yet.
>
> On device removal where HID core enters with device I/O stopped and
> driver_input_lock held, temporarily re-enable device I/O to flush
> pending work handlers and disconnect input devices before stopping the
> transport. Clear HID_CLAIMED_INPUT and hidpp->input upfront so incoming
> reports can still wake synchronous commands without dispatching events
> to the disconnecting input device.
>
> Fixes: 7bfd2927adca ("HID: hid-logitech-hidpp: Add basic support for Logitech G920")
> Fixes: ed80cc4667ac ("HID: logitech-hidpp: Add HIDPP_QUIRK_RESET_HI_RES_SCROLL")
> Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/hid/hid-logitech-hidpp.c | 19 +++++++++++++++----
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> index d5f53b35ac6f..0e1a9fd98faf 100644
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
> @@ -4805,13 +4805,13 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
> return ret;
>
> hid_hw_init_fail:
> + disable_work_sync(&hidpp->work);
> + disable_work_sync(&hidpp->reset_hi_res_work);
> hid_hw_close(hdev);
> hid_hw_open_fail:
> hid_hw_stop(hdev);
> hid_hw_start_fail:
> sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group);
> - cancel_work_sync(&hidpp->work);
> - cancel_work_sync(&hidpp->reset_hi_res_work);
> mutex_destroy(&hidpp->send_mutex);
> return ret;
> }
> @@ -4819,15 +4819,26 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
> static void hidpp_remove(struct hid_device *hdev)
> {
> struct hidpp_device *hidpp = hid_get_drvdata(hdev);
> + bool claimed_input;
>
> if (!hidpp)
> return hid_hw_stop(hdev);
>
> sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group);
>
> + claimed_input = hdev->claimed & HID_CLAIMED_INPUT;
> + hdev->claimed &= ~HID_CLAIMED_INPUT;
> + if (claimed_input)
> + hidpp->input = NULL;
> +
> + hid_device_io_start(hdev);
> + disable_work_sync(&hidpp->work);
> + disable_work_sync(&hidpp->reset_hi_res_work);
> + if (claimed_input)
> + hidinput_disconnect(hdev);
This fails to build, because hidinput_disconnect is defined in hid-core
and there is no declaration for it in logitech code.
I'll drop this series for now, please fix it and resubmit a version that
compiles :))
Thanks!
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport
2026-11-20 13:51 ` Jiri Kosina
@ 2026-11-20 18:08 ` Dmitry Torokhov
2026-11-20 18:12 ` Jiri Kosina
0 siblings, 1 reply; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 18:08 UTC (permalink / raw)
To: Jiri Kosina
Cc: Benjamin Tissoires, Gideon Heinz, Filipe Laíns,
Bastien Nocera, Hans de Goede, Edwin Velds, Stuart Hayhurst,
Andrey Smirnov, linux-input, linux-kernel, stable
On Fri, Nov 20, 2026 at 02:51:29PM +0100, Jiri Kosina wrote:
> On Fri, 20 Nov 2026, Dmitry Torokhov wrote:
>
> > Device removal and the probe error unwind path cancel the connect-event
> > and hi-res-reset work items only after closing and stopping the HID
> > transport, leaving in-flight work handlers able to issue HID++ transfers
> > or register power-supply and input devices while transport teardown is
> > underway. Moving cancel_work_sync() ahead of transport shutdown is not
> > sufficient because incoming reports remain active until the transport
> > stops and can re-schedule the work items before hid_hw_stop() completes.
> >
> > Disable both work items synchronously before closing or stopping the
> > HID transport on device removal and on the post-I/O probe failure path,
> > and drop the unreachable cancellations from early transport start and
> > open failure paths where incoming packets have not been enabled yet.
> >
> > On device removal where HID core enters with device I/O stopped and
> > driver_input_lock held, temporarily re-enable device I/O to flush
> > pending work handlers and disconnect input devices before stopping the
> > transport. Clear HID_CLAIMED_INPUT and hidpp->input upfront so incoming
> > reports can still wake synchronous commands without dispatching events
> > to the disconnecting input device.
> >
> > Fixes: 7bfd2927adca ("HID: hid-logitech-hidpp: Add basic support for Logitech G920")
> > Fixes: ed80cc4667ac ("HID: logitech-hidpp: Add HIDPP_QUIRK_RESET_HI_RES_SCROLL")
> > Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> > drivers/hid/hid-logitech-hidpp.c | 19 +++++++++++++++----
> > 1 file changed, 15 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> > index d5f53b35ac6f..0e1a9fd98faf 100644
> > --- a/drivers/hid/hid-logitech-hidpp.c
> > +++ b/drivers/hid/hid-logitech-hidpp.c
> > @@ -4805,13 +4805,13 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
> > return ret;
> >
> > hid_hw_init_fail:
> > + disable_work_sync(&hidpp->work);
> > + disable_work_sync(&hidpp->reset_hi_res_work);
> > hid_hw_close(hdev);
> > hid_hw_open_fail:
> > hid_hw_stop(hdev);
> > hid_hw_start_fail:
> > sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group);
> > - cancel_work_sync(&hidpp->work);
> > - cancel_work_sync(&hidpp->reset_hi_res_work);
> > mutex_destroy(&hidpp->send_mutex);
> > return ret;
> > }
> > @@ -4819,15 +4819,26 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
> > static void hidpp_remove(struct hid_device *hdev)
> > {
> > struct hidpp_device *hidpp = hid_get_drvdata(hdev);
> > + bool claimed_input;
> >
> > if (!hidpp)
> > return hid_hw_stop(hdev);
> >
> > sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group);
> >
> > + claimed_input = hdev->claimed & HID_CLAIMED_INPUT;
> > + hdev->claimed &= ~HID_CLAIMED_INPUT;
> > + if (claimed_input)
> > + hidpp->input = NULL;
> > +
> > + hid_device_io_start(hdev);
> > + disable_work_sync(&hidpp->work);
> > + disable_work_sync(&hidpp->reset_hi_res_work);
> > + if (claimed_input)
> > + hidinput_disconnect(hdev);
>
> This fails to build, because hidinput_disconnect is defined in hid-core
> and there is no declaration for it in logitech code.
>
> I'll drop this series for now, please fix it and resubmit a version that
> compiles :))
Ah, yes, I un-exported it in my hidraw cleanup patch series that you
just applied.
Hoisted by my own petard ;)
I guess we need to re-export it now that there is a valid (IMO) use case
to have it available outside of the hid core.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport
2026-11-20 18:08 ` Dmitry Torokhov
@ 2026-11-20 18:12 ` Jiri Kosina
2026-11-20 21:07 ` Dmitry Torokhov
0 siblings, 1 reply; 22+ messages in thread
From: Jiri Kosina @ 2026-11-20 18:12 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Benjamin Tissoires, Gideon Heinz, Filipe Laíns,
Bastien Nocera, Hans de Goede, Edwin Velds, Stuart Hayhurst,
Andrey Smirnov, linux-input, linux-kernel, stable
On Fri, 20 Nov 2026, Dmitry Torokhov wrote:
> Ah, yes, I un-exported it in my hidraw cleanup patch series that you
> just applied.
Hmm, but that cleanup is sitting in hid.git#for-7.5/hidraw, while this
build breakage occured in for-7.4/upstream-fixes, which is based on Linus'
tree and doesn't include that hidraw cleanup ...
> Hoisted by my own petard ;)
:))
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport
2026-11-20 18:12 ` Jiri Kosina
@ 2026-11-20 21:07 ` Dmitry Torokhov
2026-11-20 21:45 ` Jiri Kosina
0 siblings, 1 reply; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 21:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Benjamin Tissoires, Gideon Heinz, Filipe Laíns,
Bastien Nocera, Hans de Goede, Edwin Velds, Stuart Hayhurst,
Andrey Smirnov, linux-input, linux-kernel, stable
On November 20, 2026 10:12:23 AM PST, Jiri Kosina <jikos@kernel.org> wrote:
>On Fri, 20 Nov 2026, Dmitry Torokhov wrote:
>
>> Ah, yes, I un-exported it in my hidraw cleanup patch series that you
>> just applied.
>
>Hmm, but that cleanup is sitting in hid.git#for-7.5/hidraw, while this
>build breakage occured in for-7.4/upstream-fixes, which is based on Linus'
>tree and doesn't include that hidraw cleanup ...
Doesn't next mix it all together?
>
>> Hoisted by my own petard ;)
>
>:))
>
>Thanks,
>
--
Dmitry
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport
2026-11-20 21:07 ` Dmitry Torokhov
@ 2026-11-20 21:45 ` Jiri Kosina
2026-11-20 22:16 ` Dmitry Torokhov
0 siblings, 1 reply; 22+ messages in thread
From: Jiri Kosina @ 2026-11-20 21:45 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Benjamin Tissoires, Gideon Heinz, Filipe Laíns,
Bastien Nocera, Hans de Goede, Edwin Velds, Stuart Hayhurst,
Andrey Smirnov, linux-input, linux-kernel, stable
On Fri, 20 Nov 2026, Dmitry Torokhov wrote:
> >> Ah, yes, I un-exported it in my hidraw cleanup patch series that you
> >> just applied.
> >
> >Hmm, but that cleanup is sitting in hid.git#for-7.5/hidraw, while this
> >build breakage occured in for-7.4/upstream-fixes, which is based on Linus'
> >tree and doesn't include that hidraw cleanup ...
>
> Doesn't next mix it all together?
Right, the build fails on for-next, which is a super-merge of all the
topic branches. Sorry for the noise,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport
2026-11-20 21:45 ` Jiri Kosina
@ 2026-11-20 22:16 ` Dmitry Torokhov
0 siblings, 0 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2026-11-20 22:16 UTC (permalink / raw)
To: Jiri Kosina
Cc: Benjamin Tissoires, Gideon Heinz, Filipe Laíns,
Bastien Nocera, Hans de Goede, Edwin Velds, Stuart Hayhurst,
Andrey Smirnov, linux-input, linux-kernel, stable
On Fri, Nov 20, 2026 at 10:45:21PM +0100, Jiri Kosina wrote:
> On Fri, 20 Nov 2026, Dmitry Torokhov wrote:
>
> > >> Ah, yes, I un-exported it in my hidraw cleanup patch series that you
> > >> just applied.
> > >
> > >Hmm, but that cleanup is sitting in hid.git#for-7.5/hidraw, while this
> > >build breakage occured in for-7.4/upstream-fixes, which is based on Linus'
> > >tree and doesn't include that hidraw cleanup ...
> >
> > Doesn't next mix it all together?
>
> Right, the build fails on for-next, which is a super-merge of all the
> topic branches. Sorry for the noise,
So how do you want to handle this? Keep this series as is, and apply,
and drop either entire hidraw rework or just the offending patch and I
will resubmit it once Logitech rework settles in?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2026-11-20 22:16 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 8:40 [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 01/14] HID: logitech-hidpp: fix G920 force-feedback initialization timeout Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 02/14] HID: logitech-hidpp: use GFP_ATOMIC in hidpp_ff_queue_work() Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 03/14] HID: logitech-hidpp: drain G920 FF workqueue before closing transport Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 04/14] HID: logitech-hidpp: disable works before stopping transport Dmitry Torokhov
2026-11-20 13:51 ` Jiri Kosina
2026-11-20 18:08 ` Dmitry Torokhov
2026-11-20 18:12 ` Jiri Kosina
2026-11-20 21:07 ` Dmitry Torokhov
2026-11-20 21:45 ` Jiri Kosina
2026-11-20 22:16 ` Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 05/14] HID: logitech-hidpp: do not store ERR_PTR in battery->ps Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 06/14] HID: logitech-hidpp: avoid NULL subtraction in consumer key report fixup Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 07/14] HID: logitech-hidpp: fix off-by-one in G920 force-feedback slot tracking Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 08/14] HID: logitech-hidpp: do not retry timeouts and transport errors in hidpp_send_message_sync() Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 09/14] HID: logitech-hidpp: initialize response buffer before publishing send_receive_buf Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 10/14] HID: logitech-hidpp: fix HID++ 1.0 battery mileage event parsing Dmitry Torokhov
2026-11-20 8:40 ` [PATCH v3 11/14] HID: logitech-hidpp: handle negative errors in hidpp20_get_adc_measurement_1f20() Dmitry Torokhov
2026-11-20 8:41 ` [PATCH v3 12/14] HID: logitech-hidpp: mark device online on unified battery 0x1004 events Dmitry Torokhov
2026-11-20 8:41 ` [PATCH v3 13/14] HID: logitech-hidpp: fix K750 solar battery feature lookup and reconnect Dmitry Torokhov
2026-11-20 8:41 ` [PATCH v3 14/14] HID: logitech-hidpp: expose charge_type property for battery voltage feature Dmitry Torokhov
2026-11-20 12:14 ` [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®