Problemas de conexão do leitor de smart card USB

0

Recentemente, comecei a trabalhar em um problema de conexão de leitor de cartão inteligente em uma empresa na qual estou trabalhando como estagiário.

O leitor em questão é um DUAli DE-620 usando o driver CCID, e eu estou trabalhando com o Ubuntu 16.04. Ambos em uma versão vm e um live na instalação, parece haver um problema na camada USB resultando na seguinte saída dmesg;

[ 5840.680206] usb 3-2: new full-speed USB device number 73 using xhci_hcd
[ 5840.829516] usb 3-2: New USB device found, idVendor=1db2, idProduct=0630
[ 5840.829521] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5840.829524] usb 3-2: Product: DE-620
[ 5840.829526] usb 3-2: Manufacturer: DUALi
[ 5840.829529] usb 3-2: SerialNumber: B71468D80508
[ 5840.852392] usb 3-2: USB disconnect, device number 73
[ 5841.456266] usb 3-2: new full-speed USB device number 74 using xhci_hcd
[ 6352.804091] usb 3-2: new full-speed USB device number 75 using xhci_hcd
[ 6352.953382] usb 3-2: New USB device found, idVendor=1db2, idProduct=0630
[ 6352.953387] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6352.953390] usb 3-2: Product: DE-620
[ 6352.953393] usb 3-2: Manufacturer: DUALi
[ 6352.953395] usb 3-2: SerialNumber: B71468D80508
[ 6352.977508] usb 3-2: USB disconnect, device number 75
[ 6353.580077] usb 3-2: new full-speed USB device number 76 using xhci_hcd
[ 6353.729268] usb 3-2: New USB device found, idVendor=1db2, idProduct=0630
[ 6353.729273] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6353.729276] usb 3-2: Product: DE-620
[ 6353.729279] usb 3-2: Manufacturer: DUALi
[ 6353.729291] usb 3-2: SerialNumber: B71468D80508
[ 6353.750710] usb 3-2: USB disconnect, device number 76
[ 6354.352054] usb 3-2: new full-speed USB device number 77 using xhci_hcd
[ 6354.501314] usb 3-2: New USB device found, idVendor=1db2, idProduct=0630
[ 6354.501319] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6354.501322] usb 3-2: Product: DE-620
[ 6354.501325] usb 3-2: Manufacturer: DUALi
[ 6354.501328] usb 3-2: SerialNumber: B71468D80508
[ 6354.524734] usb 3-2: USB disconnect, device number 77
[ 6355.128030] usb 3-2: new full-speed USB device number 78 using xhci_hcd
[ 6355.277316] usb 3-2: New USB device found, idVendor=1db2, idProduct=0630
[ 6355.277321] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6355.277324] usb 3-2: Product: DE-620
[ 6355.277326] usb 3-2: Manufacturer: DUALi
[ 6355.277329] usb 3-2: SerialNumber: B71468D80508
[ 6355.300066] usb 3-2: USB disconnect, device number 78
[ 6355.904009] usb 3-2: new full-speed USB device number 79 using xhci_hcd
[ 6356.053320] usb 3-2: New USB device found, idVendor=1db2, idProduct=0630
[ 6356.053326] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6356.053329] usb 3-2: Product: DE-620
[ 6356.053331] usb 3-2: Manufacturer: DUALi
[ 6356.053334] usb 3-2: SerialNumber: B71468D80508
[ 6356.076448] usb 3-2: USB disconnect, device number 79
[ 6356.679934] usb 3-2: new full-speed USB device number 80 using xhci_hcd

e continua enquanto o dispositivo estiver conectado. Os comandos a seguir também não mostram o VID e o PID na saída dmesg

lsusb 
usb-devices

O dispositivo em questão funciona bem em um OpenSUSE PC completo e no meu boot secundário Win10, mas tem esse problema no Ubuntu 16.04. Tentativas de resolver o problema podem ser encontradas aqui e também testei uma cabo diferente também.

O que pode estar acontecendo na camada USB que pode causar isso e o que devo fazer para corrigir isso?

EDIT: Como por comentários, a saída lspci -nn é a seguinte:

00:00.0 Host bridge [0600]: Intel Corporation 3rd Gen Core processor DRAM Controller [8086:0154] (rev 09)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port [8086:0151] (rev 09)
00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09)
00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)
00:16.0 Communication controller [0780]: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 [8086:1e3a] (rev 04)
00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)
00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)
00:1c.0 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 [8086:1e10] (rev c4)
00:1c.1 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 [8086:1e12] (rev c4)
00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)
00:1f.0 ISA bridge [0601]: Intel Corporation HM77 Express Chipset LPC Controller [8086:1e57] (rev 04)
00:1f.2 SATA controller [0106]: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] [8086:1e03] (rev 04)
00:1f.3 SMBus [0c05]: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller [8086:1e22] (rev 04)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107M [GeForce GT 640M] [10de:0fd2] (rev a1)
02:00.0 Ethernet controller [0200]: Broadcom Corporation NetLink BCM57785 Gigabit Ethernet PCIe [14e4:16b5] (rev 10)
02:00.1 SD Host controller [0805]: Broadcom Corporation BCM57765/57785 SDXC/MMC Card Reader [14e4:16bc] (rev 10)
02:00.2 System peripheral [0880]: Broadcom Corporation BCM57765/57785 MS Card Reader [14e4:16be] (rev 10)
02:00.3 System peripheral [0880]: Broadcom Corporation BCM57765/57785 xD-Picture Card Reader [14e4:16bf] (rev 10)
03:00.0 Network controller [0280]: Qualcomm Atheros AR9462 Wireless Network Adapter [168c:0034] (rev 01)

EDIT 2: o uso do wireshark com usbmon mostrou várias tentativas de tentar obter os descritores e configurações do dispositivo em loop até que o hub desconecte o dispositivo

EDIT 3: o log pcscd é o seguinte:

$ sudo LIBCCID_ifdLogLevel=0x000F pcscd --foreground --debug --apdu --color | tee log.txt
[sudo] password for g: 
00000000 debuglog.c:291:DebugLogSetLevel() debug level=debug
00000116 debuglog.c:312:DebugLogSetCategory() Debug options: APDU
00000015 pcscdaemon.c:268:main() Force colored logs
00000052 utils.c:84:GetDaemonPid() Can't open /var/run/pcscd/pcscd.pid: No such file or directory
00000092 configfile.l:283:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00000040 configfile.l:317:DBGetReaderListDir() Skipping non regular file: ..
00000027 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00000063 configfile.l:317:DBGetReaderListDir() Skipping non regular file: .
00000008 pcscdaemon.c:569:main() pcsc-lite 1.8.14 daemon ready.
00034133 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/003/001
00000144 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0003, path: /dev/bus/usb/004/001
00000143 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000109 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000113 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0024, path: /dev/bus/usb/001/002
00000117 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0489, PID: 0xE04E, path: /dev/bus/usb/001/003
00000106 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0489, PID: 0xE04E, path: /dev/bus/usb/001/003
00000075 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0024, path: /dev/bus/usb/001/002
00000080 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x04F2, PID: 0xB374, path: /dev/bus/usb/001/004
00000079 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x04F2, PID: 0xB374, path: /dev/bus/usb/001/004
00000075 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0024, path: /dev/bus/usb/001/002
00000106 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000071 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000076 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0024, path: /dev/bus/usb/002/002
00000081 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x045E, PID: 0x0752, path: /dev/bus/usb/002/003
00000075 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0024, path: /dev/bus/usb/002/002
00000080 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x046D, PID: 0xC534, path: /dev/bus/usb/002/004
00000079 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x046D, PID: 0xC534, path: /dev/bus/usb/002/004
00000075 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0024, path: /dev/bus/usb/002/002
21798580 hotplug_libudev.c:623:HPEstablishUSBNotifications() USB Device add
00000327 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1DB2, PID: 0x0630, path: /dev/bus/usb/002/124
00001155 hotplug_libudev.c:617:HPEstablishUSBNotifications() USB Device removed
01029546 hotplug_libudev.c:623:HPEstablishUSBNotifications() USB Device add
00000371 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1DB2, PID: 0x0630, path: /dev/bus/usb/002/125
00001006 hotplug_libudev.c:617:HPEstablishUSBNotifications() USB Device removed
01032328 hotplug_libudev.c:623:HPEstablishUSBNotifications() USB Device add
00000627 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1DB2, PID: 0x0630, path: /dev/bus/usb/002/126
00001079 hotplug_libudev.c:617:HPEstablishUSBNotifications() USB Device removed
01030744 hotplug_libudev.c:623:HPEstablishUSBNotifications() USB Device add
00000763 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1DB2, PID: 0x0630, path: /dev/bus/usb/002/127
00000925 hotplug_libudev.c:617:HPEstablishUSBNotifications() USB Device removed
01025636 hotplug_libudev.c:623:HPEstablishUSBNotifications() USB Device add
00000639 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1DB2, PID: 0x0630, path: /dev/bus/usb/002/005
00001115 hotplug_libudev.c:617:HPEstablishUSBNotifications() USB Device removed
01030189 hotplug_libudev.c:623:HPEstablishUSBNotifications() USB Device add
00000566 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1DB2, PID: 0x0630, path: /dev/bus/usb/002/006
00001229 hotplug_libudev.c:617:HPEstablishUSBNotifications() USB Device removed
01030823 hotplug_libudev.c:623:HPEstablishUSBNotifications() USB Device add
00000565 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1DB2, PID: 0x0630, path: /dev/bus/usb/002/007
00001138 hotplug_libudev.c:617:HPEstablishUSBNotifications() USB Device removed
01031152 hotplug_libudev.c:623:HPEstablishUSBNotifications() USB Device add
00000403 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0024, path: /dev/bus/usb/002/002
00001134 hotplug_libudev.c:617:HPEstablishUSBNotifications() USB Device removed

EDIT: O problema foi devido aos drivers USB no kernel mais recente, comentando o código relevante do NTP corrigido o problema.

    
por Yusuf Gürkan Bor 19.09.2018 / 12:59

1 resposta

0

Comentar o código NTP no kernel consertou o problema, aparentemente o dispositivo entrou em um loop infinito por causa das regras adicionadas no kernel Linux 4. *

    
por 04.10.2018 / 08:00