Skip to content

Commit 3e6b0bb

Browse files
jwrdegoedeBenjamin Tissoires
authored andcommitted
HID: logitech-hidpp: Stop IO before calling hid_connect()
hid_connect() will call hid_pidff_init() which does hid_device_io_start() leading to an "io already started" warning. To fix this call hid_device_io_stop() before calling hid_connect(), stopping IO means that connect events may be lost while hid_connect() runs, re-enable IO and move the hidpp_connect_event() work queuing after the hid_connect(). Note re-enabling IO is also necessary for the g920_get_config() call later during hidpp_probe(). Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 9ce363a commit 3e6b0bb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4461,19 +4461,22 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
44614461
else
44624462
hidpp_non_unifying_init(hidpp);
44634463

4464-
schedule_work(&hidpp->work);
4465-
flush_work(&hidpp->work);
4466-
44674464
if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT)
44684465
connect_mask &= ~HID_CONNECT_HIDINPUT;
44694466

44704467
/* Now export the actual inputs and hidraw nodes to the world */
4468+
hid_device_io_stop(hdev);
44714469
ret = hid_connect(hdev, connect_mask);
44724470
if (ret) {
44734471
hid_err(hdev, "%s:hid_connect returned error %d\n", __func__, ret);
44744472
goto hid_hw_init_fail;
44754473
}
44764474

4475+
/* Check for connected devices now that incoming packets will not be disabled again */
4476+
hid_device_io_start(hdev);
4477+
schedule_work(&hidpp->work);
4478+
flush_work(&hidpp->work);
4479+
44774480
if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) {
44784481
struct hidpp_ff_private_data data;
44794482

0 commit comments

Comments
 (0)