USB 智能卡读卡器连接问题

USB 智能卡读卡器连接问题

我最近开始在一家公司实习,解决智能卡读卡器连接问题。

有问题的阅读器是使用 CCID 驱动程序的 DUAli DE-620,我正在使用 Ubuntu 16.04。在虚拟机版本和实时安装中,USB 层似乎存在问题,导致以下 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

只要设备处于连接状态,它就会一直持续下去。以下命令也不在 dmesg 输出中显示 VID 和 PID

lsusb 
usb-devices

该设备在一体式 OpenSUSE PC 和我的辅助启动 Win10 中工作正常,但在 Ubuntu 16.04 中存在此问题。可以找到解决问题的尝试这里我也尝试过不同的电缆。

USB 层中可能发生的情况会导致此问题,我该如何解决此问题?

编辑:根据评论 lspci -nn 输出如下;

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)

编辑2:将wireshark与usbmon一起使用显示多次尝试尝试获取设备描述符和配置循环,直到集线器断开设备连接

编辑3:pcscd日志如下;

$ 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

编辑:问题是由于最新内核中的 USB 驱动程序造成的,注释 NTP 相关代码修复了该问题。

答案1

注释掉内核中的 NTP 代码解决了该问题,显然由于 Linux 内核 4 中添加的规则,设备陷入了无限循环。*

相关内容