USB 스마트 카드 리더 연결 문제

USB 스마트 카드 리더 연결 문제

저는 최근 스마트 카드 리더 연결 문제를 해결하는 회사에서 인턴을 시작했습니다.

문제의 독자는 CCID 드라이버를 사용하는 DUAli DE-620이며 Ubuntu 16.04를 사용하고 있습니다. VM 버전과 라이브 설치 모두에서 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: usbmon과 함께 Wireshark를 사용하면 허브가 장치 연결을 끊을 때까지 장치 설명자를 가져오고 루프를 구성하려는 여러 시도가 표시됩니다.

편집 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에 추가된 규칙으로 인해 장치가 무한 루프에 걸린 것 같습니다. *

관련 정보