1. 22 4月, 2009 2 次提交
  2. 23 2月, 2009 3 次提交
  3. 13 2月, 2009 1 次提交
    • J
      x86, hpet: fix for LS21 + HPET = boot hang · b13e2464
      john stultz 提交于
      Between 2.6.23 and 2.6.24-rc1 a change was made that broke IBM LS21
      systems that had the HPET enabled in the BIOS, resulting in boot hangs
      for x86_64.
      
      Specifically commit b8ce3359, which
      merges the i386 and x86_64 HPET code.
      
      Prior to this commit, when we setup the HPET timers in x86_64, we did
      the following:
      
      	hpet_writel(HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
                          HPET_TN_32BIT, HPET_T0_CFG);
      
      However after the i386/x86_64 HPET merge, we do the following:
      
      	cfg = hpet_readl(HPET_Tn_CFG(timer));
      	cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC |
      			HPET_TN_SETVAL | HPET_TN_32BIT;
      	hpet_writel(cfg, HPET_Tn_CFG(timer));
      
      However on LS21s with HPET enabled in the BIOS, the HPET_T0_CFG register
      boots with Level triggered interrupts (HPET_TN_LEVEL) enabled. This
      causes the periodic interrupt to be not so periodic, and that results in
      the boot time hang I reported earlier in the delay calibration.
      
      My fix: Always disable HPET_TN_LEVEL when setting up periodic mode.
      Signed-off-by: NJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b13e2464
  4. 06 2月, 2009 1 次提交
  5. 05 2月, 2009 1 次提交
    • P
      x86: fix hpet timer reinit for x86_64 · a6a95406
      Pavel Emelyanov 提交于
      There's a small problem with hpet_rtc_reinit function - it checks
      for the:
      
      	hpet_readl(HPET_COUNTER) - hpet_t1_cmp > 0
      
      to continue increasing both the HPET_T1_CMP (register) and the
      hpet_t1_cmp (variable).
      
      But since the HPET_COUNTER is always 32-bit, if the hpet_t1_cmp
      is 64-bit this condition will always be FALSE once the latter hits
      the 32-bit boundary, and we can have a situation, when we don't
      increase the HPET_T1_CMP register high enough.
      
      The result - timer stops ticking, since HPET_T1_CMP becomes less,
      than the COUNTER and never increased again.
      
      The solution is (based on Linus's suggestion) to not compare 64-bits
      (on 64-bit x86), but to do the comparison on 32-bit signed
      integers.
      Reported-by: NKirill Korotaev <dev@openvz.org>
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a6a95406
  6. 22 1月, 2009 1 次提交
  7. 12 1月, 2009 1 次提交
  8. 17 12月, 2008 2 次提交
  9. 13 12月, 2008 2 次提交
  10. 25 11月, 2008 1 次提交
  11. 24 11月, 2008 1 次提交
  12. 11 11月, 2008 3 次提交
  13. 16 10月, 2008 8 次提交
  14. 06 9月, 2008 2 次提交
    • T
      x86: HPET: read back compare register before reading counter · 72d43d9b
      Thomas Gleixner 提交于
      After fixing the u32 thinko I sill had occasional hickups on ATI chipsets
      with small deltas. There seems to be a delay between writing the compare
      register and the transffer to the internal register which triggers the
      interrupt. Reading back the value makes sure, that it hit the internal
      match register befor we compare against the counter value.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      72d43d9b
    • T
      x86: HPET fix moronic 32/64bit thinko · f7676254
      Thomas Gleixner 提交于
      We use the HPET only in 32bit mode because:
      1) some HPETs are 32bit only
      2) on i386 there is no way to read/write the HPET atomic 64bit wide
      
      The HPET code unification done by the "moron of the year" did
      not take into account that unsigned long is different on 32 and
      64 bit.
      
      This thinko results in a possible endless loop in the clockevents
      code, when the return comparison fails due to the 64bit/332bit
      unawareness. 
      
      unsigned long cnt = (u32) hpet_read() + delta can wrap over 32bit.
      but the final compare will fail and return -ETIME causing endless
      loops.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f7676254
  15. 05 9月, 2008 1 次提交
  16. 14 8月, 2008 1 次提交
    • T
      x86: hpet: workaround SB700 BIOS · a6825f1c
      Thomas Gleixner 提交于
      AMD SB700 based systems with spread spectrum enabled use a SMM based
      HPET emulation to provide proper frequency setting. The SMM code is
      initialized with the first HPET register access and takes some time to
      complete. During this time the config register reads 0xffffffff. We
      check for max. 1000 loops whether the config register reads a non
      0xffffffff value to make sure that HPET is up and running before we go
      further. A counting loop is safe, as the HPET access takes thousands
      of CPU cycles. On non SB700 based machines this check is only done
      once and has no side effects.
      
      Based on a quirk patch from: crane cai <crane.cai@amd.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      a6825f1c
  17. 01 8月, 2008 1 次提交
    • D
      hpet: /dev/hpet - fixes and cleanup · 64a76f66
      David Brownell 提交于
      Minor /dev/hpet updates and bugfixes:
      
        * Remove dead code, mostly remnants of an incomplete/unusable
          kernel interface ... noted when addressing "sparse" warnings:
            + hpet_unregister() and a routine it calls
            + hpet_task and all references, including hpet_task_lock
            + hpet_data.hd_flags (and HPET_DATA_PLATFORM)
      
        * Correct and improve boot message:
            + displays *counter* (shared between comparators) bit width,
              not *timer* bit widths (which are often mixed)
            + relabel "timers" as "comparators"; this is less confusing,
              they are not independent like normal timers are (sigh)
            + display MHz not Hz; it's never less than 10 MHz.
      
        * Tighten and correct the userspace interface code
            + don't accidentally program comparators in 64-bit mode using
              32-bit values ... always force comparators into 32-bit mode
            + provide the correct bit definition flagging comparators with
              periodic capability ... the ABI is unchanged
      
        * Update Documentation/hpet.txt
            + be more correct and current
            + expand description a bit
            + don't mention that now-gone kernel interface
      
      Plus, add a FIXME comment for something that could cause big trouble
      on systems with more capable HPETs than at least Intel seems to ship.
      
      It seems that few folk use this userspace interface; it's not very
      usable given the general lack of HPET IRQ routing.  I'm told that
      the only real point of it any more is to mmap for fast timestamps;
      IMO that's handled better through the gettimeofday() vsyscall.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      64a76f66
  18. 25 7月, 2008 1 次提交
  19. 14 7月, 2008 1 次提交
  20. 13 5月, 2008 1 次提交
    • C
      x86: clean up computation of HPET .mult variables · 6fd592da
      Carlos R. Mafra 提交于
      While reading through the HPET code I realized that the
      computation of .mult variables could be done with less
      lines of code, resulting in a 1.6% text size saving
      for hpet.o
      
      So I propose the following patch, which applies against
      today's Linus -git tree.
      
      >From 0c6507e400e9ca5f7f14331e18f8c12baf75a9d3 Mon Sep 17 00:00:00 2001
      From: Carlos R. Mafra <crmafra@ift.unesp.br>
      Date: Mon, 5 May 2008 19:38:53 -0300
      
      The computation of clocksource_hpet.mult
      
             tmp = (u64)hpet_period << HPET_SHIFT;
             do_div(tmp, FSEC_PER_NSEC);
             clocksource_hpet.mult = (u32)tmp;
      
      can be streamlined if we note that it is equal to
      
             clocksource_hpet.mult = div_sc(hpet_period, FSEC_PER_NSEC, HPET_SHIFT);
      
      Furthermore, the computation of hpet_clockevent.mult
      
             uint64_t hpet_freq;
      
             hpet_freq = 1000000000000000ULL;
             do_div(hpet_freq, hpet_period);
             hpet_clockevent.mult = div_sc((unsigned long) hpet_freq,
                                           NSEC_PER_SEC, hpet_clockevent.shift);
      
      can also be streamlined with the observation that hpet_period and hpet_freq are
      inverse to each other (in proper units).
      
      So instead of computing hpet_freq and using (schematically)
      div_sc(hpet_freq, 10^9, shift) we use the trick of calling with the
      arguments in reverse order, div_sc(10^6, hpet_period, shift).
      
      The different power of ten is due to frequency being in Hertz (1/sec)
      and the period being in units of femtosecond. Explicitly,
      
      mult = (hpet_freq * 2^shift)/10^9    (before)
      mult = (10^6 * 2^shift)/hpet_period  (after)
      
      because hpet_freq = 10^15/hpet_period.
      
      The comments in the code are also updated to reflect the changes.
      
      As a result,
      
         text    data     bss     dec     hex filename
         2957     425      92    3474     d92 arch/x86/kernel/hpet.o
         3006     425      92    3523     dc3 arch/x86/kernel/hpet.o.old
      
      a 1.6% reduction in text size.
      Signed-off-by: NCarlos R. Mafra <crmafra@ift.unesp.br>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      6fd592da
  21. 01 5月, 2008 1 次提交
  22. 26 4月, 2008 1 次提交
  23. 05 4月, 2008 1 次提交
  24. 26 2月, 2008 1 次提交
  25. 30 1月, 2008 1 次提交