Skip to content

Commit

Permalink
Disable USB-persist for CCID devices
Browse files Browse the repository at this point in the history
The Linux kernel tries to keep the USB connection during suspend/resume
cycles. This is a bad idea if the reader/token is unpluged while the
computer is suspended.
More documentation is available at
https://docs.kernel.org/driver-api/usb/persist.html

If a CCID reader (including a composite one) is disconnected and
reconnected while the computer is suspended then the USB device will be
considered removed and connected again.
PC/SC applications will have to reconnect.

Closes: LudovicRousseau/PCSC#154
"USB resets leave the reader connection in a broken state #154"
  • Loading branch information
LudovicRousseau committed Apr 22, 2023
1 parent 93bf19d commit 6f51f8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/92_pcscd_ccid.rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ ENV{DEVTYPE}!="usb_device", GOTO="pcscd_ccid_rules_end"
# Kobil mIDentity
ATTRS{idVendor}=="0d46", ATTRS{idProduct}=="4081", RUN+="/usr/sbin/Kobil_mIDentity_switch"

# disable USB-persist for CCID devices (including composite ones)
# https://docs.kernel.org/driver-api/usb/persist.html
ENV{ID_USB_INTERFACES}=="*:0b0000:*", TEST=="power/persist", ATTR{power/persist}="0"

# Keep USB autosuspend off for the C3PO LTC31 v1 SmartCard Reader
ATTR{idVendor}=="0783", ATTR{idProduct}=="0003", GOTO="pcscd_ccid_rules_end"

Expand Down

0 comments on commit 6f51f8f

Please sign in to comment.