Bug 146979 - acr38u driver cannot be loaded by pcscd
Summary: acr38u driver cannot be loaded by pcscd
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Beta 2
Hardware: x86 Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Marian Jancar
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-31 16:18 UTC by jo de baer
Modified: 2006-03-24 18:45 UTC (History)
4 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
pcscd -f -d as root (2.40 KB, text/plain)
2006-02-02 11:04 UTC, jo de baer
Details
pcscd -f -d as user (470 bytes, text/plain)
2006-02-02 11:05 UTC, jo de baer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jo de baer 2006-01-31 16:18:31 UTC
When pluggin in the acr38u :
linux:~ # pcscd -f -d
pcscdaemon.c:258:main() pcscd set to foreground with debug send to stderr
debuglog.c:207:DebugLogSetLevel() debug level=debug
pcscdaemon.c:463:main() pcsc-lite 1.2.9-beta9 daemon ready.
hotplug_libusb.c:404:HPAddHotPluggable() Adding USB device: 001:002
readerfactory.c:1097:RFInitializeReader() Attempting startup of ACS ACR38U 00 00
.
readerfactory.c:939:RFBindFunctions() Loading IFD Handler 2.0
readerfactory.c:1132:RFInitializeReader() Open Port 200000 Failed (usb:072f/9000
:libusb:001:002)
readerfactory.c:1014:RFUnloadReader() Unloading reader driver.
readerfactory.c:250:RFAddReader() ACS ACR38U init failed.
pcscdaemon.c:528:signal_trap() Preparing for suicide
hotplug_libusb.c:358:HPEstablishUSBNotifications() Hotplug stopped
readerfactory.c:1352:RFCleanupReaders() entering cleaning function
pcscdaemon.c:488:at_exit() cleaning /var/run
Comment 1 jo de baer 2006-02-01 11:57:24 UTC
Sorry Marian misssed the mail that documented your assignment!
Comment 2 Edward Cheung 2006-02-02 03:53:41 UTC
Hi all,
I tested pcsclite-1.2.9-beta9 with ACR38U driver and get 2 results.
Result 1.
I started pcscd using root account, then I connect the reader to PC and things are OK.

Result 2.
I started pcscd using normal user account, then I connect the reader to PC and get exactly the same error as the description above.

I guess if the problem can be related to some uid access right related issue. I can't provide in-depth information at the moment since I am not familiar with pcscd implementation.
Comment 3 Bart Symons 2006-02-02 09:32:05 UTC
Just a suggestion: have you tried this with another reader, e.g. the ACR38U CCID or another brand of reader? This might help pinpoint the problem in either pcscd or the driver.

Comment 4 jo de baer 2006-02-02 11:04:06 UTC
Hi Edward, Bart,

I am not able to start pcscd -f -d as a user, as illustrated in asuser.txt (attached). However, when pcscd -f -d is started as root, the CCID driver loads, while the "standard" one does not, so that might give you guys an idea yes. The result of that test is in asroot.txt (attached).
Comment 5 jo de baer 2006-02-02 11:04:52 UTC
Created attachment 66160 [details]
pcscd -f -d as root
Comment 6 jo de baer 2006-02-02 11:05:20 UTC
Created attachment 66161 [details]
pcscd -f -d as user
Comment 7 Bart Symons 2006-02-02 11:09:50 UTC
32 vs 64 bit architecture ...

Jo,
Is the test system hardware a 32-bit or 64-bit architecture?
Are you using the 32-bit or 64-bit version of the software?

Comment 8 jo de baer 2006-02-02 11:14:10 UTC
Hi - 32-bit (don't have 64-bitter here :-/ )
Comment 9 Edward Cheung 2006-02-03 02:31:11 UTC
Hi Jo,
I installed a copy of pcsclite under my normal user account to start that copy of pcscd -d -f to test with.
I configure the package using the following command.
./configure --prefix=/home/edward/local_host --enable-usbdropdir=/home/edward/local_host/pcsc/drivers --enable-ipcdir=/home/edward/local_host/var
According to your attachment, it is absence of write access to /var folder for normal user account that makes pcscd unable to start under non-root account.
Comment 10 Edward Cheung 2006-02-03 02:32:20 UTC
Hi Jo,
I installed a copy of pcsclite under my normal user account to start that copy of pcscd -d -f to test with.
I configure the package using the following command.
./configure --prefix=/home/edward/local_host --enable-usbdropdir=/home/edward/local_host/pcsc/drivers --enable-ipcdir=/home/edward/local_host/var
According to your attachment, it is absence of write access to /var folder for normal user account that makes pcscd unable to start under non-root account.
Comment 11 jo de baer 2006-02-03 11:10:41 UTC
Hi Edward. Since running pcscd like that will not be possible out "of the box" on 10.1 and it did not work as user anyway for you - I'll just try to see if compiling 1.2.9-beta9 and using that one (as root) makes a difference. Also downloading beta3 right now to test on that. I'll compile without special options, unless you instruct me otherwise.
Comment 12 jo de baer 2006-02-03 11:13:58 UTC
Come to think of it :

10.0 has pcsc-lite-1.2.9-13
10.1 has pcsc-lite-1.2.9_beta9-2

The naming might just confuse me but this seems like a "downgrade" ?
Comment 13 jo de baer 2006-02-03 11:46:39 UTC
I have just downloaded and compiled pcsc-lite-1.2.9-beta9, but if gives the same error when I insert the card reader ... Edward, did you test on a SuSE Linux system or another brand of Linux? What exact version of pcsc-lite did you compile? Thanks !! Jo
Comment 14 jo de baer 2006-02-03 16:01:54 UTC
same problem on beta3 ... :-/
Comment 15 jo de baer 2006-02-03 16:06:47 UTC
http://anholt.livejournal.com/28574.html
don't know if that has something to do with it but it does look like the problem I have here ...
Comment 16 jo de baer 2006-02-03 16:12:00 UTC
ignore the last one - wrong bug ... *tilt*
Comment 17 Edward Cheung 2006-02-04 02:14:02 UTC
Hi Jo,

I tested on SuSE 10.0.
I will download SuSE 10.1 beta3 and try again.
Comment 18 jo de baer 2006-02-04 13:22:16 UTC
I have a system up and running and accessible from the internet during the weekend. Call me anyone if you want to log in to it. The system is 10.1 beta3, has the rpms installed and also has pcsc 1.2.9 compiled in /usr/local. My number is 0032478569480.
Comment 19 Edward Cheung 2006-02-06 11:13:27 UTC
Hi Jo,

Thanks!
But I have downloaded SuSE 10.1 B3 over the weekend anyway.
With the 10.1 B3 system, I found the problem is related to loading of usbfs in /etc/fstab.
I looked into the /proc/bus/usb and see nothing inside (I guess this is the reason for "Open Port 20000 Failed" error). Then I did a manual mount using:
mount -t usbfs none /proc/bus/usb.
I checked /proc/bus/usb again and found some folders inside this folder and pcscd started working.

Then I checked the fstab under /etc and changed the following line.
usbfs     /proc/bus/usb         usbfs       noauto          0 0
to
usbfs     /proc/bus/usb         usbfs       defaults        0 0

Reboot and pcscd works.
Comment 20 Marian Jancar 2006-02-06 18:07:07 UTC
The initscript now mounts /proc/bus/usb if /proc/bus/usb/devices doesn't exist.
Comment 21 Andreas Jaeger 2006-02-06 19:34:47 UTC
That interface is obsolete and should not get used anymore.

Why is the program still using /proc/bus/usb ?
Comment 22 Marian Jancar 2006-02-06 19:42:06 UTC
It is a userspace usb driver, it requires the usbfs, not the /proc/bus/usb/devices.
Comment 23 Ruediger Oertel 2006-02-06 22:19:13 UTC
I think the method in the kbd startscript shows that there might
not even be usbcore loaded at that point:
        test -d /proc/bus/usb || modprobe usbcore >/dev/null 2>&1
        mount -n -t usbfs usbfs /proc/bus/usb >/dev/null 2>&1

maybe you could just add "kbd" to "Should-Start" to have pcscd start
a bit later.

Comment 24 Marian Jancar 2006-02-07 08:49:23 UTC
ok, fixed, please test
Comment 25 jo de baer 2006-02-07 09:17:09 UTC
can I download an updated rpm or do I wati for beta4 ? Tx M!
Comment 26 Marian Jancar 2006-02-07 11:18:29 UTC
I will send you the rpm.
Comment 27 jo de baer 2006-02-07 22:35:24 UTC
Hi all - I still had the problem om NLD10 beta3. Changing the fstab as suggested earlier fixed it. Below what I did :

linux:~/eID # pcscd -d -f
pcscdaemon.c:258:main() pcscd set to foreground with debug send to stderr
pcscdaemon.c:463:main() pcsc-lite 1.2.9-beta9 daemon ready.
hotplug_libusb.c:404:HPAddHotPluggable() Adding USB device: 002:002
readerfactory.c:1097:RFInitializeReader() Attempting startup of ACS ACR38U  00 00.
readerfactory.c:939:RFBindFunctions() Loading IFD Handler 2.0
readerfactory.c:1132:RFInitializeReader() Open Port 200000 Failed (usb:072 f/9000:libusb:002:002)
readerfactory.c:1014:RFUnloadReader() Unloading reader driver.
readerfactory.c:250:RFAddReader() ACS ACR38U init failed.
pcscdaemon.c:528:signal_trap() Preparing for suicide
hotplug_libusb.c:358:HPEstablishUSBNotifications() Hotplug stopped
readerfactory.c:1352:RFCleanupReaders() entering cleaning function
pcscdaemon.c:488:at_exit() cleaning /var/run

linux:~/eID # rpm -qa | grep pcsc
pcsc-acr38-100705_P-2
pcsc-lite-1.2.9_beta9-3

linux:~/eID # rpm -qa | grep -i eid
eID-belgium-2.52-2

linux:~/eID # mount
/dev/hda8 on / type reiserfs (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda7 on /boot type ext3 (rw,acl,user_xattr)
securityfs on /sys/kernel/security type securityfs (rw)
/dev/hda1 on /media/disk type reiserfs (rw,noexec,nosuid,nodev)
/dev/hda5 on /media/disk-1 type reiserfs (rw,noexec,nosuid,nodev)
/dev/hda6 on /media/disk-2 type ext3 (rw,noexec,nosuid,nodev)
/dev/hda5 on /mnt type reiserfs (rw)
/dev/hda1 on /mnt2 type reiserfs (rw)

<here I change the line in fstab>

linux:~/eID # reboot

<reboot>

linux:~ # pcscd -d -f
pcscdaemon.c:258:main() pcscd set to foreground with debug send to stderr
pcscdaemon.c:463:main() pcsc-lite 1.2.9-beta9 daemon ready.
hotplug_libusb.c:404:HPAddHotPluggable() Adding USB device: 002:003
readerfactory.c:1097:RFInitializeReader() Attempting startup of ACS ACR38U 00 00.
readerfactory.c:939:RFBindFunctions() Loading IFD Handler 2.0
Comment 28 jo de baer 2006-03-07 13:04:51 UTC
Hi - reopening this bug : tested on beta6 and I still need to modify the /etc/fstab and remount before the driver gets loaded. Is this on our side or does the driver nog behave as expected?
Comment 29 Marian Jancar 2006-03-08 14:05:03 UTC
It seems that the /proc/bus/usb is not mounted in the kbd, is it intentional?
Comment 30 Juergen Weigert 2006-03-08 14:32:33 UTC
kbd scripts try to be independant of the usb subsystem. 
wouldn't the 'shouldstart' as suggested in comment 23 be sufficient?
Comment 31 Marian Jancar 2006-03-08 15:12:23 UTC
it is there, the problem seems that the /proc/bus/usb is still not mounted, it is required by the acr38u driver
Comment 32 Marian Jancar 2006-03-08 17:53:01 UTC
to rephrase my sentence: The shouldstart is used, so the pcsc-lite is started after kbd, but kbd apparently doesn't mount the /proc/bus/usb.
Comment 33 Marian Jancar 2006-03-24 18:45:27 UTC
fixed