Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163072
b: refs/heads/master
c: d0981a1
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed Aug 19, 2009
1 parent 16f497a commit f02ce5f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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: 6ea41d252f35465a2308a4038a323b6b07de06f6
refs/heads/master: d0981a1b21a03866c8da7f44e35e389c2e0d6061
18 changes: 13 additions & 5 deletions trunk/kernel/time/clocksource.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ static cycle_t watchdog_last;
static int watchdog_running;

static void clocksource_watchdog_work(struct work_struct *work);
static void __clocksource_change_rating(struct clocksource *cs, int rating);

/*
* Interval: 0.5sec Threshold: 0.0625s
Expand Down Expand Up @@ -309,6 +310,7 @@ static void clocksource_watchdog_work(struct work_struct *work)
unsigned long flags;
LIST_HEAD(unstable);

mutex_lock(&clocksource_mutex);
spin_lock_irqsave(&watchdog_lock, flags);
list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list)
if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
Expand All @@ -322,8 +324,9 @@ static void clocksource_watchdog_work(struct work_struct *work)
/* Needs to be done outside of watchdog lock */
list_for_each_entry_safe(cs, tmp, &unstable, wd_list) {
list_del_init(&cs->wd_list);
clocksource_change_rating(cs, 0);
__clocksource_change_rating(cs, 0);
}
mutex_unlock(&clocksource_mutex);
}

#else /* CONFIG_CLOCKSOURCE_WATCHDOG */
Expand Down Expand Up @@ -470,16 +473,21 @@ int clocksource_register(struct clocksource *cs)
}
EXPORT_SYMBOL(clocksource_register);

static void __clocksource_change_rating(struct clocksource *cs, int rating)
{
list_del(&cs->list);
cs->rating = rating;
clocksource_enqueue(cs);
clocksource_select();
}

/**
* clocksource_change_rating - Change the rating of a registered clocksource
*/
void clocksource_change_rating(struct clocksource *cs, int rating)
{
mutex_lock(&clocksource_mutex);
list_del(&cs->list);
cs->rating = rating;
clocksource_enqueue(cs);
clocksource_select();
__clocksource_change_rating(cs, rating);
mutex_unlock(&clocksource_mutex);
}
EXPORT_SYMBOL(clocksource_change_rating);
Expand Down

0 comments on commit f02ce5f

Please sign in to comment.