Bug 90339 - RFE: logind should try to avoid suspend races
Summary: RFE: logind should try to avoid suspend races
Status: NEW
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
Depends on:
Reported: 2015-05-06 12:41 UTC by Bastien Nocera
Modified: 2016-06-10 12:49 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Bastien Nocera 2015-05-06 12:41:09 UTC
From http://article.gmane.org/gmane.linux.kernel/1945822 :

>>   The last thing the power manager does, right before
>> writing "mem" to /sys/power/state, is write the wakeup_count that it
>> read earlier to /sys/power/wakeup_count.  If the write fails, the
>> power manager considers the suspend attempt failed, reads the new
>> wakeup_count, and starts a timer (usually 10 seconds) to retry the
>> suspend.  The same thing happens if the write to /sys/power/state
>> fails.
> Is this something that logind should do as well?

We do it to avoid a race condition where a wakeup event occurs after
userspace has started the suspend process but before anything writes
"mem" to /sys/power/state.  I'm guessing that this is something logind
should be doing as well since the chances of missing a wakeup event
increase the longer any given delay inhibitor takes to delay a

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.