LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Rebinding usb hid devices to hid-generic driver fails (https://www.linuxquestions.org/questions/linux-kernel-70/rebinding-usb-hid-devices-to-hid-generic-driver-fails-4175489901/)

onamatic 01-02-2014 08:46 AM

Rebinding usb hid devices to hid-generic driver fails
 
using kernel 3.8.0-34-generic (Mint 15)
If I plug in a usb mouse (mfr/vendor id: 03F0:8607) it works fine and is (by default) handled with hid-generic:
# tree /sys/bus/hid/drivers/hid-generic
/sys/bus/hid/drivers/hid-generic
├── 0003:03F0:8607.0007 -> ../../../../devices/pci0000:00/0000:00:12.2/usb1/1-2/1-2.1/1-2.1.2/1-2.1.2:1.0/0003:03F0:8607.0007
├── 0003:093A:2510.0001 -> ../../../../devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/0003:093A:2510.0001
├── bind
├── module -> ../../../../module/hid_generic
├── new_id
├── uevent
└── unbind

Now I unbind the device:
# echo -n 0003:03F0:8607.0007 > /sys/bus/hid/drivers/hid-generic/unbind
The binding has gone:
# tree /sys/bus/hid/drivers/hid-generic
/sys/bus/hid/drivers/hid-generic
├── 0003:093A:2510.0001 -> ../../../../devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/0003:093A:2510.0001
├── bind
├── module -> ../../../../module/hid_generic
├── new_id
├── uevent
└── unbind

and the mouse stops working - as expected.

But now I want to rebind it:
# echo -n 0003:03F0:8607.0007 > /sys/bus/hid/drivers/hid-generic/bind
The binding apparently succeeds:
# tree /sys/bus/hid/drivers/hid-generic
/sys/bus/hid/drivers/hid-generic
├── 0003:03F0:8607.0008 -> ../../../../devices/pci0000:00/0000:00:12.2/usb1/1-2/1-2.1/1-2.1.2/1-2.1.2:1.0/0003:03F0:8607.0008
├── 0003:093A:2510.0001 -> ../../../../devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/0003:093A:2510.0001
├── bind
├── module -> ../../../../module/hid_generic
├── new_id
├── uevent
└── unbind

but the mouse doesn't start working again. Why not? The only thing that has changed is the instance number (in bold).
Would you expect this to work or is the bind/unbind process a bit more complicated?

dometec 05-25-2014 09:46 AM

Test
 
Hi, I tried your procedure with a USB bar code scanner (viewed as a HID-generic device) and work as aspected.

Regards
Domenico


All times are GMT -5. The time now is 07:26 PM.