Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48451
b: refs/heads/master
c: 2f7a2a7
h: refs/heads/master
i:
  48449: f3c7950
  48447: d434946
v: v3
  • Loading branch information
Jack Steiner authored and Andi Kleen committed Feb 13, 2007
1 parent b5d33a8 commit 231e34c
Show file tree
Hide file tree
Showing 2 changed files with 8 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: 6c5806cae50717f31878d0da29109b10610ab862
refs/heads/master: 2f7a2a79c3ebb44f8b1b7d9b4fd3a650eb69e544
9 changes: 7 additions & 2 deletions trunk/arch/x86_64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,20 +657,25 @@ core_initcall(cpufreq_tsc);

#define TICK_COUNT 100000000
#define TICK_MIN 5000
#define MAX_READ_RETRIES 5

/*
* Some platforms take periodic SMI interrupts with 5ms duration. Make sure none
* occurs between the reads of the hpet & TSC.
*/
static void __init read_hpet_tsc(int *hpet, int *tsc)
{
int tsc1, tsc2, hpet1;
int tsc1, tsc2, hpet1, retries = 0;
static int msg;

do {
tsc1 = get_cycles_sync();
hpet1 = hpet_readl(HPET_COUNTER);
tsc2 = get_cycles_sync();
} while (tsc2 - tsc1 > TICK_MIN);
} while (tsc2 - tsc1 > TICK_MIN && retries++ < MAX_READ_RETRIES);
if (retries >= MAX_READ_RETRIES && !msg++)
printk(KERN_WARNING
"hpet.c: exceeded max retries to read HPET & TSC\n");
*hpet = hpet1;
*tsc = tsc2;
}
Expand Down

0 comments on commit 231e34c

Please sign in to comment.