Skip to contentSkip to conversation

hid_logitech_dj: Wireless mouse does not work in xorg or gpm

bug? In review Jonathan Nieder 4 participants 22 messages May 3, 2012 – May 11, 2012 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20120503052000.GC15205@burratino

A message that is not in the archive (sent off-list or not yet received): 20120503052420.GD15205@burratino

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi Nestor et al,

Huge Osvaldo Barrera writes, regarding a Logitech USB Receiver (id 046d:c52b) attached to a PowerBook6,5 [1]:

Quoted 5 lines

My mouse does not seem to work, either with Xorg, or gpm. It's a Logitech Performance MX.

It works fine on -stable after a clean installation of the 6.0.4 netinst ISO, but does not work either on testing, or sid.

(For context: stable = 2.6.32.y, testing and sid = 3.2.y.)

Quoted 2 lines

It did not work a week ago, and does not work today either (so this has been broken on both sid and testing for a week now).

[...]

Quoted 6 lines

When I installed stable and upgraded to testing, the device node /dev/input/mouse1 did exist (mouse0 is the trackpad), but "cat /dev/input/mouse1" showed no output when moving the mouse (mouse0 did when moving the trackpad). When doing a clean install of testing, the device node mouse1 is never created.

Quoted 7 lines

After looking at the dmesg and lsusb, the device itself seems to be detected, however, it does not work.

The mouse works fine on another linux-based computer (ArchLinux, with kernel 3.3.2), so the mouse is not the issue. I additionally have another identical mouse, which exhibits the same behaviour (on both computers).

He later clarified that the machine with ArchLinux was an amd64 machine. So my first guess is that this might be an endianness issue in the driver (hid_logitech_dj, which was a new driver introduced during the 3.2 merge window).

Kernel log snippet, module list, and some other info are at [1]. Known problem? Any hints for tracking this down?

Thanks,
Jonathan

[1] http://bugs.debian.org/671292

A message that is not in the archive (sent off-list or not yet received): CAE7qMrqtmu+bYYYp43s7Ek=UxfUG8HzwQSQBsdCGcVCBzCMQQw@mail.gmail.com

#5 lore raw
Quoted 3 lines · Nestor Lopez Casado

Thanks for reporting this issue. This is not a known problem.

It does point to an endianess issue.

Good to know. Thanks for a quick reply.

Quoted 3 lines

As I do not have readily available PowerPC HW and we have some urgent things to work on right now: Would it be possible if you help us by doing the same tests, but enabling the debug log on hid ?

Hugo: please attach full output from "dmesg" after running

modprobe -r hid-logitech-dj
modprobe -r usbhid
echo 1 >/sys/module/hid/parameters/debug
modprobe usbhid
modprobe hid-logitech-dj

An alternative method would be to boot with "hid.hid_debug=1 log_buf_len=2097152" and run dmesg.

Hope that helps,
Jonathan

#6 lore raw
Quoted 2 lines · Jonathan Nieder

An alternative method would be to boot with "hid.hid_debug=1 log_buf_len=2097152" and run dmesg.

Apparently I can't spell. An alternative method would be to run with "hid.debug=1 log_buf_len=..." or to do

modprobe -r hid-logitech-dj
modprobe -r usbhid
modprobe -r hid
modprobe hid debug=1
modprobe hid-logitech-dj
dmesg

Sorry for the confusion.
Jonathan

#7 lore raw

Bug#671292: [bug?] [powerpc] hid_logitech_dj: Wireless mouse does not work in xorg or gpm

Hi,

Quoted 8 lines · Jonathan Nieder
Quoted 2 lines · Jonathan Nieder

An alternative method would be to boot with "hid.hid_debug=1 log_buf_len=2097152" and run dmesg.

Apparently I can't spell. An alternative method would be to run with "hid.debug=1 log_buf_len=..." or to do

Quoted 8 lines

modprobe -r hid-logitech-dj
modprobe -r usbhid
modprobe -r hid
modprobe hid debug=1
modprobe hid-logitech-dj
dmesg

Sorry for the confusion.

No problem

Quoted 1 line

Jonathan

Here goes, I'm pretty sure a few of the first lines aren't relevant, but I prefer to send a couple too many instead of a couple to few :)

[ 1244.617478] usb 4-1: USB disconnect, device number 2
[77892.290041] usb 4-1: new full-speed USB device number 3 using ohci_hcd
[77892.512057] usb 4-1: New USB device found, idVendor=046d, idProduct=c52b
[77892.512817] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[77892.513584] usb 4-1: Product: USB Receiver
[77892.514280] usb 4-1: Manufacturer: Logitech
[77892.540356] logitech-djreceiver 0003:046D:C52B.000B: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0001:10:1b.1-1/input2
[77892.550769] logitech-djdevice 0003:046D:C52B.000C: hidraw1: USB HID v1.11 Device [Logitech Unifying Device. Wireless PID:101a] on usb-0001:10:1b.1-1:1
[77912.356716] usbcore: deregistering interface driver usbhid
[77927.421876] usbcore: registered new interface driver usbhid
[77927.422859] usbhid: USB HID core driver
[77927.461256] logitech-djreceiver 0003:046D:C52B.0003: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0001:10:1b.1-1/input2
[77927.473593] logitech-djdevice 0003:046D:C52B.0004: hidraw1: USB HID v1.11 Device [Logitech Unifying Device. Wireless PID:101a] on usb-0001:10:1b.1-1:1
[77985.718533] usbcore: deregistering interface driver usbhid
[77985.843593] hid: hid_debug is now used solely for parser and driver debugging.
[77985.843602] debugfs is now used for inspecting the device (report descriptor, reports)
[77985.890194] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0
[77985.891586] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1
[77985.893142] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 2
[77985.895398] usbcore: registered new interface driver usbhid
[77985.896491] usbhid: USB HID core driver
[77985.914131] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: Logitech-DJ:logi_dj_init
[77985.914189] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 0
[77985.914198] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 0
[77985.914224] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 1
[77985.914233] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 1
[77985.914250] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 2
[77985.919851] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x1001 wIndex=0x0200 wLength=1792
[77985.921771] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x1101 wIndex=0x0200 wLength=5120
[77985.922775] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x2001 wIndex=0x0200 wLength=3840
[77985.923763] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x2101 wIndex=0x0200 wLength=8192
[77985.927818] logitech-djreceiver 0003:046D:C52B.0003: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0001:10:1b.1-1/input2
[77985.937799] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[77985.939796] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[77985.939809] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_recv_queue_notification: did not schedule the work item, was already queued
[77985.942193] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: delayedwork_callback
[77985.942406] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse
[77985.942417] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_ll_start
[77985.943226] logitech-djdevice 0003:046D:C52B.0004: hidraw1: USB HID v1.11 Device [Logitech Unifying Device. Wireless PID:101a] on usb-0001:10:1b.1-1:1
[77985.945640] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: delayedwork_callback
[77985.945651] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_recv_add_djhid_device: device list is empty
#8 lore raw
Quoted 2 lines · Hugo Osvaldo Barrera

Here goes, I'm pretty sure a few of the first lines aren't relevant, but I prefer to send a couple too many instead of a couple to few :)

Thanks! That was fast. I'd also be interested in the corresponding output from an Intel architecture machine with the same kernel version for comparison.

I'm hoping some obvious difference will jump out --- otherwise I or some other reader will have to look at the actual code. ;-)

Hope that helps,
Jonathan

#9 lore raw
Quoted 9 lines · Jonathan Nieder
Quoted 2 lines · Hugo Osvaldo Barrera

Here goes, I'm pretty sure a few of the first lines aren't relevant, but I prefer to send a couple too many instead of a couple to few :)

Thanks! That was fast. I'd also be interested in the corresponding output from an Intel architecture machine with the same kernel version for comparison.

Quoted 5 lines

I'm hoping some obvious difference will jump out --- otherwise I or some other reader will have to look at the actual code. ;-)

Hope that helps,
Jonathan

Here you go - *I* certainly can't make anything out of it, but hope it helps :)

$ uname -a
Linux hyperion 3.3.2-1-ARCH #1 SMP PREEMPT Sat Apr 14 09:48:37 CEST 2012 x86_64 AMD Phenom(tm) II X4 945 Processor AuthenticAMD GNU/Linux

dmesg:

<The following ONE line repeated itself 272 times. I've snipped it for readability>

[335294.173474] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335294.173485] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335294.277432] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335294.277442] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 94 times.  I've snipped it for readability>
[335295.841399] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335295.841407] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335295.945386] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335295.945395] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 110 times.  I've snipped it for readability>
[335307.282816] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15

<snipped some nvidia related stuff>

<The following ONE line repeated itself 71 times. I've snipped it for readability>

[335313.294547] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335313.294559] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589827
[335313.446544] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335313.446558] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589827
<The following ONE line repeated itself 65 times.  I've snipped it for readability>
[335317.788350] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335317.788360] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 22 times.  I've snipped it for readability>
[335318.044338] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335318.044350] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 52 times.  I've snipped it for readability>
[335324.738080] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335324.738089] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589827
<The following ONE line repeated itself 32 times.  I've snipped it for readability>
[335325.068018] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335325.068030] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589827
<The following ONE line repeated itself 30 times.  I've snipped it for readability>
[335325.544000] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335325.544012] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 60 times.  I've snipped it for readability>
[335326.485953] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335326.485964] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 418 times.  I've snipped it for readability>
[335344.725114] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335344.725123] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335344.821117] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335344.821127] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 60 times.  I've snipped it for readability>
[335346.279100] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335346.279110] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335346.351039] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335346.351050] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 138 times.  I've snipped it for readability>
[335348.654984] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335348.654992] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335348.710989] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335348.710998] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335348.774979] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335348.774990] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335348.854978] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335348.854988] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335348.910977] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335348.910986] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335348.992970] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335348.992979] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
<The following ONE line repeated itself 19 times.  I've snipped it for readability>
[335350.006867] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335350.006876] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589827
[335350.152884] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335350.152896] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589827
<The following ONE line repeated itself 12 times.  I've snipped it for readability>
[335356.852559] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335356.852571] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589827
[335356.998614] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335356.998626] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589827
<The following ONE line repeated itself 105 times.  I've snipped it for readability>
[335362.902289] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335362.902298] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335362.950333] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335362.950340] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335363.006379] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335363.006387] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335363.102399] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335363.102407] drivers/hid/hid-logitech-dj.c: logi_dj_ll_input_event: usb-0000:00:12.1-3:1, type:4 | code:4 | value:589825
[335367.086712] drivers/hid/hid-logitech-dj.c: Logitech-DJ:logi_dj_exit
[335367.094861] drivers/hid/hid-logitech-dj.c: logi_dj_ll_close:usb-0000:00:12.1-3:1
[335367.095400] drivers/hid/hid-logitech-dj.c: logi_dj_ll_stop
[335367.095422] drivers/hid/hid-logitech-dj.c: logi_dj_remove
[335367.097236] usbcore: deregistering interface driver usbhid
[335367.127468] hid: hid_debug is now used solely for parser and driver debugging.
[335367.127469] debugfs is now used for inspecting the device (report descriptor, reports)
[335367.129430] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0
[335367.129506] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1
[335367.129619] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0
[335367.129704] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1
[335367.129752] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 2
[335367.131579] usbcore: registered new interface driver usbhid
[335367.131581] usbhid: USB HID core driver
[335367.132675] drivers/hid/hid-logitech-dj.c: Logitech-DJ:logi_dj_init
[335367.132685] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 0
[335367.132687] drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 0
[335367.132693] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 1
[335367.132695] drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 1
[335367.132699] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 2
[335367.135370] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0110 wIndex=0x0002 wLength=7
[335367.137143] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0111 wIndex=0x0002 wLength=20
[335367.138149] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0120 wIndex=0x0002 wLength=15
[335367.139224] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0121 wIndex=0x0002 wLength=32
[335367.139557] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0200 wIndex=0x0000 wLength=1
[335367.139653] input: Microsoft Microsoft® Digital Media Keyboard 3000 as /devices/pci0000:00/0000:00:13.0/usb5/5-2/5-2:1.0/input/input38
[335367.139781] microsoft 0003:045E:0730.0001: input,hidraw0: USB HID v1.11 Keyboard [Microsoft Microsoft® Digital Media Keyboard 3000] on usb-0000:00:13.0-2/input0
[335367.140378] logitech-djreceiver 0003:046D:C52B.0005: hiddev0,hidraw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:12.1-3/input2
[335367.141292] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0200 wIndex=0x0000 wLength=1
[335367.143343] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Set_Report wValue=0x0200 wIndex=0x0000 wLength=1
[335367.146085] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335367.146098] drivers/hid/hid-logitech-dj.c: delayedwork_callback
[335367.146146] drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse
[335367.146148] drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse: sending a mouse descriptor, reports_supported: 4
[335367.146247] drivers/hid/hid-logitech-dj.c: logi_dj_ll_start
[335367.146333] input: Logitech Unifying Device. Wireless PID:101a as /devices/pci0000:00/0000:00:12.1/usb4/4-3/4-3:1.2/0003:046D:C52B.0005/input/input39
[335367.146544] logitech-djdevice 0003:046D:C52B.0006: input,hidraw2: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:101a] on usb-0000:00:12.1-3:1
[335367.148082] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[335367.148094] drivers/hid/hid-logitech-dj.c: delayedwork_callback
[335367.148096] drivers/hid/hid-logitech-dj.c: logi_dj_recv_add_djhid_device: device list is empty
[335367.155470] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0101 wIndex=0x0001 wLength=8
[335367.157289] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0103 wIndex=0x0001 wLength=2
[335367.158479] input: Microsoft Microsoft® Digital Media Keyboard 3000 as /devices/pci0000:00/0000:00:13.0/usb5/5-2/5-2:1.1/input/input40
[335367.158659] microsoft 0003:045E:0730.0002: input,hidraw3: USB HID v1.11 Device [Microsoft Microsoft® Digital Media Keyboard 3000] on usb-0000:00:13.0-2/input1
[335367.176697] drivers/hid/hid-logitech-dj.c: logi_dj_ll_open:usb-0000:00:12.1-3:1

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw
Quoted 16 lines · Hugo Osvaldo Barrera
Quoted 9 lines · Jonathan Nieder
Quoted 2 lines · Hugo Osvaldo Barrera

Here goes, I'm pretty sure a few of the first lines aren't relevant, but I prefer to send a couple too many instead of a couple to few :)

Thanks! That was fast. I'd also be interested in the corresponding output from an Intel architecture machine with the same kernel version for comparison.

Quoted 5 lines

I'm hoping some obvious difference will jump out --- otherwise I or some other reader will have to look at the actual code. ;-)

Hope that helps,
Jonathan

Quoted 7 lines

Here you go - *I* certainly can't make anything out of it, but hope it helps :)

$ uname -a
Linux hyperion 3.3.2-1-ARCH #1 SMP PREEMPT Sat Apr 14 09:48:37 CEST 2012 x86_64 AMD Phenom(tm) II X4 945 Processor AuthenticAMD GNU/Linux

dmesg:

<snip>

Oh, it slipped my mind and I used the other (identical) mouse for this, does that matter? They're the exact same model.

Signature · 1 line
Hugo Osvaldo Barrera
#11 lore raw
Quoted 2 lines · Hugo Osvaldo Barrera

Oh, it slipped my mind and I used the other (identical) mouse for this, does that matter? They're the exact same model.

Probably doesn't matter, but thanks for mentioning it.

Sincerely,
Jonathan

#12 lore raw

Hi guys,

Thanks for those logs, very helpful.

Would you be able to test the following patch on both systems and let us know about the result?

Cheers,
Nestor

drivers/hid/hid-logitech-dj.c +0 -0
index 38b12e4..763e4d9 100644
@@ -215,6 +215,7 @@ static void logi_dj_recv_add_djhid_device(struct

dj_receiver_dev *djrcv_dev,
struct usb_device *usbdev = interface_to_usbdev(intf); struct hid_device *dj_hiddev;
struct dj_device *dj_dev;
+ u32 reports_supported;

/* Device index goes from 1 to 6, we need 3 bytes to store the
* semicolon, the index, and a null terminator
@@ -264,9 +265,11 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
__func__);
goto dj_device_allocate_fail;
}
+ memcpy(&reports_supported,
+ &dj_report->report_params[DEVICE_PAIRED_RF_REPORT_TYPE],
+ sizeof(reports_supported));

- dj_dev->reports_supported = le32_to_cpu(
- dj_report->report_params[DEVICE_PAIRED_RF_REPORT_TYPE]);
+ dj_dev->reports_supported = le32_to_cpu(reports_supported);
dj_dev->hdev = dj_hiddev; dj_dev->dj_receiver_dev = djrcv_dev; dj_dev->device_index = dj_report->device_index;

Quoted 10 lines · Jonathan Nieder
Quoted 2 lines · Hugo Osvaldo Barrera

Oh, it slipped my mind and I used the other (identical) mouse for this, does that matter?  They're the exact same model.

Probably doesn't matter, but thanks for mentioning it.

Sincerely,
Jonathan

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#13 lore raw
Quoted 2 lines · Nestor Lopez Casado

Would you be able to test the following patch on both systems and let us know about the result?

Instructions for Hugo:

	# prerequisites
	apt-get install git build-essential
	# get the kernel history, if you don't already have it
	git clone \
	  git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
	# latest mainline kernel
	cd linux
	git fetch origin
	git checkout origin/master
	# configure
	cp /boot/config-$(uname -r) .config; # current configuration
	scripts/config --disable DEBUG_INFO; # smaller build
	make localmodconfig; # minimize configuration
	# apply patch
	git apply --index /path/to/patch
	# build
	make deb-pkg; # optionally with -j<num> for parallel build
	# test
	dpkg -i ../<name of package>; # as root
	reboot
	# to unapply patch:
	cd linux
	git reset --hard origin/master
	# when you want to build again:
	make deb-pkg; # maybe with -j4
	dpkg -i ../<name of package>; # as root
	reboot

I would also be interested in a capture of the pairing event, if possible:

(remove mouse battery or bring mouse out of range) mount -t debugfs debugfs /sys/kernel/debug
ls /sys/kernel/debug/hid/
modprobe -r hid_logitech_dj
modprobe hid_logitech_dj
cat /sys/kernel/debug/hid/<device name>/events >events.captured (insert mouse battery or bring mouse within range) ^C

Jonathan

#14 lore raw
In reply to a message not in the archive

Hi,

I apologize for not replying to the last e-mail and replying to an older one instead, I seem to have lost the last couple. :(

Before I begin, let me say I downloaded the kernel sources only a few hours after your previous message, but the patch did not apply (I'm not sure why; I got a "corrupt patch" error). I applied the changes manually.

Here's the dmesg I got:

[69237.004750] usbcore: deregistering interface driver usbhid
[69243.219600] hid: hid_debug is now used solely for parser and driver debugging.
[69243.219608] debugfs is now used for inspecting the device (report descriptor, reports)
[69350.013383] hid: hid_debug is now used solely for parser and driver debugging.
[69350.013390] debugfs is now used for inspecting the device (report descriptor, reports)
[69358.971680] usbcore: registered new interface driver usbhid
[69358.971692] usbhid: USB HID core driver
<Mouse receiver was plugged in at this point.  Mouse was off.>
[69358.973309] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: Logitech-DJ:logi_dj_init
[69381.670037] usb 4-1: new full-speed USB device number 5 using ohci_hcd
[69381.892043] usb 4-1: New USB device found, idVendor=046d, idProduct=c52b
[69381.892054] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[69381.892060] usb 4-1: Product: USB Receiver
[69381.892065] usb 4-1: Manufacturer: Logitech
[69381.898155] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0
[69381.898311] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 0
[69381.898321] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 0
[69381.898440] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1
[69381.898537] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 1
[69381.898546] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 1
[69381.898651] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 2
[69381.898750] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 2
[69381.904988] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x1001 wIndex=0x0200 wLength=1792
[69381.907044] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x1101 wIndex=0x0200 wLength=5120
[69381.908029] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x2001 wIndex=0x0200 wLength=3840
[69381.909028] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x2101 wIndex=0x0200 wLength=8192
[69381.911438] logitech-djreceiver 0003:046D:C52B.0003: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0001:10:1b.1-1/input2
[69381.918070] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69381.918124] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: delayedwork_callback
[69381.918135] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_recv_add_djhid_device: device list is empty
[69381.920069] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69381.920119] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: delayedwork_callback
[69381.920297] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse
[69381.920308] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_ll_start
<Mouse was turned on at this point.>
[69381.920430] logitech-djdevice 0003:046D:C52B.0004: hidraw1: USB HID v1.11 Device [Logitech Unifying Device. Wireless PID:101a] on usb-0001:10:1b.1-1:1
[69395.230032] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.782013] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.782030] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.782039] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error
[69395.806001] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.806016] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.806025] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error
[69395.813994] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.814009] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.814017] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error
[69395.821990] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.822004] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.822012] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error
[69395.829989] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.830003] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.830012] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error
[69395.837988] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.838002] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.838011] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error
[69395.845989] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.846003] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.846011] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error
[69395.853990] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.854004] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.854013] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error
[69395.861992] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69395.862006] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-core.c: undefined report_id 0 received
[69395.862014] /build/buildd-linux-2.6_3.3.4-1~experimental.1-powerpc-atUZTv/linux-2.6-3.3.4/debian/build/source_powerpc_none/drivers/hid/hid-logitech-dj.c: hid_input_report error

Here's the capture of the pairing event.
I found four devices in /sys/kernel/debug/hid/, so I tried each one until I found one that produced output upon pairing the mouse.

# mount -t debugfs debugfs /sys/kernel/debug
# ls /sys/kernel/debug/hid/
0003:046D:C52B.0001  0003:046D:C52B.0002  0003:046D:C52B.0003  0003:046D:C52B.0004
# modprobe -r hid_logitech_dj
# modprobe hid_logitech_dj
# cat /sys/kernel/debug/hid/0003\:046D\:C52B.0003/events > events.captured03

I tried all four, because I wasn't sure which one I should cat (/sys/kernel/debug/hid/0003\:046D\:C52B.000{1,2,3,4}/events). The devices ending in 1,2 and 4 didn't show any output anything.
Reading from 0003:046D:C52B.0003 resulted in the following

<Mouse turned on at this point>
report (size 15) (numbered) = 20 01 42 00 00 00 00 00 00 00 00 00 00 00 00 <Mouse turned off at this point>
report (size 15) (numbered) = 20 01 42 01 00 00 00 00 00 00 00 00 00 00 00 <EOF>

The devices ending in 0003 and 0004 both showed plenty of output when moving the mouse around.

Just in case there any doubt; this was all on the powerpc machine. Do you need me to rebuild the kernel with that patch and retry on amd64 as well?

Thanks,

Hugo

#15 lore raw
Quoted 1 line · Hugo Osvaldo Barrera

Here's the dmesg I got:

Thanks.

[...]

Quoted 3 lines
[69358.971692] usbhid: USB HID core driver
<Mouse receiver was plugged in at this point.  Mouse was off.>
[69358.973309] [...]/drivers/hid/hid-logitech-dj.c: Logitech-DJ:logi_dj_init

[...]

Quoted 10 lines
[69381.911438] logitech-djreceiver 0003:046D:C52B.0003: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0001:10:1b.1-1/input2
[69381.918070] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69381.918124] [...]/drivers/hid/hid-logitech-dj.c: delayedwork_callback
[69381.918135] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_recv_add_djhid_device: device list is empty
[69381.920069] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69381.920119] [...]/drivers/hid/hid-logitech-dj.c: delayedwork_callback
[69381.920297] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse
[69381.920308] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_ll_start
<Mouse was turned on at this point.>
[69381.920430] logitech-djdevice 0003:046D:C52B.0004: hidraw1: USB HID v1.11 Device [Logitech Unifying Device. Wireless PID:101a] on usb-0001:10:1b.1-1:1

Still no "logi_dj_ll_parse: sending a mouse descriptor, reports_supported: 4" so it looks like the patch didn't have the intended effect. Alas.

The pairing (...add_djhid_device) happens during initialization, before the mouse is turned on...

Quoted 1 line

Here's the capture of the pairing event.

[...]

Quoted 7 lines

Reading from 0003:046D:C52B.0003 resulted in the following

<Mouse turned on at this point>
report (size 15) (numbered) = 20 01 42 00 00 00 00 00 00 00 00 00 00 00 00 <Mouse turned off at this point>
report (size 15) (numbered) = 20 01 42 01 00 00 00 00 00 00 00 00 00 00 00 <EOF>

... so the events captured do not include pairing events (0x41). What we see here are connection status events (0x42). Sorry about that.

Here's a new patch that prints more information to dmesg. After applying the patch, you can use the patched driver by running

make drivers/hid/hid-logitech-dj.ko
modprobe -r hid-logitech-dj
insmod drivers/hid/hid-logitech-dj.ko
---
Thanks again,
Jonathan

 drivers/hid/hid-logitech-dj.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/hid/hid-logitech-dj.c +12 -2
index e1c38bba4375..33a70cfbec77 100644
@@ -23,6 +23,7 @@
 
 
 #include <linux/device.h>
+#include <asm/unaligned.h>
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/usb.h>
@@ -273,8 +274,8 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
 		goto dj_device_allocate_fail;
 	}
 
-	dj_dev->reports_supported = le32_to_cpu(
-		dj_report->report_params[DEVICE_PAIRED_RF_REPORT_TYPE]);
+	dj_dev->reports_supported = get_unaligned_le32(
+		dj_report->report_params + DEVICE_PAIRED_RF_REPORT_TYPE);
 	dj_dev->hdev = dj_hiddev;
 	dj_dev->dj_receiver_dev = djrcv_dev;
 	dj_dev->device_index = dj_report->device_index;
@@ -618,9 +619,18 @@ static int logi_dj_raw_event(struct hid_device *hdev,
 	struct dj_report *dj_report = (struct dj_report *) data;
 	unsigned long flags;
 	bool report_processed = false;
+	char buf[32 * 3 + 1];
+	int i;
 
 	dbg_hid("%s, size:%d\n", __func__, size);
 
+	if (0 < size && size <= 32) {
+		for (i = 0; i < size; i++)
+			snprintf(buf + 3*i, sizeof(buf) - 3*i,
+					" %02x", data[i]);
+		dbg_hid("%s: report = %s\n", __func__, buf);
+	}
+
 	/* Here we receive all data coming from iface 2, there are 4 cases:
 	 *
 	 * 1) Data should continue its normal processing i.e. data does not
Signature · 1 line
1.7.10.1
#16 lore raw

Hi Jonathan,

Quoted 22 lines · Jonathan Nieder
Quoted 1 line · Hugo Osvaldo Barrera

Here's the dmesg I got:

Thanks.

[...]

Quoted 3 lines
[69358.971692] usbhid: USB HID core driver
<Mouse receiver was plugged in at this point.  Mouse was off.>
[69358.973309] [...]/drivers/hid/hid-logitech-dj.c: Logitech-DJ:logi_dj_init

[...]

Quoted 10 lines
[69381.911438] logitech-djreceiver 0003:046D:C52B.0003: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0001:10:1b.1-1/input2
[69381.918070] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69381.918124] [...]/drivers/hid/hid-logitech-dj.c: delayedwork_callback
[69381.918135] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_recv_add_djhid_device: device list is empty
[69381.920069] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[69381.920119] [...]/drivers/hid/hid-logitech-dj.c: delayedwork_callback
[69381.920297] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse
[69381.920308] [...]/drivers/hid/hid-logitech-dj.c: logi_dj_ll_start
<Mouse was turned on at this point.>
[69381.920430] logitech-djdevice 0003:046D:C52B.0004: hidraw1: USB HID v1.11 Device [Logitech Unifying Device. Wireless PID:101a] on usb-0001:10:1b.1-1:1
Quoted 5 lines

Still no "logi_dj_ll_parse: sending a mouse descriptor, reports_supported: 4" so it looks like the patch didn't have the intended effect. Alas.

The pairing (...add_djhid_device) happens during initialization, before the mouse is turned on...

I don't think I quite follow there. By "pairing" I though you meant when the receiver connects to the mouse. How can the pairing be done while the device is off? Or what am I missing here?

Quoted 14 lines
Quoted 2 lines

Here's the capture of the pairing event.

[...]

Quoted 7 lines

Reading from 0003:046D:C52B.0003 resulted in the following

<Mouse turned on at this point>
report (size 15) (numbered) = 20 01 42 00 00 00 00 00 00 00 00 00 00 00 00 <Mouse turned off at this point>
report (size 15) (numbered) = 20 01 42 01 00 00 00 00 00 00 00 00 00 00 00 <EOF>

... so the events captured do not include pairing events (0x41). What we see here are connection status events (0x42). Sorry about that.

Quoted 6 lines

Here's a new patch that prints more information to dmesg. After applying the patch, you can use the patched driver by running

make drivers/hid/hid-logitech-dj.ko
modprobe -r hid-logitech-dj
insmod drivers/hid/hid-logitech-dj.ko

Great, that'll save me plenty of time!

Quoted 39 lines

---
Thanks again,
Jonathan

 drivers/hid/hid-logitech-dj.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/hid/hid-logitech-dj.c +5 -2
index e1c38bba4375..33a70cfbec77 100644
@@ -23,6 +23,7 @@
 
 
 #include <linux/device.h>
+#include <asm/unaligned.h>
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/usb.h>
@@ -273,8 +274,8 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
 		goto dj_device_allocate_fail;
 	}
 
-	dj_dev->reports_supported = le32_to_cpu(
-		dj_report->report_params[DEVICE_PAIRED_RF_REPORT_TYPE]);
+	dj_dev->reports_supported = get_unaligned_le32(
+		dj_report->report_params + DEVICE_PAIRED_RF_REPORT_TYPE);
 	dj_dev->hdev = dj_hiddev;
 	dj_dev->dj_receiver_dev = djrcv_dev;
 	dj_dev->device_index = dj_report->device_index;
@@ -618,9 +619,18 @@ static int logi_dj_raw_event(struct hid_device *hdev,
 	struct dj_report *dj_report = (struct dj_report *) data;
 	unsigned long flags;
 	bool report_processed = false;
+	char buf[32 * 3 + 1];
+	int i;
 
 	dbg_hid("%s, size:%d\n", __func__, size);
 

drivers/hid/hid-logitech-dj.c static int logi_dj_raw_event(struct hid_device *hdev, · line 636

Quoted 10 lines
drivers/hid/hid-logitech-dj.c +7 -0
+	if (0 < size && size <= 32) {
+		for (i = 0; i < size; i++)
+			snprintf(buf + 3*i, sizeof(buf) - 3*i,
+					" %02x", data[i]);
+		dbg_hid("%s: report = %s\n", __func__, buf);
+	}
+
 	/* Here we receive all data coming from iface 2, there are 4 cases:
 	 *
 	 * 1) Data should continue its normal processing i.e. data does not

Do I need to apply only this patch, or both the previous one and this one?

Signature · 1 line
Hugo Osvaldo Barrera
#17 lore raw
Quoted 8 lines · Hugo Osvaldo Barrera
Quoted 2 lines · Jonathan Nieder

The pairing (...add_djhid_device) happens during initialization, before the mouse is turned on...

I don't think I quite follow there. By "pairing" I though you meant when the receiver connects to the mouse. How can the pairing be done while the device is off? Or what am I missing here?

I'm guessing the actual pairing happens without Linux being involved. Then the driver sends a "get paired devices" request during initialization and the device sends the "device paired" notifications I'm interested in in response.

Quoted 1 line

Do I need to apply only this patch, or both the previous one and this one?

Only this patch.

Cheers,
Jonathan

#18 lore raw
Quoted 15 lines · Jonathan Nieder
Quoted 8 lines · Hugo Osvaldo Barrera
Quoted 2 lines · Jonathan Nieder

The pairing (...add_djhid_device) happens during initialization, before the mouse is turned on...

I don't think I quite follow there. By "pairing" I though you meant when the receiver connects to the mouse. How can the pairing be done while the device is off? Or what am I missing here?

I'm guessing the actual pairing happens without Linux being involved. Then the driver sends a "get paired devices" request during initialization and the device sends the "device paired" notifications I'm interested in in response.

Quoted 6 lines
Quoted 1 line

Do I need to apply only this patch, or both the previous one and this one?

Only this patch.

Cheers,
Jonathan

Hi!
I apologize for the really (really) long delay in replying. I've had a really busy week. I rebuilt the kernel with the patch (rebuilding the module did't work because I'd updated the kernel tree, and the re-built module wasn't recognized):

# uname -a
Linux athena 3.4.0-rc5+ #1 Fri May 4 19:14:24 ART 2012 ppc GNU/Linux

And I captured the dmesg from before plugging in the mouse (after a clean reboot).
The good news is there's a "41" event this time! :)

/sys/kernel/debug/hid/ is empty at this point, so I can't cat /sys/... .../events

[  365.757237] usbcore: registered new interface driver usbhid
[  365.757448] usbhid: USB HID core driver
[  365.761458] drivers/hid/hid-logitech-dj.c: Logitech-DJ:logi_dj_init
[  528.822188] usb 4-1: new full-speed USB device number 2 using ohci_hcd
[  529.044194] usb 4-1: New USB device found, idVendor=046d, idProduct=c52b
[  529.044417] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  529.044646] usb 4-1: Product: USB Receiver
[  529.044783] usb 4-1: Manufacturer: Logitech
[  529.054294] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0
[  529.054436] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 0
[  529.054442] drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 0
[  529.054561] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1
[  529.054658] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 1
[  529.054664] drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 1
[  529.054754] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 2
[  529.054852] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 2
[  529.061218] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x1001 wIndex=0x0200 wLength=1792
[  529.063218] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x1101 wIndex=0x0200 wLength=5120
[  529.064204] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x2001 wIndex=0x0200 wLength=3840
[  529.065199] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x2101 wIndex=0x0200 wLength=8192
[  529.066942] logitech-djreceiver 0003:046D:C52B.0003: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0001:10:1b.1-1/input2
[  529.073214] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[  529.073230] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event: report =  20 01 41 01 1a 10 04 00 00 00 00 00 00 00 00
[  529.073277] drivers/hid/hid-logitech-dj.c: delayedwork_callback
[  529.073447] drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse
[  529.073453] drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse: sending a mouse descriptor, reports_supported: 4
[  529.074068] drivers/hid/hid-logitech-dj.c: logi_dj_ll_start
[  529.074276] input: Logitech Unifying Device. Wireless PID:101a as /devices/pci0001:10/0001:10:1b.1/usb4/4-1/4-1:1.2/0003:046D:C52B.0003/input/input5
[  529.075216] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[  529.075229] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event: report =  20 00 41 02 00 00 00 00 00 00 00 00 00 00 00
[  529.075854] drivers/hid/hid-logitech-dj.c: logi_dj_ll_open:usb-0001:10:1b.1-1:1
[  529.075887] drivers/hid/hid-logitech-dj.c: logi_dj_ll_close:usb-0001:10:1b.1-1:1
[  529.075929] drivers/hid/hid-logitech-dj.c: logi_dj_ll_open:usb-0001:10:1b.1-1:1
[  529.075966] drivers/hid/hid-logitech-dj.c: logi_dj_ll_close:usb-0001:10:1b.1-1:1
[  529.076072] logitech-djdevice 0003:046D:C52B.0004: input,hidraw1: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:101a] on usb-0001:10:1b.1-1:1
[  529.076547] drivers/hid/hid-logitech-dj.c: delayedwork_callback
[  529.076554] drivers/hid/hid-logitech-dj.c: logi_dj_recv_add_djhid_device: device list is empty

<receiver plugged in>

[  593.872745] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[  593.872760] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event: report =  20 01 42 00 00 00 00 00 00 00 00 00 00 00 00

<mouse turned on>

Since /sys/kernel/debug/hid/ is empty until I plug in the receiver, I can't cat the events until then. The output of the events is the same as before when I turned on the mouse (I'm thinking you won't need this, but I'd rather be sure).

# cat /sys/kernel/debug/hid/0003\:046D\:C52B.0003/events 
report (size 15) (numbered) =  20 01 42 00 00 00 00 00 00 00 00 00 00 00 00

-----

JUST as I was about to send this e-mail, I was reading the output of that dmesg and noticed that a few more /inputX devices were mentioned, so I decided to actually try the mouse, something that I'd neglected to do this last round (I though this patch only added debuging output).

The mouse actually works now on Xorg just fine. :)

A big thanks (truly) for all your effort on this. I'm still including the above info because I'm not sure if it's of use to you or not.

Cheers,

Hugo

#19 lore raw

Great news. Thanks Hugo for your help testing the patches.

Jonathan, how do we proceed now, I mean to submit the fix ?

Thanks,
Nestor

Quoted 100 lines · Hugo Osvaldo Barrera
Quoted 15 lines · Jonathan Nieder
Quoted 8 lines · Hugo Osvaldo Barrera
Quoted 2 lines · Jonathan Nieder

The pairing (...add_djhid_device) happens during initialization, before the mouse is turned on...

I don't think I quite follow there.  By "pairing" I though you meant when the receiver connects to the mouse.  How can the pairing be done while the device is off?  Or what am I missing here?

I'm guessing the actual pairing happens without Linux being involved. Then the driver sends a "get paired devices" request during initialization and the device sends the "device paired" notifications I'm interested in in response.

Quoted 6 lines
Quoted 1 line

Do I need to apply only this patch, or both the previous one and this one?

Only this patch.

Cheers,
Jonathan

Hi!
I apologize for the really (really) long delay in replying.  I've had a really busy week. I rebuilt the kernel with the patch (rebuilding the module did't work because I'd updated the kernel tree, and the re-built module wasn't recognized):

# uname -a
Linux athena 3.4.0-rc5+ #1 Fri May 4 19:14:24 ART 2012 ppc GNU/Linux

And I captured the dmesg from before plugging in the mouse (after a clean reboot).
The good news is there's a "41" event this time! :)

/sys/kernel/debug/hid/ is empty at this point, so I can't cat /sys/... .../events

[  365.757237] usbcore: registered new interface driver usbhid
[  365.757448] usbhid: USB HID core driver
[  365.761458] drivers/hid/hid-logitech-dj.c: Logitech-DJ:logi_dj_init
[  528.822188] usb 4-1: new full-speed USB device number 2 using ohci_hcd
[  529.044194] usb 4-1: New USB device found, idVendor=046d, idProduct=c52b
[  529.044417] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  529.044646] usb 4-1: Product: USB Receiver
[  529.044783] usb 4-1: Manufacturer: Logitech
[  529.054294] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0
[  529.054436] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 0
[  529.054442] drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 0
[  529.054561] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 1
[  529.054658] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 1
[  529.054664] drivers/hid/hid-logitech-dj.c: logi_dj_probe: ignoring ifnum 1
[  529.054754] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 2
[  529.054852] drivers/hid/hid-logitech-dj.c: logi_dj_probe called for ifnum 2
[  529.061218] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x1001 wIndex=0x0200 wLength=1792
[  529.063218] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x1101 wIndex=0x0200 wLength=5120
[  529.064204] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x2001 wIndex=0x0200 wLength=3840
[  529.065199] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x2101 wIndex=0x0200 wLength=8192
[  529.066942] logitech-djreceiver 0003:046D:C52B.0003: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0001:10:1b.1-1/input2 [  529.073214] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[  529.073230] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event: report =  20 01 41 01 1a 10 04 00 00 00 00 00 00 00 00
[  529.073277] drivers/hid/hid-logitech-dj.c: delayedwork_callback
[  529.073447] drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse
[  529.073453] drivers/hid/hid-logitech-dj.c: logi_dj_ll_parse: sending a mouse descriptor, reports_supported: 4
[  529.074068] drivers/hid/hid-logitech-dj.c: logi_dj_ll_start
[  529.074276] input: Logitech Unifying Device. Wireless PID:101a as /devices/pci0001:10/0001:10:1b.1/usb4/4-1/4-1:1.2/0003:046D:C52B.0003/input/input5 [  529.075216] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[  529.075229] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event: report =  20 00 41 02 00 00 00 00 00 00 00 00 00 00 00
[  529.075854] drivers/hid/hid-logitech-dj.c: logi_dj_ll_open:usb-0001:10:1b.1-1:1
[  529.075887] drivers/hid/hid-logitech-dj.c: logi_dj_ll_close:usb-0001:10:1b.1-1:1
[  529.075929] drivers/hid/hid-logitech-dj.c: logi_dj_ll_open:usb-0001:10:1b.1-1:1
[  529.075966] drivers/hid/hid-logitech-dj.c: logi_dj_ll_close:usb-0001:10:1b.1-1:1
[  529.076072] logitech-djdevice 0003:046D:C52B.0004: input,hidraw1: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:101a] on usb-0001:10:1b.1-1:1 [  529.076547] drivers/hid/hid-logitech-dj.c: delayedwork_callback
[  529.076554] drivers/hid/hid-logitech-dj.c: logi_dj_recv_add_djhid_device: device list is empty

<receiver plugged in>

[  593.872745] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event, size:15
[  593.872760] drivers/hid/hid-logitech-dj.c: logi_dj_raw_event: report =  20 01 42 00 00 00 00 00 00 00 00 00 00 00 00 <mouse turned on>

Since /sys/kernel/debug/hid/ is empty until I plug in the receiver, I can't cat the events until then. The output of the events is the same as before when I turned on the mouse (I'm thinking you won't need this, but I'd rather be sure).

# cat /sys/kernel/debug/hid/0003\:046D\:C52B.0003/events
report (size 15) (numbered) =  20 01 42 00 00 00 00 00 00 00 00 00 00 00 00

-----

JUST as I was about to send this e-mail, I was reading the output of that dmesg and noticed that a few more /inputX devices were mentioned, so I decided to actually try the mouse, something that I'd neglected to do this last round (I though this patch only added debuging output).

Quoted 8 lines

The mouse actually works now on Xorg just fine. :)

A big thanks (truly) for all your effort on this.  I'm still including the above info because I'm not sure if it's of use to you or not.

Cheers,

Hugo

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#20 lore raw

[PATCH/RFC] HID: logitech: read all 32 bits of report type bitfield

On big-endian systems (e.g., Apple PowerBook), trying to use a logitech wireless mouse with the Logitech Unifying Receiver does not work with v3.2 and later kernels. The device doesn't show up in /dev/input. Older kernels work fine.

That is because the new hid-logitech-dj driver claims the device. The device arrival notification appears:

	20 00 41 02 00 00 00 00 00 00 00 00 00 00 00

and we read the report_types bitfield (02 00 00 00) to find out what kind of device it is. Unfortunately the driver only reads the first 8 bits and treats that value as a 32-bit little-endian number, so on a powerpc the report type seems to be 0x02000000 and is not recognized.

Even on little-endian machines, connecting a media center remote control (report type 00 01 00 00) with this driver loaded would presumably fail for the same reason.

Fix both problems by using get_unaligned_le32() to read all four bytes, which is a little clearer anyway. After this change, the wireless mouse works on Hugo's PowerBook again.

Based on a patch by Nestor Lopez Casado.
Addresses http://bugs.debian.org/671292

---

Quoted 3 lines · Nestor Lopez Casado

Great news. Thanks Hugo for your help testing the patches.

Jonathan, how do we proceed now, I mean to submit the fix ?

If the patch looks good to you, we ask Jiri to pick it up. What do you think?

Thanks,
Jonathan

 drivers/hid/hid-logitech-dj.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hid/hid-logitech-dj.c +3 -2
index 38b12e45780c..2eac8c566b17 100644
@@ -26,6 +26,7 @@
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/usb.h>
+#include <asm/unaligned.h>
 #include "usbhid/usbhid.h"
 #include "hid-ids.h"
 #include "hid-logitech-dj.h"
@@ -265,8 +266,8 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
 		goto dj_device_allocate_fail;
 	}
 
-	dj_dev->reports_supported = le32_to_cpu(
-		dj_report->report_params[DEVICE_PAIRED_RF_REPORT_TYPE]);
+	dj_dev->reports_supported = get_unaligned_le32(
+		dj_report->report_params + DEVICE_PAIRED_RF_REPORT_TYPE);
 	dj_dev->hdev = dj_hiddev;
 	dj_dev->dj_receiver_dev = djrcv_dev;
 	dj_dev->device_index = dj_report->device_index;
Signature · 1 line
1.7.10.1
#21 lore raw

Re: [PATCH/RFC] HID: logitech: read all 32 bits of report type bitfield

The patch looks perfect to me. Wonderful 'get_unaligned_le32' that I looked for and did not find when trying to fix the original code.

On my side no issues for Jiri to apply it.

Thanks again Jonathan and Hugo.

Cheers,
Nestor.

Quoted 70 lines · Jonathan Nieder

On big-endian systems (e.g., Apple PowerBook), trying to use a logitech wireless mouse with the Logitech Unifying Receiver does not work with v3.2 and later kernels.  The device doesn't show up in /dev/input.  Older kernels work fine.

That is because the new hid-logitech-dj driver claims the device.  The device arrival notification appears:

       20 00 41 02 00 00 00 00 00 00 00 00 00 00 00

and we read the report_types bitfield (02 00 00 00) to find out what kind of device it is.  Unfortunately the driver only reads the first 8 bits and treats that value as a 32-bit little-endian number, so on a powerpc the report type seems to be 0x02000000 and is not recognized.

Even on little-endian machines, connecting a media center remote control (report type 00 01 00 00) with this driver loaded would presumably fail for the same reason.

Fix both problems by using get_unaligned_le32() to read all four bytes, which is a little clearer anyway.  After this change, the wireless mouse works on Hugo's PowerBook again.

Based on a patch by Nestor Lopez Casado.
Addresses http://bugs.debian.org/671292

---

Quoted 3 lines · Nestor Lopez Casado

Great news. Thanks Hugo for your help testing the patches.

Jonathan, how do we proceed now, I mean to submit the fix ?

If the patch looks good to you, we ask Jiri to pick it up.  What do you think?

Thanks,
Jonathan

 drivers/hid/hid-logitech-dj.c |    5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hid/hid-logitech-dj.c +3 -3
index 38b12e45780c..2eac8c566b17 100644
@@ -26,6 +26,7 @@
  #include <linux/hid.h>
  #include <linux/module.h>
  #include <linux/usb.h>
+#include <asm/unaligned.h>
  #include "usbhid/usbhid.h"
  #include "hid-ids.h"
  #include "hid-logitech-dj.h"
@@ -265,8 +266,8 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
                goto dj_device_allocate_fail;
        }
 
-       dj_dev->reports_supported = le32_to_cpu(
-               dj_report->report_params[DEVICE_PAIRED_RF_REPORT_TYPE]);
+       dj_dev->reports_supported = get_unaligned_le32(
+               dj_report->report_params + DEVICE_PAIRED_RF_REPORT_TYPE);
        dj_dev->hdev = dj_hiddev;
        dj_dev->dj_receiver_dev = djrcv_dev;
        dj_dev->device_index = dj_report->device_index;
--
Quoted 2 lines

1.7.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#22 lore raw

Re: [PATCH/RFC] HID: logitech: read all 32 bits of report type bitfield

Quoted 4 lines · Nestor Lopez Casado

The patch looks perfect to me. Wonderful 'get_unaligned_le32' that I looked for and did not find when trying to fix the original code.

On my side no issues for Jiri to apply it.

Nice to hear. Thanks again for all your help.

Ciao,
Jonathan

#23 lore raw

PATCH v2 1/1 HID: logitech: read all 32 bits of report type bitfield

In reply to Jonathan Nieder

From: Nestor Lopez Casado <[email protected]>

On big-endian systems (e.g., Apple PowerBook), trying to use a logitech wireless mouse with the Logitech Unifying Receiver does not work with v3.2 and later kernels. The device doesn't show up in /dev/input. Older kernels work fine.

That is because the new hid-logitech-dj driver claims the device. The device arrival notification appears:

	20 00 41 02 00 00 00 00 00 00 00 00 00 00 00

and we read the report_types bitfield (02 00 00 00) to find out what kind of device it is. Unfortunately the driver only reads the first 8 bits and treats that value as a 32-bit little-endian number, so on a powerpc the report type seems to be 0x02000000 and is not recognized.

Even on little-endian machines, connecting a media center remote control (report type 00 01 00 00) with this driver loaded would presumably fail for the same reason.

Fix both problems by using get_unaligned_le32() to read all four bytes, which is a little clearer anyway. After this change, the wireless mouse works on Hugo's PowerBook again.

Addresses http://bugs.debian.org/671292

[jn: with commit message and tweaked to use get_unaligned instead of
copying onto the stack]

---
Change since v1: fixed attribution.

I had been wondering why the patch you sent before didn't fix Hugo's problem while the effectively identical patch I sent did. The only explanation I can think of is an error introduced in applying the patch by hand.

 drivers/hid/hid-logitech-dj.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hid/hid-logitech-dj.c +3 -2
index 38b12e45780c..2eac8c566b17 100644
@@ -26,6 +26,7 @@
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/usb.h>
+#include <asm/unaligned.h>
 #include "usbhid/usbhid.h"
 #include "hid-ids.h"
 #include "hid-logitech-dj.h"
@@ -265,8 +266,8 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
 		goto dj_device_allocate_fail;
 	}
 
-	dj_dev->reports_supported = le32_to_cpu(
-		dj_report->report_params[DEVICE_PAIRED_RF_REPORT_TYPE]);
+	dj_dev->reports_supported = get_unaligned_le32(
+		dj_report->report_params + DEVICE_PAIRED_RF_REPORT_TYPE);
 	dj_dev->hdev = dj_hiddev;
 	dj_dev->dj_receiver_dev = djrcv_dev;
 	dj_dev->device_index = dj_report->device_index;
Signature · 1 line
1.7.10.1
#24 lore raw

Re: [PATCH/RFC v2] HID: logitech: read all 32 bits of report type bitfield

Quoted 25 lines · Jonathan Nieder

From: Nestor Lopez Casado <[email protected]>

On big-endian systems (e.g., Apple PowerBook), trying to use a logitech wireless mouse with the Logitech Unifying Receiver does not work with v3.2 and later kernels. The device doesn't show up in /dev/input. Older kernels work fine.

That is because the new hid-logitech-dj driver claims the device. The device arrival notification appears:

	20 00 41 02 00 00 00 00 00 00 00 00 00 00 00

and we read the report_types bitfield (02 00 00 00) to find out what kind of device it is. Unfortunately the driver only reads the first 8 bits and treats that value as a 32-bit little-endian number, so on a powerpc the report type seems to be 0x02000000 and is not recognized.

Even on little-endian machines, connecting a media center remote control (report type 00 01 00 00) with this driver loaded would presumably fail for the same reason.

Fix both problems by using get_unaligned_le32() to read all four bytes, which is a little clearer anyway. After this change, the wireless mouse works on Hugo's PowerBook again.

Quoted 7 lines

Addresses http://bugs.debian.org/671292

[jn: with commit message and tweaked to use get_unaligned instead of
copying onto the stack]

If Nestor is really the original author of this patch, his Signed-off-by:
is necessary.

Nestor, please?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#25 lore raw

Re: [PATCH/RFC v2] HID: logitech: read all 32 bits of report type bitfield

In reply to Jonathan Nieder
Quoted 33 lines · Jonathan Nieder

From: Nestor Lopez Casado <[email protected]>

On big-endian systems (e.g., Apple PowerBook), trying to use a logitech wireless mouse with the Logitech Unifying Receiver does not work with v3.2 and later kernels. The device doesn't show up in /dev/input. Older kernels work fine.

That is because the new hid-logitech-dj driver claims the device. The device arrival notification appears:

	20 00 41 02 00 00 00 00 00 00 00 00 00 00 00

and we read the report_types bitfield (02 00 00 00) to find out what kind of device it is. Unfortunately the driver only reads the first 8 bits and treats that value as a 32-bit little-endian number, so on a powerpc the report type seems to be 0x02000000 and is not recognized.

Even on little-endian machines, connecting a media center remote control (report type 00 01 00 00) with this driver loaded would presumably fail for the same reason.

Fix both problems by using get_unaligned_le32() to read all four bytes, which is a little clearer anyway. After this change, the wireless mouse works on Hugo's PowerBook again.

Addresses http://bugs.debian.org/671292

[jn: with commit message and tweaked to use get_unaligned instead of
copying onto the stack]

Quoted 8 lines

---
Change since v1: fixed attribution.

I had been wondering why the patch you sent before didn't fix Hugo's problem while the effectively identical patch I sent did. The only explanation I can think of is an error introduced in applying the patch by hand.

<patch snipped>

I'd hate to think I screwed up applying such a simple patch, but it's the only thing I can think of as well.

Thanks again to both of you for your time and effort, and for your timely responses on this issue!

I hope this makes it to the main branch soon!

Cheers, and good luck to both,

Signature · 1 line
Hugo Osvaldo Barrera