Alcor Micro AU9540 keeps powering down when card is present

Bug #1307109 reported by Jonathan Davies on 2014-04-13
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
pcsc-lite (Ubuntu)
High
Unassigned

Bug Description

I have smart card reader built-into this laptop, however, whenever I insert a card - it'll read it for a few seconds, then the USB connection to the reader gets powered down and thus the card disappears in the systems eyes.

After a few seconds, it comes back and everything's happy.

Then the cycle repeats again and again and again.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: linux-image-3.13.0-23-generic 3.13.0-23.45 [modified: boot/vmlinuz-3.13.0-23-generic]
ProcVersionSignature: Ubuntu 3.13.0-23.45-generic 3.13.8
Uname: Linux 3.13.0-23-generic x86_64
ApportVersion: 2.14.1-0ubuntu1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: jpds 3933 F.... pulseaudio
 /dev/snd/controlC0: jpds 3933 F.... pulseaudio
CurrentDesktop: Unity
Date: Sun Apr 6 18:37:24 2014
HibernationDevice: RESUME=UUID=05490d4c-6800-46a1-b5ba-8b32bdc57e89
InstallationDate: Installed on 2014-04-06 (0 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Daily amd64 (20140406)
MachineType: Hewlett-Packard HP EliteBook Folio 1040 G1
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.13.0-23-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-3.13.0-23-generic N/A
 linux-backports-modules-3.13.0-23-generic N/A
 linux-firmware 1.127
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 02/09/2014
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: L83 Ver. 01.05
dmi.board.name: 213E
dmi.board.vendor: Hewlett-Packard
dmi.board.version: KBC Version 24.2A
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.modalias: dmi:bvnHewlett-Packard:bvrL83Ver.01.05:bd02/09/2014:svnHewlett-Packard:pnHPEliteBookFolio1040G1:pvrA3009DD18303:rvnHewlett-Packard:rn213E:rvrKBCVersion24.2A:cvnHewlett-Packard:ct10:cvr:
dmi.product.name: HP EliteBook Folio 1040 G1
dmi.product.version: A3009DD18303
dmi.sys.vendor: Hewlett-Packard

Jonathan Davies (jpds) wrote :
Jonathan Davies (jpds) wrote :
description: updated
description: updated

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Jonathan Davies (jpds) on 2014-04-14
summary: - Alcor Micro AU9540 keeps powering down when card is inserted
+ Alcor Micro AU9540 keeps powering down when card is present
Jonathan Davies (jpds) wrote :
Chris J Arges (arges) wrote :

The dmesg corresponding to device removal and power on was related to a BIOS option that does "Power on if card is present" vs "Always powered on". If the BIOS option is switched to "Always powered on" these messages are not present.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pcsc-lite (Ubuntu):
status: New → Confirmed
Jonathan Davies (jpds) wrote :

I ran 'opensc-tool' three times while running this debug.

Chris J Arges (arges) wrote :

For context I found the following thread which looked related:
http://ludovicrousseau.blogspot.fr/2010/10/card-auto-power-on-and-off.html

From bug 1161882. So I built the following packages with DISABLE_ON_DEMAND_POWER_ON defined:
http://people.canonical.com/~arges/lp1307404/

This also failed.

Jonathan Davies (jpds) wrote :

I ran 'opensc-tool' three times during this debug run. First two times, it reported that there was a card in the system; third 'No'.

Jonathan Davies (jpds) wrote :
Chris J Arges (arges) on 2014-04-14
Changed in pcsc-lite (Ubuntu):
importance: Undecided → High
Chris J Arges (arges) wrote :

An example of a non-working log:
http://pastebin.ubuntu.com/7250315/

An example of a working log:
http://pastebin.ubuntu.com/7250304/

The main differences I see start after here in the log:
00000003 winscard.c:261:SCardConnect() Attempting Connect to Alcor Micro AU9540 00 00 using protocol: 3
00000002 readerfactory.c:771:RFReaderInfo() RefReader() count was: 1

Why does powering down a present card is a problem?

A problem would be if the reader reports no card inserted when a card is inserted. Is that what happens?

Jonathan Davies (jpds) wrote :

Ludovic: That is exactly what happens. I'm not touching the card and as shown in comment #3, it keeps appearing and disappearing.

Please generates a pcscd log as in #2 but without starting any application. Just insert a smart card and wait.

Jonathan Davies (jpds) wrote :

That output above is what happens without touching the card or running an application - it just sits there with Card present, as soon as I do something like 'opensc-tool -l' - the card is "absent" and then it eventually loops back to present.

The readers report card present and then card absent. The driver can't do much to know this is not correct and must trust the reader.

I will try to find a Alcor Micro AU9540 reader and to tests. But it looks like it is a reader bug.

Jonathan Davies (jpds) wrote :

It comes built-into the HP EliteBook Folio 1040 G1, otherwise, I'm happy to do any tests on my laptop.

Changed in linux (Ubuntu):
importance: Undecided → High
tags: added: kernel-da-key

Maybe you can find a reader firmware update from Alcor Micro or HP.

Jonathan Davies (jpds) wrote :

This is a brand new laptop and HP appear to have shipped it with their latest firmware.

Jonathan Davies (jpds) wrote :
Jonathan Davies (jpds) wrote :
Jonathan Davies (jpds) wrote :
Jonathan Davies (jpds) wrote :

OK, in comments #22 and #23, we have outputs with ccid compiled with the patch to add some more debug in #24.

Comment #22 features a working Lenovo laptop.

Comment #23 features the HP laptop.

For some reason, the HP laptop hits the IFDHICCPresence() function's CCID_ICC_PRESENT_INACTIVE case and drops to the else statement, while this doesn't happen on the Lenovo.

What is strange is the response RDR_to_PC_SlotStatus (first byte 81h) when a card is present and powered.
The normal CCID frame should be:
81 00 00 00 00 00 xx _00_ 00 00
00 is: An ICC is present and active (power is on and stable, RST is inactive)

But in the case of the HP we have:
81 00 00 00 00 00 xx _01_ 00 01
01 is: An ICC is present and inactive (not activated or shut down by hardware error)
The last 01 is: Clock stopped in state L

Something (the reader? the BIOS?) decided to stop the reader clock.

I need more information about your Alcor Micro reader.
Please follow http://pcsclite.alioth.debian.org/ccid.html#CCID_compliant

Jonathan Davies (jpds) wrote :
Jonathan Davies (jpds) on 2014-04-17
description: updated

Your reader firmware is newer than the one I have at http://pcsclite.alioth.debian.org/ccid/readers/AU9540.txt

I confirm the reader firmware is bogus according to the output.txt you attached in #27.
  bNumDataRatesSupported: 138
   IFD does not support GET_DATA_RATES request: Resource temporarily unavailable

You should get a list of 138 values, not an error.

Chris J Arges (arges) wrote :

So I see that get_data_rates is returning an error, are there alternative Control USB bytes we need to send? Or do we think this failure is because of something else (reader clock being stopped.)

It may be possible to make the driver work with this reader.
I am not sure how to come back from the state "An ICC is present and inactive". Without such a reader at hand it will be hard to debug the driver.
Maybe you can offer me a "Hewlett-Packard HP EliteBook Folio 1040 G1"? :-)

Kip Warner (kip) on 2014-05-01
Changed in linux (Ubuntu):
assignee: nobody → Kip Warner (kip)
Changed in pcsc-lite (Ubuntu):
assignee: nobody → Kip Warner (kip)
Chris J Arges (arges) on 2014-06-13
no longer affects: linux (Ubuntu)
Dave Chiluk (chiluk) on 2014-09-09
Changed in pcsc-lite (Ubuntu):
assignee: Kip Warner (kip) → Dariusz Gadomski (dgadomski)
assignee: Dariusz Gadomski (dgadomski) → nobody
Chris McDonough (chrism-plope) wrote :

I have the same problem, using pcscd 1.8.14-1ubuntu1.16.04.1 on an IBM Thinkpad P50, which has the same card reader.

However, interestingly, it only happens when I use a Feitian/Entersafe A22CR card. I tried two of them with the same result, so it's not a flaky card either.

When I use a PIVKey C910 card, it does not "flap" like it does with the entersafe card. The PIVKey card works fine in the reader.

Chris McDonough (chrism-plope) wrote :

I'll also note that the A22CR card works fine (does not exhibit the flapping behavior) in an external Feitian reader.

Interestingly, the A22CR card + Alcor combibation doesn't "flap" under Windows either when running opensc-tool in a loop. Just under Linux.

Chris McDonough (chrism-plope) wrote :

Similar output of ccid conformance as James' from a few years back.

Chris McDonough (chrism-plope) wrote :

Another data point: an Aventra MyEID PKI card (http://www.aventra.fi/webshop/index.php?route=product/product&product_id=53 ; it's apparently a "version 4", on the invoice it's identified as SKU: MYEID and MPN: TH#130) works fine in this Alcor reader under OpenSC on Ubuntu. The only card that has this flapping problem with this reader under Linux so far is the Feitian/Entersafe A22CR, and again, the A22CR+Alcor combo doesn't flap the same way under Windows.

To post a comment you must log in.