Bug 214760 - pcsc-lite library causes gdm-daemon to wake up 5+ times per second in the default install
Summary: pcsc-lite library causes gdm-daemon to wake up 5+ times per second in the def...
Alias: None
Product: Fedora
Classification: Fedora
Component: pcsc-lite
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bob Relyea
QA Contact:
Whiteboard: bzcl34nup
Depends On:
Blocks: wakeup 418441
TreeView+ depends on / blocked
Reported: 2006-11-09 11:42 UTC by Arjan van de Ven
Modified: 2009-07-14 17:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-07-14 17:16:53 UTC
Type: ---

Attachments (Terms of Use)

Description Arjan van de Ven 2006-11-09 11:42:43 UTC
Description of problem:

the pcsc-lite library has a 200msec polling loop that gets called from
gdm-binary (which runs in the background when logged into a default install)
bumping PCSCLITE_STATUS_WAIT from 200msec to something like 5 seconds at least
mitigates the battery-slurping effect of this somewhat.

Comment 1 Ludovic Rousseau 2006-11-09 12:13:59 UTC
Using a 5 seconds delay is not the correct way to solve the problem.

Comment 2 Arjan van de Ven 2006-11-09 12:15:41 UTC
absolutely it is not.
However I take the 30 minutes extra battery today until this gets fixed for real...

Comment 3 Arjan van de Ven 2006-12-13 13:18:42 UTC

Comment 4 Ludovic Rousseau 2006-12-13 13:32:59 UTC
pong ?

Comment 5 Jeff Garzik 2006-12-19 21:30:54 UTC
After testing, this behavior definitely reduces battery life here too.

Any progress, or even a suggested direction, from the developer?

Comment 6 Ludovic Rousseau 2006-12-21 14:29:17 UTC
pcsc-lite uses 3 active polling loops:
(a) to dected a reader is connected/disconnected (daemon side: pcscd)
(b) to detect a card is inserted/removed (daemon side: pcscd)
(c) to detect a card change (client side: libpcsclite)

The problem you see is case (c).

I (upstream developper) am working on case (a) with the help of udev. It is
nearly finished.

case (b) will need a driver API change (add of a callback) and support from the
reader driver. It is in the TODO list.

case (c) will need a pcscd/libpcsclite communication protocol change. It is also
the most difficult change. It is in the TODO list.

The TODO list is at

You can either implement the needed code and submit the patches or contract me.

Comment 7 Arjan van de Ven 2006-12-21 14:55:15 UTC
is there any chance to at least set the poll intervals to 1 second?
And then round the poll code to the full second, I have template code for that

void sleep_approx(int seconds)
        struct timespec ts;
        struct timeval tv;
        gettimeofday(&tv, NULL);
        ts.tv_sec = seconds;
        ts.tv_nsec = -tv.tv_usec*1000;
        while (ts.tv_nsec < 0) {
                ts.tv_nsec += 1000000000;
        nanosleep(&ts, NULL);

This one second and round it is done by several daemons, so that they all wake
up around the same time, with the result that at least the cpu can sleep the
rest (95%) of the second in one go.

Comment 8 Ludovic Rousseau 2006-12-21 16:33:42 UTC
You can change the value of PCSCLITE_STATUS_WAIT in
PCSC/src/PCSC/PCSC/pcsclite.h.in and then run ./configure ; make ; make install

The default value is 200000 (ms) or 1/5 s. Using 1000000 would wake gdm only
every 1 second.

The side effect is that you may wait up to 1 second before gdm detects a card is
inserted. And this will not solve the polling in cases (a) and (b).

Comment 9 Bug Zapper 2008-04-04 04:33:35 UTC
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers

Comment 10 Ludovic Rousseau 2008-04-04 11:41:31 UTC
This is an upstream bug.

This bug should not be closed until the bug is corrected upstream and the new version is packaged by 
Red Hat.

I can't change the Status or Version myself.

Comment 11 Bug Zapper 2008-05-14 02:27:38 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:

Comment 12 Bug Zapper 2009-06-09 22:20:39 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 

Comment 13 Bug Zapper 2009-07-14 17:16:53 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.