Hello Jiri, Thanks for the quick reply. > Does the keyboard/mouse get properly discovered if you unplug and replug > the receiver? No. It is still not working after replug or reboot > What if you revert back to the 59626408 workaround (i.e. revert > a9dd22b730 and 8af6c0883)? It works after revert 8af6c08830b1ae114d1a8b548b1f8b056e068887. > so it's either rather timing sensitive, or device-specific. The problem is indeed timing sensitive. Yesterday, after I inserted some dbg_hid() for debuging, the problem just gone, very strange. I think for my case, I find the reason of the problem. My device do not report the expected REPORT_TYPE_NOTIF_DEVICE_PAIRED(0x41). (Not discarded by the hid-core as mentioned in 8af6c0883, the hardware itself has not sent the packet.) Instead, the device reports a REPORT_TYPE_NOTIF_CONNECTION_STATUS(0x42) event, with dj_report->report_params[CONNECTION_STATUS_PARAM_STATUS]=0, the first time I move the mouse. And then report the normal activities of the mouse. (details about the usb packets can be found in the attachment.) In the current code, function drivers/hid/hid-logitech-dj.c:logi_dj_raw_event (Line 629) will discard that notification event silently. switch (dj_report->report_type){ ... case REPORT_TYPE_NOTIF_CONNECTION_STATUS: if (dj_report->report_params[CONNECTION_STATUS_PARAM_STATUS] == STATUS_LINKLOSS) { /* In the case of the notification event, the STATUS is 0 (STATUS_LINKLOSS==1)*/ logi_dj_recv_forward_null_report(djrcv_dev, dj_report); } break; ... When revert the 8af6c08830b1ae114d1a8b548b1f8b056e068887 (Revert "HID: Fix logitech-dj: missing Unifying device issue") The mouse's normal report (report_type==2) will trigger the logi_dj_recv_forward_report() function and the function will enqueue that report and schedule the tasklet delayedwork_callback. The event then fall to the default case of the dj_report.report_type switch. Which will trigger the logi_dj_recv_query_paired_devices(djrcv_dev) to ask a new report. And the device will send back the expected REPORT_TYPE_NOTIF_DEVICE_PAIRED packet after this. The attachment logitech_not_work.pcapng.gz and logitech_work.pcapng.gz are the usb packets grabbed by wireshark. The logitech_not_work uses the v3.10 driver and the logitech_work uses v3.10 and revert the 8af6c08830b The strange one is the package 50. I think we expect a REPORT_TYPE_NOTIF_DEVICE_PAIRED(0x41) event (and the device report that event sometimes after I inserted some dbg_hid(), which may slow things down a little bit.) But I get this in my computer: (I am using intel i7 4770 CPU) 20:01:42:00:00:00:00:00:00:00:00:00:00:00:00 The third field is REPORT_TYPE_NOTIF_CONNECTION_STATUS (0x42 [66]). And after this, the mouse report the move events, and we do not receive any REPORT_TYPE_NOTIF_DEVICE_PAIRED event without another SET_REPORT request. The logitech_not_work_dmesg.txt and logitech_work_dmesg.txt are dmsgs with hid.debug set to 2 (The dmesg and the above captured packets are from different session, so there may be different) Besides, I change the dbg_hid() statement inside logi_dj_raw_event to print the type of the event(And I also move that statement after the switch statement to get the type) For the logitech_not_work_dmesg.txt(v3.10), there are a lot of events like this: Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:66 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: djrcv_dev->paired_dj_devices[dj_report->device_index] is NULL, index 1 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: djrcv_dev->paired_dj_devices[dj_report->device_index] is NULL, index 1 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: djrcv_dev->paired_dj_devices[dj_report->device_index] is NULL, index 1 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 ... For logitech_work_dmesg.txt(with the revert of 8af6c08830b): Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0220 wIndex=0x0002 wLength=15 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:66 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: djrcv_dev->paired_dj_devices[dj_report->device_index] is NULL, index 1 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: delayedwork_callback Jul 08 14:37:22 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0220 wIndex=0x0002 wLength=15 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:65 The type:2 report trigger the Set_Report packet and the new status is reported. Please pay special attention to the time of the type 66(0x42) packet, it happened 15 seconds after the last set_report. (It is trigger when I move the mouse) The simple_unifying_receive_path is a fix working on my computer. But my knowledge of the HID subsystem is very limited. Thus, this patch is only for demonstration purpose. Best, Wujun Zhou
Jul 08 14:21:04 g kernel: usb 3-10.3: new full-speed USB device number 13 using xhci_hcd Jul 08 14:21:04 g kernel: usb 3-10.3: ep0 maxpacket = 8 Jul 08 14:21:04 g kernel: usb 3-10.3: Successful evaluate context command Jul 08 14:21:04 g kernel: usb 3-10.3: skipped 1 descriptor after interface Jul 08 14:21:04 g kernel: usb 3-10.3: skipped 1 descriptor after interface Jul 08 14:21:04 g kernel: usb 3-10.3: skipped 1 descriptor after interface Jul 08 14:21:04 g kernel: usb 3-10.3: default language 0x0409 Jul 08 14:21:04 g kernel: usb 3-10.3: udev 13, busnum 3, minor = 268 Jul 08 14:21:04 g kernel: usb 3-10.3: New USB device found, idVendor=046d, idProduct=c52b Jul 08 14:21:04 g kernel: usb 3-10.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Jul 08 14:21:04 g kernel: usb 3-10.3: Product: USB Receiver Jul 08 14:21:04 g kernel: usb 3-10.3: Manufacturer: Logitech Jul 08 14:21:04 g kernel: usb 3-10.3: usb_probe_device Jul 08 14:21:04 g kernel: usb 3-10.3: configuration #1 chosen from 1 choice Jul 08 14:21:04 g kernel: usb 3-10.3: Successful Endpoint Configure command Jul 08 14:21:04 g kernel: usb 3-10.3: adding 3-10.3:1.0 (config #1, interface 0) Jul 08 14:21:04 g kernel: usbhid 3-10.3:1.0: usb_probe_interface Jul 08 14:21:04 g kernel: usbhid 3-10.3:1.0: usb_probe_interface - got id Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0 Jul 08 14:21:04 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 0 Jul 08 14:21:04 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 0 Jul 08 14:21:04 g kernel: usb 3-10.3: adding 3-10.3:1.1 (config #1, interface 1) Jul 08 14:21:04 g kernel: usbhid 3-10.3:1.1: usb_probe_interface Jul 08 14:21:04 g kernel: usbhid 3-10.3:1.1: usb_probe_interface - got id Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1 Jul 08 14:21:04 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 1 Jul 08 14:21:04 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 1 Jul 08 14:21:04 g kernel: usb 3-10.3: adding 3-10.3:1.2 (config #1, interface 2) Jul 08 14:21:04 g kernel: usbhid 3-10.3:1.2: usb_probe_interface Jul 08 14:21:04 g kernel: usbhid 3-10.3:1.2: usb_probe_interface - got id Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 2 Jul 08 14:21:04 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 2 Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0110 wIndex=0x0002 wLength=7 Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0111 wIndex=0x0002 wLength=20 Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0120 wIndex=0x0002 wLength=15 Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0121 wIndex=0x0002 wLength=32 Jul 08 14:21:04 g kernel: usbhid 3-10.3:1.2: looking for a minor, starting at 96 Jul 08 14:21:04 g kernel: logitech-djreceiver 0003:046D:C52B.0029: hiddev0,hidraw3: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14 Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0220 wIndex=0x0002 wLength=15 Jul 08 14:21:04 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0220 wIndex=0x0002 wLength=15 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:66 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: djrcv_dev->paired_dj_devices[dj_report->device_index] is NULL, index 1 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: djrcv_dev->paired_dj_devices[dj_report->device_index] is NULL, index 1 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: djrcv_dev->paired_dj_devices[dj_report->device_index] is NULL, index 1 Jul 08 14:21:05 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2
Attachment:
logitech_not_work.pcapng.gz
Description: GNU Zip compressed data
Attachment:
logitech_work.pcapng.gz
Description: GNU Zip compressed data
Jul 08 14:37:07 g kernel: hub 3-10:1.0: state 7 ports 4 chg 0000 evt 0010 Jul 08 14:37:07 g kernel: hub 3-10:1.0: port 4, status 0101, change 0001, 12 Mb/s Jul 08 14:37:07 g kernel: hub 3-10:1.0: debounce: port 4: total 100ms stable 100ms status 0x101 Jul 08 14:37:07 g kernel: usb 3-10.4: new full-speed USB device number 15 using xhci_hcd Jul 08 14:37:07 g kernel: usb 3-10.4: ep0 maxpacket = 8 Jul 08 14:37:07 g kernel: usb 3-10.4: Successful evaluate context command Jul 08 14:37:07 g kernel: usb 3-10.4: skipped 1 descriptor after interface Jul 08 14:37:07 g kernel: usb 3-10.4: skipped 1 descriptor after interface Jul 08 14:37:07 g kernel: usb 3-10.4: skipped 1 descriptor after interface Jul 08 14:37:07 g kernel: usb 3-10.4: default language 0x0409 Jul 08 14:37:07 g kernel: usb 3-10.4: udev 15, busnum 3, minor = 270 Jul 08 14:37:07 g kernel: usb 3-10.4: New USB device found, idVendor=046d, idProduct=c52b Jul 08 14:37:07 g kernel: usb 3-10.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Jul 08 14:37:07 g kernel: usb 3-10.4: Product: USB Receiver Jul 08 14:37:07 g kernel: usb 3-10.4: Manufacturer: Logitech Jul 08 14:37:07 g kernel: usb 3-10.4: usb_probe_device Jul 08 14:37:07 g kernel: usb 3-10.4: configuration #1 chosen from 1 choice Jul 08 14:37:07 g kernel: usb 3-10.4: Successful Endpoint Configure command Jul 08 14:37:07 g kernel: usb 3-10.4: adding 3-10.4:1.0 (config #1, interface 0) Jul 08 14:37:07 g kernel: usbhid 3-10.4:1.0: usb_probe_interface Jul 08 14:37:07 g kernel: usbhid 3-10.4:1.0: usb_probe_interface - got id Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0 Jul 08 14:37:07 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 0 Jul 08 14:37:07 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 0 Jul 08 14:37:07 g kernel: usb 3-10.4: adding 3-10.4:1.1 (config #1, interface 1) Jul 08 14:37:07 g kernel: usbhid 3-10.4:1.1: usb_probe_interface Jul 08 14:37:07 g kernel: usbhid 3-10.4:1.1: usb_probe_interface - got id Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1 Jul 08 14:37:07 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 1 Jul 08 14:37:07 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 1 Jul 08 14:37:07 g kernel: usb 3-10.4: adding 3-10.4:1.2 (config #1, interface 2) Jul 08 14:37:07 g kernel: usbhid 3-10.4:1.2: usb_probe_interface Jul 08 14:37:07 g kernel: usbhid 3-10.4:1.2: usb_probe_interface - got id Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 2 Jul 08 14:37:07 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 2 Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0110 wIndex=0x0002 wLength=7 Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0111 wIndex=0x0002 wLength=20 Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0120 wIndex=0x0002 wLength=15 Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0121 wIndex=0x0002 wLength=32 Jul 08 14:37:07 g kernel: usbhid 3-10.4:1.2: looking for a minor, starting at 96 Jul 08 14:37:07 g kernel: logitech-djreceiver 0003:046D:C52B.0031: hiddev0,hidraw3: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14.0-10.4/input2 Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0220 wIndex=0x0002 wLength=15 Jul 08 14:37:07 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0220 wIndex=0x0002 wLength=15 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:66 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: djrcv_dev->paired_dj_devices[dj_report->device_index] is NULL, index 1 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: delayedwork_callback Jul 08 14:37:22 g kernel: drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0220 wIndex=0x0002 wLength=15 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:65 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: delayedwork_callback Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse: sending a mouse descriptor, reports_supported: 4 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_start Jul 08 14:37:22 g kernel: input: Logitech Unifying Device. Wireless PID:101b as /devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10.4/3-10.4:1.2/0003:046D:C52B.0031/input/input22 Jul 08 14:37:22 g kernel: logitech-djdevice 0003:046D:C52B.0032: input,hidraw4: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:101b] on usb-0000:00:14.0-10.4:1 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_open:usb-0000:00:14.0-10.4:1 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:65 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: delayedwork_callback Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse: sending a kbd descriptor, reports_supported: 401a Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse: sending a multimedia report descriptor: 401a Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse: sending a power keys report descriptor: 401a Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse: need to send kbd leds report descriptor: 401a Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_start Jul 08 14:37:22 g kernel: input: Logitech Unifying Device. Wireless PID:4003 as /devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10.4/3-10.4:1.2/0003:046D:C52B.0031/input/input23 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_ll_open:usb-0000:00:14.0-10.4:2 Jul 08 14:37:22 g kernel: logitech-djdevice 0003:046D:C52B.0033: input,hidraw5: USB HID v1.11 Keyboard [Logitech Unifying Device. Wireless PID:4003] on usb-0000:00:14.0-10.4:2 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:65 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: delayedwork_callback Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_recv_add_djhid_device: device list is empty Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:7,type:143 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:7,type:143 Jul 08 14:37:22 g kernel: drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15,type:2
Attachment:
simple_unifying_receiver_fix.patch
Description: Binary data