LudovicRousseau / PCSC

pcsc-lite: PC/SC implementation
https://pcsclite.apdu.fr/
Other
266 stars 108 forks source link

LIBUSB_ERROR_NO_DEVICE after reader reset #208

Closed martonbenedek closed 1 week ago

martonbenedek commented 2 months ago

Versions

pcsc v2.3.0 ccid v1.6.1

Platform

Linux Kernel v6.1.28 VIX TECHNOLOGY SECURE READER (USB)

Issue

We have been using pcsc and ccid for a long time and has been working well with Linux Kernel 5.4.31 We recently upgraded to Kernel 6.1.28, pcsc and ccid still working well, however there seems to be an issue when the reader is reset (or power cycled through a USB hub), pcsc will fail to re-detect the reader, logs showing libusb_open failed: LIBUSB_ERROR_NO_DEVICE. This requires a restart of pcscd, then reader is working again. Again, this issue seems only apparent in Linux Kernel 6.1.28, no issue in Kernel 5.4.31.

Log attached

taipan2_log_pcscd230_ccid161.txt

LudovicRousseau commented 2 months ago

What is the output of the command /usr/sbin/pcscd --version?

LudovicRousseau commented 2 months ago

I do not have the "VIX TECHNOLOGY SECURE READER" reader in the list of CCID device. Please follow https://ccid.apdu.fr/#CCID_compliant

martonbenedek commented 1 month ago

/usr/sbin/pcscd --version

pcsc-lite version 2.2.0 Copyright (C) 1999-2002 by David Corcoran corcoran@musclecard.com. Copyright (C) 2001-2024 by Ludovic Rousseau ludovic.rousseau@free.fr. Copyright (C) 2003-2004 by Damien Sauveron sauveron@labri.fr. Report bugs to pcsclite-muscle@lists.infradead.org. Enabled features: Linux arm-ostl-linux-gnueabi usb libusb usbdropdir=/usr/lib/pcsc/drivers ipcdir=/run/pcscd filter configdir=/usr/etc/reader.conf.d MAX_READERNAME: 128, PCSCLITE_MAX_READERS_CONTEXTS: 16

We have added our reader (https://vixtechnology.com/products/devices) to the ccid package, see attached output of parse. output.log

LudovicRousseau commented 1 month ago

Try building pcsc-lite with libudev instead of libusb.

Another idea is to enable DEBUG_HOTPLUG in src/hotplug_libusb.c to get more logs.

LudovicRousseau commented 3 weeks ago

Any news?

martonbenedek commented 1 week ago

Our platform is busybox based, so no libudev, but we implemented a workaround to restart the pcsc daemon when the reader is re-detected on the USB bus.

LudovicRousseau commented 1 week ago

So problem fixed on your side. Closing