[PATCH] OS/ACPI: Reconnect to acpid when it gets restarted

Egbert Eich e4t at freenet.de
Mon Sep 16 10:24:44 PDT 2013


Hi Keith!

Back from Vienna :)

On Mon, Sep 09, 2013 at 04:23:20PM -0700, Keith Packard wrote:
> Egbert Eich <eich at freedesktop.org> writes:
> 
> > +PMClose
> > +lnxACPIPoll(void)
> > +{
> > +    TimerSet(NULL, 0, 10000, lnxACPICheckTimer, NULL);
> 
> I'm betting this is supposed to be:
> 
>        acpiTimer = TimerSet(NULL, 0, 10000, lnxACPICheckTimer, NULL);

Right. Huh, not sure why this was forgotten.

> 
> I'm also not understanding how this code is supposed to detect an acpid
> failure and automatically reconnect; seems like that would take a check
> in the ACPI event reading code? Did I just miss something?


Ok, now I see: the title of the patch is wrong. Originally I had this
in the patch I had in SUSE. But then you(and ajax) already added the 
reconnect functionality.

fa9a49a9        (Adam Jackson   2006-05-18 18:18:41 +0000       83)    if (n <= 0) {
9838b703        (Keith Packard  2012-03-21 12:55:09 -0700       84)        lnxCloseACPI();
9838b703        (Keith Packard  2012-03-21 12:55:09 -0700       85)        TimerSet(NULL, 0, ACPI_REOPEN_DELAY, lnxACPIReopen, NULL);
9838b703        (Keith Packard  2012-03-21 12:55:09 -0700       86)        return 0;
fa9a49a9        (Adam Jackson   2006-05-18 18:18:41 +0000       87)    }

What this patch is supposed to add is a retry if the (re)open doesn't succeed:
Without this patch if acpid isn't active at the time the DDX tries to (re)open,
we will loose it.
Thus the title of the patch should probably be:

   OS/ACPI: Retry (re)connecting to acpid until successful

Maybe we should give up trying at some point. But then again we have a 10 sec
retry interval. 

I will resend this and the next patch with corrected changelog entries and the
one bug fixed.

Cheers,
	Egbert.


More information about the xorg-devel mailing list