Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2f7a2a79c3ebb44f8b1b7d9b4fd3a650eb69e544
Commit:     2f7a2a79c3ebb44f8b1b7d9b4fd3a650eb69e544
Parent:     6c5806cae50717f31878d0da29109b10610ab862
Author:     Jack Steiner <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 13 13:26:24 2007 +0100
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Tue Feb 13 13:26:24 2007 +0100

    [PATCH] x86-64: - Ignore long SMI interrupts in clock calibration code - 
update 1
    
    Add failsafe mechanism to HPET/TSC clock calibration.
    
        Signed-off-by: Jack Steiner <[EMAIL PROTECTED]>
    
    Updated to include failsafe mechanism & additional community feedback.
    Patch built on latest 2.6.20-rc4-mm1 tree.
    
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
---
 arch/x86_64/kernel/time.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 335cc91..9c7fba3 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -657,6 +657,7 @@ 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
@@ -664,13 +665,17 @@ core_initcall(cpufreq_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;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to