Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291860
b: refs/heads/master
c: da863cd
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Mar 4, 2012
1 parent 15345c3 commit 006cabc
Show file tree
Hide file tree
Showing 2 changed files with 15 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: d94aff87826ee6aa43032f4c0263482913f4e2c8
refs/heads/master: da863cddd831b0f4bf2d067f8b75254f1be94590
16 changes: 14 additions & 2 deletions trunk/drivers/base/power/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ static void wakeup_source_deactivate(struct wakeup_source *ws)
ws->max_time = duration;

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

/*
* Increment the counter of registered wakeup events and decrement the
Expand Down Expand Up @@ -487,11 +488,22 @@ EXPORT_SYMBOL_GPL(pm_relax);
* pm_wakeup_timer_fn - Delayed finalization of a wakeup event.
* @data: Address of the wakeup source object associated with the event source.
*
* Call __pm_relax() for the wakeup source whose address is stored in @data.
* Call wakeup_source_deactivate() for the wakeup source whose address is stored
* in @data if it is currently active and its timer has not been canceled and
* the expiration time of the timer is not in future.
*/
static void pm_wakeup_timer_fn(unsigned long data)
{
__pm_relax((struct wakeup_source *)data);
struct wakeup_source *ws = (struct wakeup_source *)data;
unsigned long flags;

spin_lock_irqsave(&ws->lock, flags);

if (ws->active && ws->timer_expires
&& time_after_eq(jiffies, ws->timer_expires))
wakeup_source_deactivate(ws);

spin_unlock_irqrestore(&ws->lock, flags);
}

/**
Expand Down

0 comments on commit 006cabc

Please sign in to comment.