Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email email@example.com
From: Todd Denniston (Todd.Dennistonssa.crane.navy.mil)
Date: Thu Feb 14 2008 - 12:03:46 CST
Ludovic Rousseau wrote, On 02/14/2008 11:27 AM:
> Up to now pcscd is polling the card driver every 400ms
> (PCSCLITE_STATUS_POLL_RATE) to detect a card movement. This will wake
> up the CPU constantly and consume power.
> Many CCID readers (but not all) can use an asynchronous message to
> send a card movement event to the host. This is supported in the CCID
> driver  version 1.3.3 with support of TAG_IFD_POLLING_THREAD.
> You need to use a snapshot of pcsc-lite  to use this feature.
> My problem is that the libusb function usb_interrupt_read() is not
> efficient and will poll using a 1ms timeout.
> So instead of a polling every 400ms by pcscd we have a polling every
> 1ms by libusb. The situation is worse regarding CPU usage :-(
> The problem in libusb has been discovered thanks to powertop  and
> be corrected in the subversion revision 657  of
> /trunk/libusb/linux.c . I backported the patch (attached) for
> libusb 0.1.12.
> But I have no idea when a new stable version of libusb (with the
> correction) will be available.
> So what should I do?
> I plan to disable TAG_IFD_POLLING_THREAD in the CCID driver by default
> and allow a way to activate it using the driver Info.plist file.
> Other ideas? proposals? comments?
A) in ./configure test for a libusb/OpenUSB version that you know does/will
have the fix, and then disable TAG_IFD_POLLING_THREAD if that version is found
and the person configuring has not given an option to force
B) in ./configure test for current and older libusb/OpenUSB versions that you
know do not have the fix, and then enable TAG_IFD_POLLING_THREAD unless the
person configuring has given an option to force no TAG_IFD_POLLING_THREAD.
Both of which are hoping that when ever a new version of either come out they
will have the fix.
C) in ./configure test for current and older libusb/OpenUSB versions that you
know do not have the fix, if there is a newer version found drop a note to to
the user indicating that if the polling issue was fixed in the libusb they are
using they may wish to give a configure option to force no
TAG_IFD_POLLING_THREAD. And when you know a fixed version is out, you update
the configure script next ccid release to test and do (A) appropriately.
> libusb 0.1.x will not evolve much. libusb 1.0  is on its way and is
> in competition with OpenUSB . libusb 1.0 or OpenUSB have no stable
> release yet.
>  http://pcsclite.alioth.debian.org/ccid.html
>  http://ludovic.rousseau.free.fr/softwares/pcsc-lite/
>  http://www.lesswatts.org/projects/powertop/
>  http://libusb.svn.sourceforge.net/viewvc/libusb/trunk/libusb/linux.c?r1=597&r2=657
>  http://libusb.svn.sourceforge.net/viewvc/libusb/trunk/libusb/linux.c?view=log
> |6] http://libusb.wiki.sourceforge.net/Libusb1.0
>  http://openusb.sourceforge.net/
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter
Muscle mailing list