[PATCH][2.6] local APIC LVTT init bug

From: Mikael Pettersson
Date: Thu Jan 22 2004 - 14:34:14 EST


__setup_APIC_LVTT() incorrectly sets i82489DX-only bits
which are reserved in integrated local APICs, causing
problems in some machines. Fixed in this patch by making
this setting conditional.

It's possible these bits don't need to be set on i82489DXs,
but not having this HW for testing I elected to maintain
our current behaviour on these old machines.

/Mikael

diff -ruN linux-2.6.2-rc1/arch/i386/kernel/apic.c linux-2.6.2-rc1.apic-lvtt-init-fix/arch/i386/kernel/apic.c
--- linux-2.6.2-rc1/arch/i386/kernel/apic.c 2003-10-18 11:59:45.000000000 +0200
+++ linux-2.6.2-rc1.apic-lvtt-init-fix/arch/i386/kernel/apic.c 2004-01-22 19:57:37.691617134 +0100
@@ -834,11 +834,13 @@

void __setup_APIC_LVTT(unsigned int clocks)
{
- unsigned int lvtt1_value, tmp_value;
+ unsigned int lvtt_value, tmp_value, ver;

- lvtt1_value = SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV) |
- APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
- apic_write_around(APIC_LVTT, lvtt1_value);
+ ver = GET_APIC_VERSION(apic_read(APIC_LVR));
+ lvtt_value = APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
+ if (!APIC_INTEGRATED(ver))
+ lvtt_value |= SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV);
+ apic_write_around(APIC_LVTT, lvtt_value);

/*
* Divide PICLK by 16
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/