Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328684
b: refs/heads/master
c: 4955070
h: refs/heads/master
v: v3
  • Loading branch information
John Stultz authored and Rafael J. Wysocki committed Sep 6, 2012
1 parent 9fdfa19 commit bf34e62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5834ec3aea8a84b70efeb52ee91a8f8b1042cd2a
refs/heads/master: 4955070974ecfa0b1ae9d2506f529460fd3a4b0b
17 changes: 11 additions & 6 deletions trunk/drivers/base/power/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ EXPORT_SYMBOL_GPL(wakeup_source_destroy);
*/
void wakeup_source_add(struct wakeup_source *ws)
{
unsigned long flags;

if (WARN_ON(!ws))
return;

Expand All @@ -135,9 +137,9 @@ void wakeup_source_add(struct wakeup_source *ws)
ws->active = false;
ws->last_time = ktime_get();

spin_lock_irq(&events_lock);
spin_lock_irqsave(&events_lock, flags);
list_add_rcu(&ws->entry, &wakeup_sources);
spin_unlock_irq(&events_lock);
spin_unlock_irqrestore(&events_lock, flags);
}
EXPORT_SYMBOL_GPL(wakeup_source_add);

Expand All @@ -147,12 +149,14 @@ EXPORT_SYMBOL_GPL(wakeup_source_add);
*/
void wakeup_source_remove(struct wakeup_source *ws)
{
unsigned long flags;

if (WARN_ON(!ws))
return;

spin_lock_irq(&events_lock);
spin_lock_irqsave(&events_lock, flags);
list_del_rcu(&ws->entry);
spin_unlock_irq(&events_lock);
spin_unlock_irqrestore(&events_lock, flags);
synchronize_rcu();
}
EXPORT_SYMBOL_GPL(wakeup_source_remove);
Expand Down Expand Up @@ -752,15 +756,16 @@ bool pm_get_wakeup_count(unsigned int *count, bool block)
bool pm_save_wakeup_count(unsigned int count)
{
unsigned int cnt, inpr;
unsigned long flags;

events_check_enabled = false;
spin_lock_irq(&events_lock);
spin_lock_irqsave(&events_lock, flags);
split_counters(&cnt, &inpr);
if (cnt == count && inpr == 0) {
saved_count = count;
events_check_enabled = true;
}
spin_unlock_irq(&events_lock);
spin_unlock_irqrestore(&events_lock, flags);
return events_check_enabled;
}

Expand Down

0 comments on commit bf34e62

Please sign in to comment.