Como entender e depurar problemas de USB com o Linux

3

Estou tendo um problema estranho com um "hub USB reverso" barato - não sei qual é o nome técnico - chamado de Interruptor de Compartilhamento USB Tek Republic TUS-200 . Ele tem uma porta USB para dispositivos e duas portas de host que eu posso conectar dois computadores e, em seguida, um switch que conecta o dispositivo a um computador ou outro. Eu uso como um KVM com um teclado usb e dois computadores)

Ele funciona bem no Windows, mas isso pode ser porque o laptop que estou usando tem um barramento USB por porta ... mais sobre isso depois.

No Linux, Debian 7 3.2.0-4-amd64, ele funciona bem, até que haja uma considerável transferência de dados em outro dispositivo no mesmo barramento usb. Por exemplo, copiando um arquivo grande para um pen drive.

Tenho quase certeza de que isso tem a ver com o aterramento no reverso-usb, porque isso não acontece quando está conectado a apenas um computador.

Mas a questão aqui não é tanto depurar o dito dispositivo, mas fazer sentido das mensagens de log do sistema USB do kernel Linux , já que eu nunca tive que lidar com elas, e agora eu não encontrei absolutamente nada explicando isso em termos leigos.

Aqui está: assim que eu começar a transferir para um pen drive no mesmo barramento USB que o hub reverso é, eu coloco isso em diante dmesg:

Feb  8 16:36:51 dotmatrix kernel: [10807.868649] generic-usb 0003:04D9:0114.0006: can't reset device, 0000:00:1a.0-1.6.4/input1, status -75
Feb  8 16:36:51 dotmatrix kernel: [10807.872669] usb 1-1.6: clear tt 1 (00a0) error -71
Feb  8 16:36:51 dotmatrix kernel: [10807.873710] generic-usb 0003:04D9:A09F.0001: can't reset device, 0000:00:1a.0-1.6.1/input0, status -71
Feb  8 16:36:51 dotmatrix kernel: [10807.876699] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -71
Feb  8 16:36:51 dotmatrix kernel: [10807.877658] usb 1-1.6: clear tt 1 (0080) error -71
Feb  8 16:36:51 dotmatrix kernel: [10807.881663] generic-usb 0003:04D9:A09F.0002: can't reset device, 0000:00:1a.0-1.6.1/input1, status -71
Feb  8 16:36:51 dotmatrix kernel: [10807.881766] usb 1-1.6: clear tt 1 (00a0) error -71
Feb  8 16:36:51 dotmatrix kernel: [10807.883641] generic-usb 0003:0C45:7401.0004: can't reset device, 0000:00:1a.0-1.6.3/input0, status -71
Feb  8 16:36:51 dotmatrix kernel: [10807.885815] generic-usb 0003:04D9:0114.0006: can't reset device, 0000:00:1a.0-1.6.4/input1, status -71
Feb  8 16:36:51 dotmatrix kernel: [10807.885880] usb 1-1.6: clear tt 1 (0080) error -71

depois de um tempo a mensagem se torna:

Feb  8 16:36:52 dotmatrix kernel: [10808.890502] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.890752] generic-usb 0003:04D9:A09F.0001: can't reset device, 0000:00:1a.0-1.6.1/input0, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.892162] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.893202] generic-usb 0003:0C45:7401.0004: can't reset device, 0000:00:1a.0-1.6.3/input0, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.894235] generic-usb 0003:04D9:0114.0006: can't reset device, 0000:00:1a.0-1.6.4/input1, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.895038] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.898724] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.900590] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.901409] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:52 dotmatrix kernel: [10808.901668] generic-usb 0003:0C45:7401.0004: can't reset device, 0000:00:1a.0-1.6.3/input0, status -32

e então um único

Feb  8 16:36:57 dotmatrix kernel: [10814.370566] usb 1-1.6.1: device not accepting address 8, error -32

então de volta ao status -32 como acima. Às vezes, ele será "redefinido":

Feb  8 16:36:58 dotmatrix kernel: [10815.142955] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.144945] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.288169] usb 1-1.6.1: reset full-speed USB device number 8 using ehci_hcd
Feb  8 16:36:58 dotmatrix kernel: [10815.438083] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.452998] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.467998] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.481784] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.508875] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.521838] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.533804] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.545770] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.557731] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.569698] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:58 dotmatrix kernel: [10815.603594] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:59 dotmatrix kernel: [10815.635501] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:59 dotmatrix kernel: [10815.656441] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:59 dotmatrix kernel: [10815.666411] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -32
Feb  8 16:36:59 dotmatrix kernel: [10815.666655] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -32
Feb  8 16:36:59 dotmatrix kernel: [10815.694672] usb 1-1.6.1: device not accepting address 8, error -32
Feb  8 16:36:59 dotmatrix kernel: [10815.696707] usb 1-1.6.1: USB disconnect, device number 8
Feb  8 16:36:59 dotmatrix kernel: [10815.954352] usb 1-1.6.3: reset low-speed USB device number 9 using ehci_hcd
Feb  8 16:36:59 dotmatrix kernel: [10816.213579] usb 1-1.6.3: device descriptor read/64, error -32
Feb  8 16:36:59 dotmatrix kernel: [10816.576510] usb 1-1.6.3: device descriptor read/64, error -32
Feb  8 16:37:00 dotmatrix kernel: [10816.683747] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -16
Feb  8 16:37:00 dotmatrix kernel: [10816.939302] usb 1-1.6.3: reset low-speed USB device number 9 using ehci_hcd
Feb  8 16:37:00 dotmatrix kernel: [10817.198547] usb 1-1.6.3: device descriptor read/64, error -32
Feb  8 16:37:01 dotmatrix kernel: [10818.375220] usb 1-1.6.3: device descriptor read/64, error -32
Feb  8 16:37:05 dotmatrix kernel: [10821.729353] usb 1-1.6.3: reset low-speed USB device number 9 using ehci_hcd
Feb  8 16:37:05 dotmatrix kernel: [10822.135753] usb 1-1.6.3: device not accepting address 9, error -32
Feb  8 16:37:06 dotmatrix kernel: [10823.392464] usb 1-1.6.3: reset low-speed USB device number 9 using ehci_hcd
Feb  8 16:37:07 dotmatrix kernel: [10823.798897] usb 1-1.6.3: device not accepting address 9, error -32
Feb  8 16:37:07 dotmatrix kernel: [10823.871064] usb 1-1.6.4: reset full-speed USB device number 10 using ehci_hcd
Feb  8 16:37:08 dotmatrix kernel: [10825.031645] usb 1-1.6.1: new full-speed USB device number 19 using ehci_hcd
Feb  8 16:37:08 dotmatrix kernel: [10825.509849] usb 1-1.6.1: device not accepting address 19, error -32
Feb  8 16:37:09 dotmatrix kernel: [10826.427537] usb 1-1.6.1: new full-speed USB device number 20 using ehci_hcd
Feb  8 16:37:09 dotmatrix kernel: [10826.524335] usb 1-1.6.1: unable to read config index 0 descriptor/all
Feb  8 16:37:09 dotmatrix kernel: [10826.524340] usb 1-1.6.1: can't read configurations, error -32
Feb  8 16:37:10 dotmatrix kernel: [10826.595014] usb 1-1.6.1: new full-speed USB device number 21 using ehci_hcd
Feb  8 16:37:10 dotmatrix kernel: [10826.832449] usb 1-1.6.1: New USB device found, idVendor=04d9, idProduct=a09f
Feb  8 16:37:10 dotmatrix kernel: [10826.832454] usb 1-1.6.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Feb  8 16:37:10 dotmatrix kernel: [10826.832457] usb 1-1.6.1: Product: USB Gaming Mouse
Feb  8 16:37:10 dotmatrix kernel: [10826.832459] usb 1-1.6.1: Manufacturer: E-Signal
Feb  8 16:37:10 dotmatrix kernel: [10826.835328] input: E-Signal USB Gaming Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/1-1.6.1/1-1.6.1:1.0/input/input11
Feb  8 16:37:10 dotmatrix kernel: [10826.835552] generic-usb 0003:04D9:A09F.0009: input,hidraw0: USB HID v1.10 Mouse [E-Signal USB Gaming Mouse] on usb-0000:00:1a.0-1.6.1/input0
Feb  8 16:37:10 dotmatrix kernel: [10826.840323] input: E-Signal USB Gaming Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/1-1.6.1/1-1.6.1:1.1/input/input12
Feb  8 16:37:10 dotmatrix kernel: [10826.840663] generic-usb 0003:04D9:A09F.000A: input,hiddev0,hidraw1: USB HID v1.10 Keyboard [E-Signal USB Gaming Mouse] on usb-0000:00:1a.0-1.6.1/input1
Feb  8 16:37:10 dotmatrix kernel: [10826.843392] generic-usb 0003:04D9:A09F.000B: hiddev0,hidraw2: USB HID v1.10 Device [E-Signal USB Gaming Mouse] on usb-0000:00:1a.0-1.6.1/input2
Feb  8 16:37:10 dotmatrix kernel: [10826.844372] usb 1-1.6.3: USB disconnect, device number 9
Feb  8 16:37:10 dotmatrix kernel: [10827.057683] usb 1-1.6.3: new low-speed USB device number 22 using ehci_hcd
Feb  8 16:37:10 dotmatrix kernel: [10827.129474] usb 1-1.6.3: device descriptor read/64, error -32
Feb  8 16:37:10 dotmatrix kernel: [10827.304942] usb 1-1.6.3: device descriptor read/64, error -32
Feb  8 16:37:10 dotmatrix kernel: [10827.480417] usb 1-1.6.3: new low-speed USB device number 23 using ehci_hcd
Feb  8 16:37:10 dotmatrix kernel: [10827.552202] usb 1-1.6.3: device descriptor read/64, error -32
Feb  8 16:37:11 dotmatrix kernel: [10827.727689] usb 1-1.6.3: device descriptor read/64, error -32
Feb  8 16:37:11 dotmatrix kernel: [10827.903169] usb 1-1.6.3: new low-speed USB device number 24 using ehci_hcd
Feb  8 16:37:11 dotmatrix kernel: [10828.029940] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -32
Feb  8 16:37:11 dotmatrix kernel: [10828.038042] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -32
Feb  8 16:37:11 dotmatrix kernel: [10828.309656] usb 1-1.6.3: device not accepting address 24, error -32
Feb  8 16:37:11 dotmatrix kernel: [10828.381760] usb 1-1.6.3: new low-speed USB device number 25 using ehci_hcd
Feb  8 16:37:12 dotmatrix kernel: [10828.788252] usb 1-1.6.3: device not accepting address 25, error -32
Feb  8 16:37:12 dotmatrix kernel: [10828.788575] hub 1-1.6:1.0: unable to enumerate USB device on port 3
Feb  8 16:37:35 dotmatrix kernel: [10851.552743] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -32
Feb  8 16:37:48 dotmatrix kernel: [10864.780978] generic-usb 0003:04D9:A09F.0009: can't reset device, 0000:00:1a.0-1.6.1/input0, status -32
Feb  8 16:37:48 dotmatrix kernel: [10864.781857] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -32
Feb  8 16:37:50 dotmatrix kernel: [10867.368090] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -32
Feb  8 16:37:57 dotmatrix kernel: [10874.126293] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -32
Feb  8 16:38:05 dotmatrix kernel: [10882.314361] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -75
Feb  8 16:38:05 dotmatrix kernel: [10882.318341] usb 1-1.6: clear tt 1 (0150) error -71
Feb  8 16:38:05 dotmatrix kernel: [10882.319290] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -71
Feb  8 16:38:05 dotmatrix kernel: [10882.322411] generic-usb 0003:04D9:A09F.0009: can't reset device, 0000:00:1a.0-1.6.1/input0, status -71
Feb  8 16:38:05 dotmatrix kernel: [10882.323327] usb 1-1.6: clear tt 1 (00a0) error -71
Feb  8 16:38:05 dotmatrix kernel: [10882.327443] generic-usb 0003:04D9:0114.0005: can't reset device, 0000:00:1a.0-1.6.4/input0, status -71
Feb  8 16:38:05 dotmatrix kernel: [10882.327450] usb 1-1.6: clear tt 1 (0150) error -71
Feb  8 16:38:05 dotmatrix kernel: [10882.331515] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -71
Feb  8 16:38:05 dotmatrix kernel: [10882.331548] usb 1-1.6: clear tt 1 (00a0) error -71
Feb  8 16:38:05 dotmatrix kernel: [10882.335628] generic-usb 0003:04D9:0114.0006: can't reset device, 0000:00:1a.0-1.6.4/input1, status -71
Feb  8 16:38:05 dotmatrix kernel: [10882.335666] usb 1-1.6: clear tt 1 (0150) error -71
Feb  8 16:38:05 dotmatrix kernel: [10882.339740] generic-usb 0003:04D9:A09F.0009: can't reset device, 0000:00:1a.0-1.6.1/input0, status -71
Feb  8 16:38:05 dotmatrix kernel: [10882.339777] usb 1-1.6: clear tt 1 (00a0) error -71
Feb  8 16:38:05 dotmatrix kernel: [10882.343846] generic-usb 0003:04D9:0114.0008: can't reset device, 0000:00:1a.0-1.6.4/input3, status -71
Feb  8 16:38:05 dotmatrix kernel: [10882.343890] usb 1-1.6: clear tt 1 (0150) error -71
Feb  8 16:38:05 dotmatrix kernel: [10882.347950] generic-usb 0003:04D9:A09F.000A: can't reset device, 0000:00:1a.0-1.6.1/input1, status -71
Feb  8 16:38:05 dotmatrix kernel: [10882.348006] usb 1-1.6: clear tt 1 (00a0) error -71

Eu encontrei outros com a mesma mensagem, mas sempre é sobre um dongle de TV USB. O que acontece com o mesmo fornecedor: o ID do dispositivo como esse hub reverso. Além disso, alguns hubs de 8 portas (isso só tem uma porta) também têm o mesmo fornecedor: ID do dispositivo. Então eu suspeito que este é o ID de um chip de interface USB genérico. lsusbme mostra.

05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

Pergunta é realmente onde posso obter mais informações sobre o que está acontecendo? Como posso ter certeza de que não é uma falha do dispositivo (por exemplo, se a placa-mãe está subutilizando corrente para os dispositivos, eu seria capaz de vê-lo em algum lugar no sistema)?

Por que listam coisas assim generic-usb 0003:0C45:7401.0004? Pelo que posso dizer, significa <driver name> <usb bus>:<vendor id>:<device id>:<usb device in bus>... está correto?

Por que diz o can’t reset device 0000.00que esses zeros significam?

Onde posso encontrar o estado -32, -71, -75, etc significa?

… Algum guia que eu deveria estar lendo? Estou me sentindo extremamente perdida com isso.

gcb
fonte
1
Você olhou aqui ? Pode ser um sinal de um mau controlador USB.
JakeGould
Jake, obrigado também pelo link. Parece que você está certo, isso ajudará imensamente a resolver o problema imediato. E me ensine uma lição para comprar intel, suspiro ...
gcb
Começo por pesquisar / googlar a mensagem de erro exata (sem a data / hora / números aleatórios perto do início). Geralmente aponta para outros com problemas semelhantes, às vezes responde também. Não tenho certeza do que significam os 0000's ou os status (talvez os códigos de retorno / erro de alguma outra coisa / ajudante?)
Xen2050
2
De fato, seria útil ter um link para o significado desses códigos de erro. Procurei por isso, mas até agora não encontrei nenhuma documentação sobre isso ...
bit pirata
1
Sim, o que esses números de erro significam?
not2qubit

Respostas:

2

Códigos de status USB e possíveis razões para eles podem ser encontrados em sua origem do kernel, em arquivo Documentation/usb/error-codes.txt. No Debian Stretch, está contido no pacote linux-doc, que o instala /usr/share/doc/linux-doc-4.9/Documentation/usb/error-codes.txt.gz.

Note que os erros nesse arquivo são dados pelo seu nome (como -71ser EPROTO); para descobrir a correspondência número / nome, você precisa:

grep -w 71 /usr/include/asm-generic/errno*.h

ou por outro caminho:

grep -w EPROTO /usr/include/asm-generic/errno*.h

Certifique-se de que os arquivos include de desenvolvimento estejam presentes no sistema (no Debian, fazendo apt-get install linux-libc-dev, ou você não obterá nenhuma correspondência ...

Matija Nalis
fonte