Bug 10409

Summary: HPET interrupt is missing on HAIER H53
Product: Timers Reporter: Anielkis Herrera (aherrerag)
Component: OtherAssignee: john stultz (john.stultz)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, aherrerag, aherrman, shaohua.li, tglx, venki
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.24.1, 2.6.24.3, 2.6.25-rc8 Subsystem:
Regression: No Bisected commit-id:
Bug Depends on:    
Bug Blocks: 56331    
Attachments: output of "lspci -vxxx"
acpidump
booting without acpi=off and with debug
booting without acpi=off and with debug (pic2)
booting without acpi=off and with debug (pic3)
booting without acpi=off and debug (pic1)
booting without acpi=off and without debug (pic2)
booting without acpi=off and without debug (pic3)
booting without acpi=off and without debug (pic4)
debug
debug
output of dmesg booting with the second dbg.patch
obtained with the second debug patch
here it is
with only that line commented
dmidecode
workaround
output of dmesg
output of dmesg only with 'hpet=disable debug apic=debug'
new output
screenshot

Description Anielkis Herrera 2008-04-06 19:44:33 UTC
Latest working kernel version: -
Earliest failing kernel version: 2.6.24.1
Distribution: Gentoo, Ubuntu, Ututo, Sabayon
Hardware Environment:
lspci:
00:00.0 Host bridge: ATI Technologies Inc Unknown device 5a31 (rev 01)
00:01.0 PCI bridge: ATI Technologies Inc RS480 PCI Bridge
00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller (rev 80)
00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller (rev 80)
00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller (rev 80)
00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 82)
00:14.1 IDE interface: ATI Technologies Inc IXP SB400 IDE Controller (rev 80)
00:14.2 Audio device: ATI Technologies Inc IXP SB4x0 High Definition Audio Controller (rev 01)
00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge (rev 80)
00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge (rev 80)
01:05.0 VGA compatible controller: ATI Technologies Inc RC410 [Radeon Xpress 200M]
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
02:01.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b3)
02:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 17)
02:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 08)

cpuinfo:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 14
model name      : Intel(R) Core(TM) Duo CPU      T2350  @ 1.86GHz
stepping        : 12
cpu MHz         : 1866.805
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts pni monitor est tm2 xtpr
bogomips	: 3960.74
clflush size	: 64

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 14
model name	: Intel(R) Core(TM) Duo CPU      T2350  @ 1.86GHz
stepping	: 12
cpu MHz		: 1866.805
cache size	: 2048 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts pni monitor est tm2 xtpr
bogomips	: 3733.90
clflush size	: 64

Software Environment:
# emerge --info
Portage 2.1.4.4 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-gentoo-r4 i686)
=================================================================
System uname: 2.6.24-gentoo-r4 i686 Intel(R) Core(TM) Duo CPU T2350 @ 1.86GHz
Timestamp of tree: Thu, 03 Apr 2008 01:45:04 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.5.1-r5
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -pipe -mfpmath=sse -msse -msse2 -msse3 -mmmx -fno-gcse -fthread-jumps -fexpensive-optimizations -frerun-loop-opt -DREENABLE_FAST_EXECUTION "
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=prescott -pipe -mfpmath=sse -msse -msse2 -msse3 -mmmx -fno-gcse -fthread-jumps -fexpensive-optimizations -frerun-loop-opt -DREENABLE_FAST_EXECUTION "
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer nodoc parallel parallel-fetch sfperms unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.prod.uci.cu"
LANG="es_ES.utf8"
LC_ALL="es_ES.utf8"
LINGUAS="es en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
USE="X aac aalib acl acpi aiglx alsa apm applet asf avahi avi bash-completion berkdb bindist bitmap-fonts branding bzip2 cairo cdda cdr cli cracklib crypt cups curl dba dbus device-mapper directfb djvu dri dv dvb dvd dvdr dvdread dvi eds emboss encode esd evo fam fbcon ffmpeg firefox flac foomaticdb fortran freetype gd gdbm ggi gif gnome gnutls gphoto2 gpm gstreamer gtk gtk2 hal i8x0 iconv imlib ipv6 isdnlog ithreads jack jikes jpeg kerberos krb4 lame ldap libg++ libnotify libwww lzo mad matroska mcal midi mikmod mmx motif mozilla moznocalendar moznomail moznoxmlterm mp3 mpeg mudflap nas ncurses networkmanager nfs nls nntp nptl nptlonly ogg oggvorbis opengl openmp oss pam pcmcia pcre pdf pdflib perl plotutils png pppd python qt3support quicktime readline reflection remote samba scanner screen sdl session slang sni snmp speex spell spl sse sse2 ssl ssse3 suexec svg tcltk tcpd tetex theora threads tiff tk tracker truetype truetype-fonts type1-fonts unicode usb v4l vcd vim-syntax vlm vorbis win32codecs winbind x264 x86 xattr xine xinerama xml xml2 xorg xulrunner xv xvid xvmc yv12 zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config mem_cache mime mime_magic negotiation rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="mouse keyboard synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es en" USERLAND="GNU" VIDEO_CARDS="v4l radeon fbdev fglrx"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Problem Description:
I test some GNU/Linux distributions and kernel versions, but all have the same problem, them can't boot without acpi=off(even the install CDs), I tried all the combinations of the options can be passed to the kernel that are in acpi's boot.c

without acpi=off the lastest lines i got are:

checking if this procesor honours the WP bit even in supervisor mode... Ok
hpet clock event registered
spurious 8259A interrupt: IRQ7.

and it stop there, I wait 20 minutes but it was there.. :(

Steps to reproduce:
1- boot without the option acpi=off
Comment 1 ykzhao 2008-04-06 20:07:55 UTC
Will you please boot the system with "acpi=off" and attach the following outputs?
a.acpidump
b.lspci -vxxx

Thanks.
Comment 2 Anielkis Herrera 2008-04-06 20:19:40 UTC
Created attachment 15641 [details]
output of "lspci -vxxx"
Comment 3 Anielkis Herrera 2008-04-06 20:29:15 UTC
Created attachment 15642 [details]
acpidump
Comment 4 Shaohua 2008-04-07 01:38:21 UTC
please try pci=nommconf, or latest kernel.
Comment 5 Anielkis Herrera 2008-04-07 05:58:21 UTC
I already did it, and had the same result
Comment 6 Shaohua 2008-04-07 18:24:55 UTC
how about boot option 'nohpet'?
Comment 7 Anielkis Herrera 2008-04-07 19:54:48 UTC
It works!!!!

what is the problem? can you explain it to me??
I like to know how and why things happens
Comment 8 Shaohua 2008-04-07 20:15:37 UTC
Can you get the log just before the hang? You can use a serial port to get it, or just take a picture. The info is helpful for further debug.
Comment 9 Shaohua 2008-04-07 22:15:44 UTC
please also try boot option 'acpi_skip_timer_override' (without nohpet). It appears the hpet is counting, but no interrupt.
Comment 10 Anielkis Herrera 2008-04-08 12:48:23 UTC
Created attachment 15670 [details]
booting without acpi=off and with debug
Comment 11 Anielkis Herrera 2008-04-08 12:50:49 UTC
Created attachment 15671 [details]
booting without acpi=off and with debug (pic2)
Comment 12 Anielkis Herrera 2008-04-08 12:52:20 UTC
Created attachment 15672 [details]
booting without acpi=off and with debug (pic3)
Comment 13 Anielkis Herrera 2008-04-08 12:53:34 UTC
Created attachment 15673 [details]
booting without acpi=off and debug (pic1)
Comment 14 Anielkis Herrera 2008-04-08 12:54:40 UTC
Created attachment 15674 [details]
booting without acpi=off and without debug (pic2)
Comment 15 Anielkis Herrera 2008-04-08 12:55:35 UTC
Created attachment 15675 [details]
booting without acpi=off and without debug (pic3)
Comment 16 Anielkis Herrera 2008-04-08 12:58:38 UTC
Created attachment 15676 [details]
booting without acpi=off and without debug (pic4)

I can't debug with serial..
those are from the original errors, the first 3 with the option debug
and the other 4 without it, to see more recently messages
Comment 17 Shaohua 2008-04-08 18:11:45 UTC
Can you try the boot option I mentioned in comment #9, I suspected hpet isn't linked to ioapic pin 2 in the system.
Comment 18 Anielkis Herrera 2008-04-08 19:01:02 UTC
I tried twice, but it doesn't boot
Comment 19 Shaohua 2008-04-08 19:33:49 UTC
Created attachment 15683 [details]
debug

looks my guess is wrong, the HPET just doesn't fire legacy interrupt. How about the debug patch?
Comment 20 Anielkis Herrera 2008-04-08 20:44:31 UTC
it works with the debug patch, there is the problem.. in the funtion
hpet_legacy_clockevent_register 
Comment 21 Shaohua 2008-04-08 22:42:43 UTC
Created attachment 15684 [details]
debug

This confirms the issue is related to HPET interrupt instead of HPET counting, but I need more info to debug the issue. Can you apply the debug patch, attach the dmesg output with it? I'd like to check some registers of HPET.
Comment 22 Anielkis Herrera 2008-04-09 06:10:18 UTC
Created attachment 15700 [details]
output of dmesg booting with the second dbg.patch

I take this from the initramfs, I add the debug option, and there mount / and save the results..
Comment 23 Anielkis Herrera 2008-04-09 06:54:10 UTC
I'm trying to fix the DSDT, I follow http://gentoo-wiki.com/HOWTO_Fix_Common_ACPI_Problems

and got 2 errors:


dsdt.dsl   142:                     Return (\WBYT (Local1, Local0, Local2))
Error    4059 -  Called method returns no value ^ 

dsdt.dsl   158:                     Return (\WWRD (Local1, Local0, Local2))
Error    4059 -  Called method returns no value ^ 


i'm on it now. ;)
Comment 24 Shaohua 2008-04-09 17:59:49 UTC
Re comment #22: unfortunately this is just part of the log, and the info I want isn't in it. please check if you can get the full log.
Re comment #23, I can make sure this isn't DSDT related.
Comment 25 Anielkis Herrera 2008-04-09 18:40:47 UTC
Created attachment 15706 [details]
obtained with the second debug patch

ok, I wait for the system to boot and obtain this
Comment 26 Shaohua 2008-04-09 20:33:13 UTC
I haven't idea why HPET legacy interrupt is missing. Venki, any idea?

Summary:
PIT timer is working.
HPET is counting, but legacy interrupt is missing (calibrate_delay() hangs)
boot option 'acpi_skip_timer_override' doesn't work
legacy interrupt is edge triggered
Comment 27 Venkatesh Pallipadi 2008-04-09 22:58:38 UTC
Shaohua,

I see this message in dmesg
ATI board detected. Disabling timer routing over 8254.

That causes enable_8259A_irq(0) not to be called on this platform. May be that disables the int from PIC getting forwarded to IOAPIC. No idea how 8254 continues to work though...
Comment 28 Shaohua 2008-04-09 23:24:40 UTC
Anielkis, can you try as venki suggested. just comments one line as below:

in file arch/x86/kernel/early-quirks.c
static void __init ati_bugs(int num, int slot, int func)
{
#ifdef CONFIG_X86_IO_APIC
	if (timer_over_8254 == 1) {
//		timer_over_8254 = 0;
		printk(KERN_INFO
		"ATI board detected. Disabling timer routing over 8254.\n");
	}
#endif
}
Comment 29 Anielkis Herrera 2008-04-10 08:44:46 UTC
Created attachment 15718 [details]
here it is
Comment 30 Shaohua 2008-04-10 18:00:02 UTC
hmm, please not apply the debug patch in comment 21. just comment one line as I suggested in comment 28. Otherwise, we can't see the effect.
Comment 31 Anielkis Herrera 2008-04-10 19:19:35 UTC
well without the debug patch from comment 21 it can't boot and stop on "spurious 8259A interrupt: IRQ7"
Comment 32 Anielkis Herrera 2008-04-11 23:22:44 UTC
Created attachment 15737 [details]
with only that line commented

I took this by the old method of the camera  ;)
Comment 33 Shaohua 2008-04-13 18:27:10 UTC
I thought we could blacklist this system, or we could have mechanism to detect if HPET interrupt is working in kernel. I'll do some investigation and back to you.
Comment 34 Shaohua 2008-04-21 22:55:25 UTC
can you send me the 'dmidecode' output? we can blacklist the system.
Comment 35 Anielkis Herrera 2008-04-22 05:39:38 UTC
Created attachment 15840 [details]
dmidecode
Comment 36 Shaohua 2008-04-23 20:30:10 UTC
Created attachment 15879 [details]
workaround

This should workaround the issue, but don't know if community will accept it. Anyway, please try it first.
Comment 37 Anielkis Herrera 2008-04-23 22:39:42 UTC
Created attachment 15882 [details]
output of dmesg

it works, here is my dmesg output

what is the problem in 0.192668 ? it says a BIOS problem.. can it be the source?
Comment 38 Shaohua 2008-04-23 22:45:30 UTC
No, not, it just impacts pci config space read/write.
Comment 39 Shaohua 2008-05-07 22:46:46 UTC
Thomas, can you look at this issue?
Comment 40 Andreas Herrmann 2008-05-16 08:08:26 UTC
I am curious how the IOAPIC configuration looks like.
Anielkis, can you please boot your machine with "hpet=disable debug apic=debug"
on your kernel command line and provide dmesg of that boot?
Thanks.
Comment 41 Anielkis Herrera 2008-05-18 15:26:44 UTC
Created attachment 16186 [details]
output of dmesg only with 'hpet=disable debug apic=debug'
Comment 42 Thomas Gleixner 2008-05-18 23:35:16 UTC
The output file contains tons of zeros. Not really informative :)
Can you please upload it again ?
Comment 43 Anielkis Herrera 2008-05-19 08:01:41 UTC
Created attachment 16200 [details]
new output

fixed??
Comment 44 Andreas Herrmann 2008-05-19 14:37:04 UTC
Bad luck -- dmesg_output is readable but incomplete.
Just for your interest I am looking for output like:

ENABLING IO-APIC IRQs
init IO_APIC IRQs
IOAPIC[0]: Set routing entry (2-0 -> 0x30 -> IRQ 0 Mode:0 Active:0)
IOAPIC[0]: Set routing entry (2-1 -> 0x31 -> IRQ 1 Mode:0 Active:0)
...
IOAPIC[0]: Set routing entry (2-14 -> 0x3e -> IRQ 14 Mode:0 Active:0)
IOAPIC[0]: Set routing entry (2-15 -> 0x3f -> IRQ 15 Mode:0 Active:0)
 IO-APIC (apicid-pin) 2-16, 2-17, 2-18, 2-19, 2-20, 2-21, 2-22, 2-23 not connected.

and

PCI: Using ACPI for IRQ routing
number of MP IRQ sources: 16.
number of IO-APIC #2 registers: 24.
testing the IO APIC.......................

IO APIC #2......
.... register #00: 02000000
.......    : physical APIC id: 02
.... register #01: 00178021
.......     : max redirection entries: 0017
.......     : PRQ implemented: 1
.......     : IO APIC version: 0021
.... register #02: 02000000
.......     : arbitration: 02
.... IRQ redirection table:
 NR Dst Mask Trig IRR Pol Stat Dmod Deli Vect:   
 00 003 0    0    0   0   0    1    1    30
 01 003 0    0    0   0   0    1    1    31
 02 003 0    0    0   0   0    1    1    32
...
 15 000 1    0    0   0   0    0    0    00
 16 000 1    0    0   0   0    0    0    00
 17 000 1    0    0   0   0    0    0    00
IRQ to pin mappings:
IRQ0 -> 0:0
IRQ1 -> 0:1
IRQ2 -> 0:2
...
IRQ12 -> 0:12
IRQ13 -> 0:13
IRQ14 -> 0:14

which should be printed when you use the recommended debug options. But your dmesg starts beyond the place where this output usually occurs.
Comment 45 Anielkis Herrera 2008-05-20 10:53:46 UTC
Created attachment 16218 [details]
screenshot

I take this dissabling vesa, using boot_delay and recording a video

with vesafb the messages you need doesn't appear

do you need more pics or this is waht you need?
Comment 46 Andreas Herrmann 2008-05-20 13:34:39 UTC
Thanks, but ... well, my intention was to get reliable debug data
from your tests. Unfortunately taking pictures doesn't help much.
(BTW, your screenshot indeed contains some parts of the desired output ;-)
But to compare dmesg output of several boots, screenshots are not very helpful. I think w/o proper debugging means (e.g. serial console) it's not possible to fix the IO-A-PIC configuration on your machine to get hpet working.

Many similar issues with timer/hpet and IOAPIC pin assignment were reported
in the past. Often the problems went away when a BIOS update was applied,
(If a BIOS update with a suitable fix was available...)

It seems that you just have to live with a "broken" hpet on this machine.
The question is whether it is acceptable to use "hpet=disable" or
whether the blacklisting from Shaohua  (comment #36) should be applied.
Comment 47 Shaohua 2008-05-29 19:03:26 UTC
Anielkis, can you try boot option 'irqpoll'?
Comment 48 Anielkis Herrera 2008-07-12 05:30:34 UTC
(In reply to comment #47)
> Anielkis, can you try boot option 'irqpoll'?
> 
Shaohua, i have not access now to the HAIER, in a month i will.. and try it
Comment 49 Zhang Rui 2008-08-14 01:19:51 UTC
hah, Anielkis,
any updates?
Comment 50 herrmann.der.user 2008-09-04 06:15:52 UTC
HPET is usually not enabled in BIOS for SB4xx chipsets.
Thus almost all systems with SB4xx chipset do not provide
an HPET ACPI table.

On this system the vendor obviously decided to enable it.
But I guess he just provided an ACPI table without setting up
the proper bits to really enable the HPET.
(There are some bits in the chipset that must be set to enable interrupts
from HPET which are usually disabled.)

As ATI did not want to support HPET on SB400 it is not a
good idea to activate it.

Final solution is to use "nohpet" kernel option for this notebook.
(As long as the vendor does not provide a fixed BIOS w/o HPET ACPI table.)
Comment 51 Thomas Gleixner 2008-09-04 09:21:47 UTC
> Final solution is to use "nohpet" kernel option for this notebook.
> (As long as the vendor does not provide a fixed BIOS w/o HPET ACPI table.)

Shouldn't we HPET blacklist the SB4xx in that case ?

Thanks,
	tglx
Comment 52 Anielkis Herrera 2008-09-04 18:52:30 UTC
I'm late, sorry..
so, what are the parameters I have to check?

Now I have kernel 2.6.26 compiled
Comment 53 herrmann.der.user 2008-11-28 06:17:57 UTC
FYI, it might be worth to retest with 2.6.28-rc6.
It contains a patch to enable hpet interrupts on SB400.
(x86: hpet: modify IXP400 quirk to enable interrupts)
Comment 54 john stultz 2009-06-10 19:21:08 UTC
Any update on this bug? Anielkis Herrera, were you able to re-test with a post 2.6.28 kernel?
Comment 55 Anielkis Herrera 2009-06-10 20:44:28 UTC
this bug is fixed on 2.6.28 and earlier.. since ubuntu-8.10 it can boot without "nohpet"
Comment 56 john stultz 2009-06-10 20:51:56 UTC
Anielkis, thanks for the response. Closing.