linux/drivers/base/power
Rafael J. Wysocki 023d377914 PM / Wakeup: Combine atomic counters to avoid reordering issues
The memory barrier in wakeup_source_deactivate() is supposed to
prevent the callers of pm_wakeup_pending() and pm_get_wakeup_count()
from seeing the new value of events_in_progress (0, in particular)
and the old value of event_count at the same time.  However, if
wakeup_source_deactivate() is executed by CPU0 and, for instance,
pm_wakeup_pending() is executed by CPU1, where both processors can
reorder operations, the memory barrier in wakeup_source_deactivate()
doesn't affect CPU1 which can reorder reads.  In that case CPU1 may
very well decide to fetch event_count before it's modified and
events_in_progress after it's been updated, so pm_wakeup_pending()
may fail to detect a wakeup event.  This issue can be addressed by
using a single atomic variable to store both events_in_progress
and event_count, so that they can be updated together in a single
atomic operation.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-03-15 00:43:13 +01:00
..
generic_ops.c PM / Runtime: Generic resume shouldn't set RPM_ACTIVE unconditionally 2010-12-24 15:04:06 +01:00
main.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-01-13 10:05:56 -08:00
Makefile PM: Introduce library for device-specific OPPs (v7) 2010-10-17 01:57:50 +02:00
opp.c PM: Introduce library for device-specific OPPs (v7) 2010-10-17 01:57:50 +02:00
power.h PM / Runtime: Add no_callbacks flag 2010-10-17 01:57:47 +02:00
runtime.c PM / Runtime: Don't enable interrupts while running in_interrupt 2011-01-25 20:50:07 +01:00
sysfs.c PM / Runtime: Implement autosuspend support 2010-10-17 01:57:48 +02:00
trace.c PM: Add sysfs attr for rechecking dev hash from PM trace 2010-10-17 01:57:50 +02:00
wakeup.c PM / Wakeup: Combine atomic counters to avoid reordering issues 2011-03-15 00:43:13 +01:00