Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291861
b: refs/heads/master
c: 4782e16
h: refs/heads/master
i:
  291859: 15345c3
v: v3
  • Loading branch information
Rafael J. Wysocki committed Mar 4, 2012
1 parent 006cabc commit 37c086f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: da863cddd831b0f4bf2d067f8b75254f1be94590
refs/heads/master: 4782e1654bdbd30cf307da090b3c4f70157477cb
8 changes: 6 additions & 2 deletions trunk/drivers/base/power/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ static void wakeup_source_activate(struct wakeup_source *ws)
{
ws->active = true;
ws->active_count++;
ws->timer_expires = jiffies;
ws->last_time = ktime_get();

/* Increment the counter of events in progress. */
Expand All @@ -365,9 +364,14 @@ void __pm_stay_awake(struct wakeup_source *ws)
return;

spin_lock_irqsave(&ws->lock, flags);

ws->event_count++;
if (!ws->active)
wakeup_source_activate(ws);

del_timer(&ws->timer);
ws->timer_expires = 0;

spin_unlock_irqrestore(&ws->lock, flags);
}
EXPORT_SYMBOL_GPL(__pm_stay_awake);
Expand Down Expand Up @@ -541,7 +545,7 @@ void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)
if (!expires)
expires = 1;

if (time_after(expires, ws->timer_expires)) {
if (!ws->timer_expires || time_after(expires, ws->timer_expires)) {
mod_timer(&ws->timer, expires);
ws->timer_expires = expires;
}
Expand Down

0 comments on commit 37c086f

Please sign in to comment.