fedora-cvs-commits@redhat.com
[Top] [All Lists]

rpms/kernel/FC-6 linux-2.6-i386-hpet-check-if-the-counter-works.patch, N

Subject: rpms/kernel/FC-6 linux-2.6-i386-hpet-check-if-the-counter-works.patch, NONE, 1.1 kernel-2.6.spec, 1.2984, 1.2985
From:
Date: Thu, 12 Jul 2007 18:49:35 -0400
Author: davej

Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv27506

Modified Files:
        kernel-2.6.spec 
Added Files:
        linux-2.6-i386-hpet-check-if-the-counter-works.patch 
Log Message:
* Thu Jul 12 2007 Dave Jones <davej@xxxxxxxxxx>
- Some systems have a HPET which is not incrementing, which leads
  to a complete hang.  Detect it during HPET setup.


linux-2.6-i386-hpet-check-if-the-counter-works.patch:
 hpet.c |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletion(-)

--- NEW FILE linux-2.6-i386-hpet-check-if-the-counter-works.patch ---
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

Some systems have a HPET which is not incrementing, which leads to a
complete hang.  Detect it during HPET setup.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxx>
Cc: john stultz <johnstul@xxxxxxxxxx>
Cc: <stable@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/i386/kernel/hpet.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff -puN arch/i386/kernel/hpet.c~i386-hpet-check-if-the-counter-works 
arch/i386/kernel/hpet.c
--- a/arch/i386/kernel/hpet.c~i386-hpet-check-if-the-counter-works
+++ a/arch/i386/kernel/hpet.c
@@ -226,7 +226,8 @@ int __init hpet_enable(void)
 {
        unsigned long id;
        uint64_t hpet_freq;
-       u64 tmp;
+       u64 tmp, start, now;
+       cycle_t t1;
 
        if (!is_hpet_capable())
                return 0;
@@ -273,6 +274,27 @@ int __init hpet_enable(void)
        /* Start the counter */
        hpet_start_counter();
 
+       /* Verify whether hpet counter works */
+       t1 = read_hpet();
+       rdtscll(start);
+
+       /*
+        * We don't know the TSC frequency yet, but waiting for
+        * 200000 TSC cycles is safe:
+        * 4 GHz == 50us
+        * 1 GHz == 200us
+        */
+       do {
+               rep_nop();
+               rdtscll(now);
+       } while ((now - start) < 200000UL);
+
+       if (t1 == read_hpet()) {
+               printk(KERN_WARNING
+                      "HPET counter not counting. HPET disabled\n");
+               goto out_nohpet;
+       }
+
        /* Initialize and register HPET clocksource
         *
         * hpet period is in femto seconds per cycle
_


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/kernel-2.6.spec,v
retrieving revision 1.2984
retrieving revision 1.2985
diff -u -r1.2984 -r1.2985
--- kernel-2.6.spec     12 Jul 2007 22:47:54 -0000      1.2984
+++ kernel-2.6.spec     12 Jul 2007 22:49:33 -0000      1.2985
@@ -510,6 +510,7 @@
 Patch30: linux-2.6-sysrq-c.patch
 Patch40: linux-2.6-x86-tune-generic.patch
 Patch50: linux-2.6-x86-vga-vidfail.patch
+Patch51: linux-2.6-i386-hpet-check-if-the-counter-works.patch
 Patch95: linux-2.6-kvm-suspend.patch
 Patch100: linux-2.6-g5-therm-shutdown.patch
 Patch120: linux-2.6-ppc32-ucmpdi2.patch
@@ -1046,6 +1047,9 @@
 # for the installer cd that wants to automatically fall back to textmode
 # in that case
 ApplyPatch linux-2.6-x86-vga-vidfail.patch
+# Check the hpet is counting.
+ApplyPatch linux-2.6-i386-hpet-check-if-the-counter-works.patch
+
 # patch to fix suspend with kvm loaded and guests running
 ApplyPatch linux-2.6-kvm-suspend.patch
 
@@ -2122,6 +2126,10 @@
 
 %changelog
 * Thu Jul 12 2007 Dave Jones <davej@xxxxxxxxxx>
+- Some systems have a HPET which is not incrementing, which leads
+  to a complete hang.  Detect it during HPET setup.
+
+* Thu Jul 12 2007 Dave Jones <davej@xxxxxxxxxx>
 - Replace the pcspkr private PIT lock by the global PIT lock to
   serialize the PIT access all over the place.
 

-- 
fedora-cvs-commits mailing list
fedora-cvs-commits@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-cvs-commits

<Prev in Thread] Current Thread [Next in Thread>
  • rpms/kernel/FC-6 linux-2.6-i386-hpet-check-if-the-counter-works.patch, NONE, 1.1 kernel-2.6.spec, 1.2984, 1.2985, fedora-cvs-commits <=