mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@user.it.uu.se>
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH][2.6] local APIC LVTT init bug
Date: Thu, 22 Jan 2004 20:32:49 +0100	[thread overview]
Message-ID: <16400.9569.745184.16182@alkaid.it.uu.se> (raw)

__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

             reply	other threads:[~2004-01-22 19:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22 19:32 Mikael Pettersson [this message]
2004-01-23 12:06 ` Maciej W. Rozycki
2004-01-23 12:57   ` Mikael Pettersson
2004-01-23 13:31     ` Maciej W. Rozycki
2004-01-23 15:51       ` Linus Torvalds
2004-01-23 17:23         ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16400.9569.745184.16182@alkaid.it.uu.se \
    --to=mikpe@user.it.uu.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®