linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] i386: port ATI timer fix from x86_64 to i386
@ 2006-02-28 21:17 Chuck Ebbert
  2006-02-28 23:21 ` Andrew Morton
  2006-03-01 13:59 ` Alistair John Strachan
  0 siblings, 2 replies; 12+ messages in thread
From: Chuck Ebbert @ 2006-02-28 21:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Linus Torvalds

Disable timer routing over 8254 when an ATI chipset is detected
(autodetect is only implemented for ACPI, but these are new systems
and should be using ACPI anyway.)  Adds boot options for manually
disabling and enabling this feature. Also adds a note to the timer
error message caused by this change explaining that this error
is expected on ATI chipsets.

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>

---

 This would be nice for 2.6.16 but I don't recommend it because of the
diversity of i386 hardware.

 Documentation/kernel-parameters.txt |   33 ++++++++++++++++++++++-----------
 arch/i386/kernel/acpi/earlyquirk.c  |   12 ++++++++++++
 arch/i386/kernel/io_apic.c          |   21 +++++++++++++++++++--
 include/asm-i386/acpi.h             |    1 +
 4 files changed, 54 insertions(+), 13 deletions(-)

--- 2.6.16-rc5-d2.orig/Documentation/kernel-parameters.txt
+++ 2.6.16-rc5-d2/Documentation/kernel-parameters.txt
@@ -80,6 +80,7 @@ restrictions referred to are that the re
 	VT	Virtual terminal support is enabled.
 	WDT	Watchdog support is enabled.
 	XT	IBM PC/XT MFM hard disk support is enabled.
+	X86	Either X86-64 or IA-32 (i386) is enabled
 	X86-64	X86-64 architecture is enabled.
 			More X86-64 boot options can be found in
 			Documentation/x86_64/boot-options.txt .
@@ -167,16 +168,6 @@ running once the system is up.
 			override platform specific driver.
 			See also Documentation/acpi-hotkey.txt.
 
-	enable_timer_pin_1 [i386,x86-64]
-			Enable PIN 1 of APIC timer
-			Can be useful to work around chipset bugs
-			(in particular on some ATI chipsets).
-			The kernel tries to set a reasonable default.
-
-	disable_timer_pin_1 [i386,x86-64]
-			Disable PIN 1 of APIC timer
-			Can be useful to work around chipset bugs.
-
 	ad1816=		[HW,OSS]
 			Format: <io>,<irq>,<dma>,<dma2>
 			See also Documentation/sound/oss/AD1816.
@@ -226,7 +217,7 @@ running once the system is up.
 			not play well with APC CPU idle - disable it if you have
 			APC and your system crashes randomly.
 
-	apic=		[APIC,i386] Change the output verbosity whilst booting
+	apic=		[APIC,X86] Change the output verbosity whilst booting
 			Format: { quiet (default) | verbose | debug }
 			Change the amount of debugging information output
 			when initialising the APIC and IO-APIC components.
@@ -423,6 +414,16 @@ running once the system is up.
 			See drivers/char/README.epca and
 			Documentation/digiepca.txt.
 
+	disable_8254_timer [X86]
+			Disable interrupt 0 timer routing over the 8254
+			in addition to over the IO-APIC. The kernel tries
+			to set a sensible default.
+
+	disable_timer_pin_1 [X86]
+			Disable PIN 1 of APIC timer
+			Can be useful to work around chipset bugs
+			(in particular on some ATI chipsets).
+
 	dmascc=		[HW,AX25,SERIAL] AX.25 Z80SCC driver with DMA
 			support available.
 			Format: <io_dev0>[,<io_dev1>[,..<io_dev32>]]
@@ -486,6 +487,16 @@ running once the system is up.
 			pass this option to capture kernel.
 			See Documentation/kdump/kdump.txt for details.
 
+	enable_8254_timer [X86]
+			Enable interrupt 0 timer routing over the 8254
+			in addition to over the IO-APIC. The kernel tries
+			to set a sensible default.
+
+	enable_timer_pin_1 [X86]
+			Enable PIN 1 of APIC timer
+			Can be useful to work around chipset bugs
+			(in particular on some ATI chipsets).
+
 	enforcing	[SELINUX] Set initial enforcing status.
 			Format: {"0" | "1"}
 			See security/selinux/Kconfig help text.
--- 2.6.16-rc5-d2.orig/arch/i386/kernel/acpi/earlyquirk.c
+++ 2.6.16-rc5-d2/arch/i386/kernel/acpi/earlyquirk.c
@@ -15,6 +15,18 @@ static int __init check_bridge(int vendo
 	if (vendor == PCI_VENDOR_ID_NVIDIA) {
 		acpi_skip_timer_override = 1;
 	}
+#ifdef CONFIG_X86_IO_APIC
+	/* Many ATI boards have timer problems.  This fix should
+	 * be harmless even on non-ATI boards, but play it safe.
+	 */
+	if (vendor == PCI_VENDOR_ID_ATI) {
+		if (timer_over_8254 == 1) {
+			timer_over_8254 = 0;
+			printk(KERN_INFO "ATI board detected. "
+					 "Disabling timer routing over 8254.\n"
+		}
+	}
+#endif
 	return 0;
 }
 
--- 2.6.16-rc5-d2.orig/arch/i386/kernel/io_apic.c
+++ 2.6.16-rc5-d2/arch/i386/kernel/io_apic.c
@@ -64,6 +64,22 @@ int nr_ioapic_registers[MAX_IO_APICS];
 
 int disable_timer_pin_1 __initdata;
 
+int timer_over_8254 __initdata = 1;
+
+static int __init setup_disable_8254_timer(char *s)
+{
+	timer_over_8254 = -1;
+	return 1;
+}
+__setup("disable_8254_timer", setup_disable_8254_timer);
+
+static int __init setup_enable_8254_timer(char *s)
+{
+	timer_over_8254 = 2;
+	return 1;
+}
+__setup("enable_8254_timer", setup_enable_8254_timer);
+
 /*
  * Rough estimation of how many shared IRQs there are, can
  * be changed anytime.
@@ -2267,7 +2283,8 @@ static inline void check_timer(void)
 	apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
 	init_8259A(1);
 	timer_ack = 1;
-	enable_8259A_irq(0);
+	if (timer_over_8254 > 0)
+		enable_8259A_irq(0);
 
 	pin1  = find_isa_irq_pin(0, mp_INT);
 	apic1 = find_isa_irq_apic(0, mp_INT);
@@ -2294,7 +2311,7 @@ static inline void check_timer(void)
 		}
 		clear_IO_APIC_pin(apic1, pin1);
 		printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
-				"IO-APIC\n");
+				"IO-APIC (expected on ATI chipsets)\n");
 	}
 
 	printk(KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... ");
--- 2.6.16-rc5-d2.orig/include/asm-i386/acpi.h
+++ 2.6.16-rc5-d2/include/asm-i386/acpi.h
@@ -127,6 +127,7 @@ extern int acpi_gsi_to_irq(u32 gsi, unsi
 #ifdef CONFIG_X86_IO_APIC
 extern int skip_ioapic_setup;
 extern int acpi_skip_timer_override;
+extern int timer_over_8254;
 
 extern void check_acpi_pci(void);
 
-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
  2006-02-28 21:17 Chuck Ebbert
@ 2006-02-28 23:21 ` Andrew Morton
  2006-03-01 13:59 ` Alistair John Strachan
  1 sibling, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2006-02-28 23:21 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: linux-kernel, torvalds

Chuck Ebbert <76306.1226@compuserve.com> wrote:
>
> Disable timer routing over 8254 when an ATI chipset is detected
>  (autodetect is only implemented for ACPI, but these are new systems
>  and should be using ACPI anyway.)  Adds boot options for manually
>  disabling and enabling this feature. Also adds a note to the timer
>  error message caused by this change explaining that this error
>  is expected on ATI chipsets.

umm, why did you write this patch?  Presumably it's fixing something, but
what?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
@ 2006-03-01  0:03 Chuck Ebbert
  2006-03-01  0:15 ` Andrew Morton
  0 siblings, 1 reply; 12+ messages in thread
From: Chuck Ebbert @ 2006-03-01  0:03 UTC (permalink / raw)
  To: Andrew Morton; +Cc: torvalds, linux-kernel

In-Reply-To: <20060228152124.616e6c1c.akpm@osdl.org>

On Tue, 28 Feb 2006 15:21:24, Andrew Morton wrote:

> Chuck Ebbert <76306.1226@compuserve.com> wrote:
> >
> > Disable timer routing over 8254 when an ATI chipset is detected
> >  (autodetect is only implemented for ACPI, but these are new systems
> >  and should be using ACPI anyway.)  Adds boot options for manually
> >  disabling and enabling this feature. Also adds a note to the timer
> >  error message caused by this change explaining that this error
> >  is expected on ATI chipsets.
> 
> umm, why did you write this patch?  Presumably it's fixing something, but
> what?

Oops...  I'm here in the middle of the forest and all I can see are trees.

This fixes the "timer runs too fast" bug on ATI chipsets (bugzilla #3927).


-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
  2006-03-01  0:03 Chuck Ebbert
@ 2006-03-01  0:15 ` Andrew Morton
  2006-03-01 10:40   ` Andi Kleen
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2006-03-01  0:15 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: torvalds, linux-kernel

Chuck Ebbert <76306.1226@compuserve.com> wrote:
>
>  This fixes the "timer runs too fast" bug on ATI chipsets (bugzilla #3927).

Wonderful, thanks.  What's the relationship (if any) between this and the
recently-merged x86_64 fix?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
@ 2006-03-01  1:18 Parag Warudkar
  0 siblings, 0 replies; 12+ messages in thread
From: Parag Warudkar @ 2006-03-01  1:18 UTC (permalink / raw)
  To: Andrew Morton, Chuck Ebbert; +Cc: torvalds, linux-kernel


 -------------- Original message ----------------------
From: Andrew Morton <akpm@osdl.org>
> Chuck Ebbert <76306.1226@compuserve.com> wrote:
> >
> >  This fixes the "timer runs too fast" bug on ATI chipsets (bugzilla #3927).
> 

At least HP has released a BIOS update[*] to cure this - It states something to the tune of "Fix system time issues when running under Linux OS".  Not sure which one is the workaround and whether one is needed if other is present! 
Time runs correctly for me without this fix and with the BIOS update.

Parag

[*] http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?dlc=en&lc=en&os=228&product=461746&lang=en&cc=us&softwareitem=ob-36843-1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
@ 2006-03-01  2:22 Chuck Ebbert
  0 siblings, 0 replies; 12+ messages in thread
From: Chuck Ebbert @ 2006-03-01  2:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, torvalds

In-Reply-To: <20060228161512.0cdbe560.akpm@osdl.org>

On Tue, 28 Feb 2006 16:15:12, andrew Morton wrote:

> >
> >  This fixes the "timer runs too fast" bug on ATI chipsets (bugzilla #3927).
> 
> Wonderful, thanks.  What's the relationship (if any) between this and the
> recently-merged x86_64 fix?

This is the same fix ported to i386 for people with Sempron processors
or running i386 kernels on x86_64 systems.

The problems with the earlier disable_timer_pin_1 fix don't seem to happen with
this one; I even booted an old i386 SMP machine with the new boot option
'disable_8254_timer' and it worked fine.

-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
  2006-03-01  0:15 ` Andrew Morton
@ 2006-03-01 10:40   ` Andi Kleen
  2006-03-01 10:52     ` Andrew Morton
  0 siblings, 1 reply; 12+ messages in thread
From: Andi Kleen @ 2006-03-01 10:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: torvalds, linux-kernel

Andrew Morton <akpm@osdl.org> writes:

> Chuck Ebbert <76306.1226@compuserve.com> wrote:
> >
> >  This fixes the "timer runs too fast" bug on ATI chipsets (bugzilla #3927).
> 
> Wonderful, thanks.  What's the relationship (if any) between this and the
> recently-merged x86_64 fix?

He just ported the x86-64 change over without any original authorship
attribution :/

And some less functionality (only works for ACPI now) and some totally
unrelated Documentation cleanup and a few random printk changes.

The ACPI only thing is probably mostly ok because the timing won't work
at least on the dual cores without ACPI anyways because PMtimer is needed.
On single cores it would be useful even without ACPI
(for that earlyquirk.c just would need to be moved up to run independently
of ACPI) 

Still it's probably a good idea for 2.6.16.

-Andi
 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
  2006-03-01 10:40   ` Andi Kleen
@ 2006-03-01 10:52     ` Andrew Morton
  2006-03-01 11:07       ` Andi Kleen
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2006-03-01 10:52 UTC (permalink / raw)
  To: Andi Kleen; +Cc: torvalds, linux-kernel, Chuck Ebbert


(Cc: fixed.  Please send me a copy of your MUA so I can ritually disembowel
it).

Andi Kleen <ak@suse.de> wrote:
>
> Andrew Morton <akpm@osdl.org> writes:
> 
> > Chuck Ebbert <76306.1226@compuserve.com> wrote:
> > >
> > >  This fixes the "timer runs too fast" bug on ATI chipsets (bugzilla #3927).
> > 
> > Wonderful, thanks.  What's the relationship (if any) between this and the
> > recently-merged x86_64 fix?
> 
> He just ported the x86-64 change over without any original authorship
> attribution :/

Yup.  And he proved that I am incapable of understanding a simple email
Subject:

> And some less functionality (only works for ACPI now) and some totally
> unrelated Documentation cleanup and a few random printk changes.
> 
> The ACPI only thing is probably mostly ok because the timing won't work
> at least on the dual cores without ACPI anyways because PMtimer is needed.
> On single cores it would be useful even without ACPI
> (for that earlyquirk.c just would need to be moved up to run independently
> of ACPI) 
> 
> Still it's probably a good idea for 2.6.16.
> 

Well..  the patch had a flagrant won't-compile if CONFIG_X86_IO_APIC=y, so
I'd consider it a bit green.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
  2006-03-01 10:52     ` Andrew Morton
@ 2006-03-01 11:07       ` Andi Kleen
  0 siblings, 0 replies; 12+ messages in thread
From: Andi Kleen @ 2006-03-01 11:07 UTC (permalink / raw)
  To: Andrew Morton; +Cc: torvalds, linux-kernel, Chuck Ebbert

On Wednesday 01 March 2006 11:52, Andrew Morton wrote:
> 
> (Cc: fixed.  Please send me a copy of your MUA so I can ritually disembowel
> it).

Well it's an MNA really in this case - i read l-k using gated news with gnus.
 
> Well..  the patch had a flagrant won't-compile if CONFIG_X86_IO_APIC=y, so
> I'd consider it a bit green.

Ok - i guess it would be better to redo it anyways to handle the non ACPI case
too. I can do that.

-Andi

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
  2006-02-28 21:17 Chuck Ebbert
  2006-02-28 23:21 ` Andrew Morton
@ 2006-03-01 13:59 ` Alistair John Strachan
  1 sibling, 0 replies; 12+ messages in thread
From: Alistair John Strachan @ 2006-03-01 13:59 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: linux-kernel, Andrew Morton, Linus Torvalds

On Tuesday 28 February 2006 21:17, Chuck Ebbert wrote:
> Disable timer routing over 8254 when an ATI chipset is detected
> (autodetect is only implemented for ACPI, but these are new systems
> and should be using ACPI anyway.)  Adds boot options for manually
> disabling and enabling this feature. Also adds a note to the timer
> error message caused by this change explaining that this error
> is expected on ATI chipsets.
[snip]
>
>  	pin1  = find_isa_irq_pin(0, mp_INT);
>  	apic1 = find_isa_irq_apic(0, mp_INT);
> @@ -2294,7 +2311,7 @@ static inline void check_timer(void)
>  		}
>  		clear_IO_APIC_pin(apic1, pin1);
>  		printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
> -				"IO-APIC\n");
> +				"IO-APIC (expected on ATI chipsets)\n");
>  	}
>

This hunk looks bogus. My understanding is that this is a BIOS bug that some 
vendors have started to correct. We shouldn't acknowledge vendor BIOS bugs as 
"expected", imo..

I had this message for years with my nForce2/nForce3 boards and eventually it 
was repaired.

-- 
Cheers,
Alistair.

'No sense being pessimistic, it probably wouldn't work anyway.'
Third year Computer Science undergraduate.
1F2 55 South Clerk Street, Edinburgh, UK.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
@ 2006-03-01 15:50 Chuck Ebbert
  0 siblings, 0 replies; 12+ messages in thread
From: Chuck Ebbert @ 2006-03-01 15:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, torvalds, Andi Kleen

In-Reply-To: <20060301025219.2034924c.akpm@osdl.org>

On Wed, 1 Mar 2006 02:52:19, Andrew Morton wrote:

> > 
> > Still it's probably a good idea for 2.6.16.
> > 
> 
> Well..  the patch had a flagrant won't-compile if CONFIG_X86_IO_APIC=y, so
> I'd consider it a bit green.

Aargh... I hit that and fixed it, but forgot to refresh before sending.

The only thing I didn't test was whether the boot options worked, and
I just did that -- 'enable_8254_timer' makes the clock run too fast as
expected.

And credit to Andi was implicit in the "port from x86_64" but it should
have been explicit.


-- 
Chuck
"The sleet in Crete falls neatly in the street."


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] i386: port ATI timer fix from x86_64 to i386
@ 2006-03-01 17:10 Chuck Ebbert
  0 siblings, 0 replies; 12+ messages in thread
From: Chuck Ebbert @ 2006-03-01 17:10 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andrew Morton, Linus Torvalds, linux-kernel

In-Reply-To: <p73psl6zbwf.fsf@verdi.suse.de>

On 01 Mar 2006 11:40:00, Andi Kleen wrote:

> > Wonderful, thanks.  What's the relationship (if any) between this and the
> > recently-merged x86_64 fix?
>
> He just ported the x86-64 change over without any original authorship
> attribution :/

Oops, sorry about that.  Since I wrote "ported from x86_64" I assumed
credit was implicit.

> And some less functionality (only works for ACPI now)

I documented that. Without ACPI there wasn't infrastructure to do the early
PCI scan.

> and some totally unrelated Documentation cleanup

I added the two new boot options.  While doing that I noticed the *timer_pin_1
docs weren't in alphabetical order so I moved them.

> and a few random printk changes

One printk change.  The other was an exact port of the message from x86_64.
And the change I made wasn't random.  It might have been a bad idea but
it wasn't random.


-- 
Chuck
"The sleet in Crete falls neatly in the street."


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-03-01 17:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-01 15:50 [patch] i386: port ATI timer fix from x86_64 to i386 Chuck Ebbert
  -- strict thread matches above, loose matches on Subject: below --
2006-03-01 17:10 Chuck Ebbert
2006-03-01  2:22 Chuck Ebbert
2006-03-01  1:18 Parag Warudkar
2006-03-01  0:03 Chuck Ebbert
2006-03-01  0:15 ` Andrew Morton
2006-03-01 10:40   ` Andi Kleen
2006-03-01 10:52     ` Andrew Morton
2006-03-01 11:07       ` Andi Kleen
2006-02-28 21:17 Chuck Ebbert
2006-02-28 23:21 ` Andrew Morton
2006-03-01 13:59 ` Alistair John Strachan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).