Bug 8015

Summary: HPET timer usage bug
Product: ACPI Reporter: Di Tang (di.tang)
Component: Config-OtherAssignee: Zhang Rui (rui.zhang)
Status: REJECTED UNREPRODUCIBLE    
Severity: normal CC: acpi-bugzilla, andi-bz, ebiederm, john.stultz, martin, protasnb, venki
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.20 Subsystem:
Regression: --- Bisected commit-id:

Description Di Tang 2007-02-15 01:20:18 UTC
Most recent kernel where this bug did *NOT* occur:
Distribution:
Hardware Environment: Intel Mobile, i386, single processor. Normal ICH with 
HPET
Software Environment: BOOT, HPET built in the kernel
Problem Description:
  In file linux/arch/i386/kernel/time_hpet.c, function hpet_enable. The HPET 
uses the IRQ2(HPET_LEGACY_8254) and IRQ8(HPET_LEGACY_RTC) as default for 
setting up HPET legacy mode. But in Intel HPET spec, the IRQ2 is used only 
when IOAPIC is enabled, otherwise it is routed to PIC IRQ0. So there is a 
conflication for it. It should judge the mode first. 
 And later in linux/arch/i386/kernel/time.c, function hpet_time_init(). It 
will call time_init_hook, which uses the IRQ0.

void __init time_init_hook(void)
{
  setup_irq(0, &irq0);
}

Steps to reproduce:
Comment 1 Andrew Morton 2007-02-15 01:27:16 UTC
(added a few people)
Comment 2 Venkatesh Pallipadi 2007-02-15 13:16:54 UTC
Is this an issue you have with some system where kernel is not able to use 
HPET.
Or is this something you found by code inspection and reading HPET doc?

HPET timer interrupts appear as IRQ0 to kernel either with IOAPIC or 8259. The 
IRQ 2 (HPET_LEGACY_8254) is only for hpet driver (drivers/char/hpet.c) and 
kernel reserves both timer 0 and timer 1 (When RTC emulation is enabled) and 
driver will not use these.

 
Comment 3 Di Tang 2007-02-15 16:56:20 UTC
  When I use the Kernel 2.6.20 for power on the new UMPC platform, it will 
cause the HLT instruction (In /asm-i386/bugs.h, check_bugs(), which calls 
check_hlt())making the processor halt. The reason is that no interrupt occurs 
at that point. The additional kernel command is "console=ttyS0,115200n8 
console=tty0" for Fedora 4.
 HPET appears as either IRQ0 for 8259 or acts as IRQ2 for IOAPIC. It depends 
on which interrupt controller runs. 
 As I am not a Linux kernel expert, it may have mistake for my understanding 
the kernel code. When I disabling the HPET support in kernel , it works well 
for HLT at check_hlt(). 
Comment 4 Natalie Protasevich 2007-07-03 22:05:15 UTC
Di,
Can you please collect a boot trace with "debug apic=debug" boot parameters when you get such failure?
Thanks.
Comment 5 Zhang Rui 2008-03-23 23:36:53 UTC
Contacted Di and the bug can not be reproduced any more.