Re: [RFC][PATCH] PM: Avoid losing wakeup events during suspend

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rafael J. Wysocki
Date: Sunday, June 20, 2010 - 5:49 am

On Sunday, June 20, 2010, mark gross wrote:

I'm not sure what you mean.  There are wake-up events without any user space
consumers, like wake-on-LAN.


A wakeup event need not be an interrupt, or at least there are interrupts that
have other meanings, like ACPI SCI.


In some cases I may want to suspend/hibernate losing some wakeup events,
like for example in the case of emergency hibernation on critical battery.


There's no issue AFAICS.  It only matters if the value is different from the
previous one after incrementation.


The lock is there, because two counters are incremented at the same time.
Also, in some other places the counter is accessed along with the enable
flag, so there are two operations that need to be done in the same critical
section.


I tells the PM core whether or not to check wakeup events during suspend.
The checking is only enabled after a successful write to
/sys/power/wakeup_count, it is disabled by reads and by the final check right
before the system enters suspend.  [That's because the "saved" value from
the previous suspend should not be used for checking wakeup events during
the next one.]


Well, I could use check_wakeup_events() and
check_and_disable_wakeup_events() (the latter is only necessary for the final
check), but I'm not sure if that's going to be better.


Thanks for the comments.

Rafael
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH] PM: Avoid losing wakeup events during suspend, Rafael J. Wysocki, (Sat Jun 19, 3:05 pm)
Re: [RFC][PATCH] PM: Avoid losing wakeup events during suspend, Rafael J. Wysocki, (Sun Jun 20, 5:49 am)