Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163084
b: refs/heads/master
c: 54a6bc0
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed Sep 14, 2009
1 parent cf3d6bf commit db15030
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 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: e6c733050faa93ce616bfedccd279ab12cffdd7b
refs/heads/master: 54a6bc0b071c50150bc6d1da16c2cd9a963e288c
28 changes: 18 additions & 10 deletions trunk/kernel/time/clocksource.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ static struct clocksource *curr_clocksource;
static LIST_HEAD(clocksource_list);
static DEFINE_MUTEX(clocksource_mutex);
static char override_name[32];
static int finished_booting;

#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
static void clocksource_watchdog_work(struct work_struct *work);
Expand Down Expand Up @@ -155,7 +156,8 @@ static void __clocksource_unstable(struct clocksource *cs)
{
cs->flags &= ~(CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_WATCHDOG);
cs->flags |= CLOCK_SOURCE_UNSTABLE;
schedule_work(&watchdog_work);
if (finished_booting)
schedule_work(&watchdog_work);
}

static void clocksource_unstable(struct clocksource *cs, int64_t delta)
Expand Down Expand Up @@ -207,7 +209,8 @@ static void clocksource_watchdog(unsigned long data)

/* Clocksource already marked unstable? */
if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
schedule_work(&watchdog_work);
if (finished_booting)
schedule_work(&watchdog_work);
continue;
}

Expand Down Expand Up @@ -380,6 +383,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)

static inline void clocksource_dequeue_watchdog(struct clocksource *cs) { }
static inline void clocksource_resume_watchdog(void) { }
static inline int clocksource_watchdog_kthread(void *data) { return 0; }

#endif /* CONFIG_CLOCKSOURCE_WATCHDOG */

Expand Down Expand Up @@ -415,8 +419,6 @@ void clocksource_touch_watchdog(void)

#ifdef CONFIG_GENERIC_TIME

static int finished_booting;

/**
* clocksource_select - Select the best clocksource available
*
Expand Down Expand Up @@ -461,6 +463,12 @@ static void clocksource_select(void)
}
}

#else /* CONFIG_GENERIC_TIME */

static inline void clocksource_select(void) { }

#endif

/*
* clocksource_done_booting - Called near the end of core bootup
*
Expand All @@ -471,19 +479,19 @@ static void clocksource_select(void)
static int __init clocksource_done_booting(void)
{
finished_booting = 1;

/*
* Run the watchdog first to eliminate unstable clock sources
*/
clocksource_watchdog_kthread(NULL);

mutex_lock(&clocksource_mutex);
clocksource_select();
mutex_unlock(&clocksource_mutex);
return 0;
}
fs_initcall(clocksource_done_booting);

#else /* CONFIG_GENERIC_TIME */

static inline void clocksource_select(void) { }

#endif

/*
* Enqueue the clocksource sorted by rating
*/
Expand Down

0 comments on commit db15030

Please sign in to comment.