FS#56069 - [usbip] Unable to attach remote device

Attached to Project: Community Packages
Opened by Victor Bessonov (Unb0rn) - Saturday, 21 October 2017, 19:27 GMT
Last edited by Sébastien Luttringer (seblu) - Sunday, 10 December 2017, 10:36 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Description:
I am running Arch on a VM on Gentoo host.
Trying to attach remote device with usbip attach --remote <ip> --busid <id>.
I am able to attach device on gentoo (usbip 4.13), but it fails on arch.
Running kernel 4.13.8 on Gentoo and 4.13.7-1 on Arch.
Error on attach:
libusbip: error: udev_device_get_sysattr_value failed.
usbip: error: open vhci_driver
usbip: error: query

Of course, vhci_hcd and usbip-core are loaded and running fine.
I had the same problem with the same error on Gentoo before updating usbip to 4.13.
Also this(or look-alike) problem was described on Gentoo bugtracker: https://bugs.gentoo.org/634996

Additional info:
* package version(s)
usbip 4-13-1


Steps to reproduce:
-Install usbip
-Load kernel modules with:
modprobe usbip-core
modprobe vhci-hcd
-Try to attach remote usb device
usbip attach --remote <ip> --busid <deviceid>
This task depends upon

Closed by  Sébastien Luttringer (seblu)
Sunday, 10 December 2017, 10:36 GMT
Reason for closing:  Upstream
Comment by Philipp Schaffrath (phisch) - Tuesday, 31 October 2017, 14:37 GMT
Experiencing the same issue. Have you found a solution?

Some more info that might help:

[phisch@tower:~]$ usbip list -r 192.168.0.101 (10-31 15:32)
Exportable USB devices
======================
- 192.168.0.101
1-1.2: Holtek Semiconductor, Inc. : unknown product (04d9:0169)
: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2
: (Defined at Interface level) (00/00/00)

[phisch@tower:~]$ sudo usbip attach -r 192.168.0.101 -b 1-1.2 (10-31 15:32)
libusbip: error: udev_device_get_sysattr_value failed
usbip: error: open vhci_driver
usbip: error: query
[phisch@tower:~][1]$ lsmod | grep vhci_hcd (10-31 15:32)
vhci_hcd 40960 0
usbip_core 28672 2 vhci_hcd,usbip_host
usbcore 208896 9 usbhid,snd_usb_audio,vhci_hcd,usbip_host,ehci_hcd,xhci_pci,snd_usbmidi_lib,xhci_hcd,ehci_pci
usb_common 16384 3 vhci_hcd,usbcore,usbip_core
[phisch@tower:~]$ lsmod | grep usbip (10-31 15:34)
usbip_host 28672 0
usbip_core 28672 2 vhci_hcd,usbip_host
usbcore 208896 9 usbhid,snd_usb_audio,vhci_hcd,usbip_host,ehci_hcd,xhci_pci,snd_usbmidi_lib,xhci_hcd,ehci_pci
usb_common 16384 3 vhci_hcd,usbcore,usbip_core
[phisch@tower:~]$ usbip version (10-31 15:34)
usbip (usbip-utils 2.0)
[phisch@tower:~]$ pacman -Q usbip (10-31 15:35)
usbip 4.13-1
[phisch@tower:~]$ pacman -Q linux (10-31 15:35)
linux 4.13.9-1
Comment by Victor Bessonov (Unb0rn) - Wednesday, 01 November 2017, 14:29 GMT
There is no workaround if I understand the problem correctly.
Due to this: https://github.com/torvalds/linux/commit/dff3565b8e1c0be6fc83ba47dcab45c149dcab5b#diff-1860d675dbf910a8f3f01825f849e7cf commit, USBIP_VHCI_DRV_NAME(/sys/class/platform/vhci_hcd) changed to USBIP_VHCI_DEVICE_NAME(/sys/bus/platform/devices/vhci_hcd.0)
So, update should resolve this problem.
I think we should just wait for maintainer to update it...
Comment by Philipp Schaffrath (phisch) - Wednesday, 01 November 2017, 23:39 GMT
So, i was looking into the source code today and debugged the vhci_driver a little bit and found out that there is another error.
The platform controllers got renamed from vhci_hcd to vhci_hcd.[index], the current version handles this correctly, but someone messed up reading the status. The status file is located under /sys/devices/platform/vhci_hcd.0/status, but the code tries appending the vhci_hcd index to the status file: https://github.com/torvalds/linux/blob/master/tools/usb/usbip/libsrc/vhci_driver.c#L118

I don't know if the status files where located in one directory and suffixed with that id in the past, but right now it isn't, so this is just wrong.

After patching this out, so it just loads the correct "status" file, usbip works for me again.

Not too familiar with usbip yet, but my tests have shown me some other issues with that software, for example it doesn't handle hibernate nicely, there are no options to auto-discover and attach/detach devices, no option to kick out already connected clients if a new client requests a usb device, massive problems when a system goes into hibernate or shuts down etc.

I really like the idea, so I will probably work myself into the code, think about some concepts to handle this a little more comfortable and extend it.

Loading...