-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reader disconnects are noisy in journal/logs #110
Comments
I can reproduce the problem.
Since pcscd has been notified by libudev that the reader has been removed then there is no reason to try to talk to the reader again. I will work on a fix. |
Add support of TAG_IFD_DEVICE_REMOVED This tag has been introduced in pcsc-lite version 1.9.5. When the driver receives the tag TAG_IFD_DEVICE_REMOVED it marks the USB device as disconnected and will not try to talk to it any more. So when a USB CCID reader is remove we do not have these errors in the logs any more: 00000000 [140295925790464] ccid_usb.c:871:WriteUSB() write failed (1/22): -4 LIBUSB_ERROR_NO_DEVICE 00000506 [140295934183168] ccid_usb.c:871:WriteUSB() write failed (1/22): -4 LIBUSB_ERROR_NO_DEVICE The first error is because IFDHICCPresence() sends the CCID command PC_to_RDR_GetSlotStatus to know if a card is present. The second error is because IFDHCloseChannel() sends the CCID command PC_to_RDR_IccPowerOff to power off the card. But since the USB device has been removed these 2 CCID commands will fail and log the error. Thanks to Jakub Jelen for the bug report " Reader disconnects are noisy in journal/logs #110 " LudovicRousseau/PCSC#110 See also https://bugzilla.redhat.com/show_bug.cgi?id=2011128
The problem should now be fixed with the git versions of PCSC and CCID. On the original RedHat bug report I see "Every second 2 messages appear in logs, they keep appearing until the daemon is restarted". |
Thank you for having a look into that. I do not have that particular reader and and I was not able to reproduce it with other plugging in and out for several times. So most I can do is asking the original reporter with a scratch build of pcsc-lite and ccid with your fixes. Let me put the builds together. |
OK. We will see what Santiago Gala gets with the updated packages. |
I get the same behaviour. Apparently it is not so much a matter of me unplugging the reader, but of me undocking the laptop, when the reader is in the dock. Undocking kills the USB hubs in a bad way (but this is a separate bug). I will try later both the unplugging of the reader and the undocking with pcscd started in the foreground and logging. |
I also think it is a problem with the dock. What laptop and dock do you use? In your case I would suggest to build pcsc-lite using |
@sgala I need you feedback to understand (and possibly fix) the problem. |
Sorry, I got overwhelmed with work. The situation is:
I'm running packages that were suggested to fix the problem, but the problem is still there (I got a bit lost with the suggestions so I'm not sure if this is what I'm expected to be running):
Tell me specific, concrete actions that are not too time consuming to check the problem and I'll try them. |
|
Laptop is a "P1 Gen 3 (type 20TH, 20TJ ) Laptop (ThinkPad) - Type 20TJ " (according to Lenovo) I sent the files in a separate comment |
Re: the output of udevadm monitor --property:
So I sent also same but suspending/waking up (twice, to get usb enumerated) in next message |
Now, the same process but I: start monitoring, suspend, dock, wakeup, check that usb ports are enumerated, suspend, undock, wakeup, stop monitor -> monitor-suspending.txt |
@sgala your Alcor Micro AU9560 reader is connected on the USB-C port on the dock station? When you dock the laptop the USB-C port (of the dock) is NOT enumerated? Even if you connect a USB device after docking the laptop? Can you generate a new trace:
I would like to compare the events of a "normal" plug/unplug with what you have when you use the dock and suspend/resume. |
This monitor.log trace corresponds to the plugging and unplugging of the reader with the dock already on. This works normally as the hub does not disappear in the middle... :) |
The reader is USB-A, but it is the dock that offers a number of USB-A ports. Not sure how. And no, when I dock the laptop the usb-c or usb-a ports are invisible (hubs 3 and 4 are not there, neither anything in them, in lsubs --tree) until I authorise the dock AND THEN suspend and wake up again. If I set up the BIOS for automated auth of thunderbolt, I still need to unplug AND plug while suspended for the USB-C ports to be seen. I only see in dmesg the "undocked" ACPI event appear, no matter if I dock or undock, I'm thinking about a bug in acpi bios, module or kernel. |
I contacted Lenovo and they said they were working on a similar problem reported by RedHat. I guess that is this issue. As I already proposed in a previous message:
This will not fix the problem with the dock but pcscd should detect when the reader is "removed". |
As I don't use often the reader I opted by disconnecting it from the dock. Now I will connect the reader and disconnect it either to laptop or to dock, but disconnecting the reader with the dock connected I don't have the problem with the log spam and battery drain |
Thanks for the feedback @sgala. |
Thank you for your effort and sorry for the noise, when I started the bug I had not a clear idea about how broken is either the laptop firmware or the dock firmware. I'm leaning towards a laptop firmware / acpi problem. |
Versions
/usr/sbin/pcscd --version
:Platform
Log
We have the following bug reported that the above logs show repetitively when smart card reader is disconnected. This might be the case for disconnecting a reader, undocking a computer or removing a USB token.
The questions would be:
https://bugzilla.redhat.com/show_bug.cgi?id=2011128
The text was updated successfully, but these errors were encountered: