linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ken Brownfield <ken@irridia.com>
To: marcelo@conectiva.com.br, macro@ds2.pg.gda.pl,
	manfred@colorfullife.com, alan@lxorguk.ukuu.org.uk,
	torvalds@transmeta.com, mhunter@archway.com
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: I/O APIC fixed in 2.4.19-pre3 & 2.5.6 (was Re: Linux 2.4.19-pre3)
Date: Mon, 18 Mar 2002 20:41:06 -0600	[thread overview]
Message-ID: <20020318204106.A24611@asooo.flowerfire.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0203111805480.2492-100000@freak.distro.conectiva> <20020311183746.A10303@asooo.flowerfire.com>

As a followup, this APIC patch also prevents 2.4 machines on quite a bit
of common hardware from freezing up after a few hours to a few days of
production use.  Especially ServerWorks boards distributed by HP and
Rackable/Tyan.

This patch (applied to 2.4.18) seems to fix my long-standing (and
oft-mentioned on LKML) I/O APIC issue with all 2.4 kernels, and I no
longer need my "pintimer" patch to disable the through-8259A mode.

Kudos to the authors -- this was definitely a hard one to find, and I
expect a lot of people will have more stable machines because of it.
I'm also sending this to the folks who helped me with this issue in the
past.

Good work!
-- 
Ken.
ken@irridia.com

<macro@ds2.pg.gda.pl> (02/03/05 1.466.1.12)
[PATCH] 2.4.18, 2.5.5: I/O APIC through-8259A mode IRQ 0 routing
  There is a problem with the through-8259A mode for IRQ 0 on I/O APIC
systems.  Depending on correctness of an MP table, IRQ 0 routing is
either not registered at all or registered at a wrong pin.  As a result
the 8254 timer IRQ only works by an accident (it's edge-triggered and
never disabled/enabled so it happens to survive this incorrect
configuration).  A visible effect is you can't change the affinity for
IRQ 0.  Following is a patch that fixes both cases referred to above.
The code looks obvious but it was additionally run-time tested just in
case.  The issue is serious -- please apply the patch ASAP.  As no
changes were done to io_apic.c since the development fork, the patch
applies cleanly both to 2.4 and to 2.5.  Credit goes to Joe for
discovering the affinity problem and providing a fix proposal
(incorporated in the final one).  Maciej


On Mon, Mar 11, 2002 at 06:37:46PM -0600, Ken Brownfield wrote:
| Can the authors of this patch post separately on what is fixed here?  I
| apply the following patch to work around an eventual hang of the machine
| due to IRQ0 being "attached" to the IO APIC, and I'm hoping that this
| 2.4.19-pre3 patch fixes my problem the correct way.  V.s. my workaround
| hack.
| 
| Thanks much,
| -- 
| Ken.
| brownfld@irridia.com
| 
| On Mon, Mar 11, 2002 at 06:08:19PM -0300, Marcelo Tosatti wrote:
| | - Fix through-8259A mode for IRQ0 routing on APIC 	(Maciej W. Rozycki/Joe Korty)
| 
| 
| --- linux/arch/i386/kernel/io_apic.c.orig	Tue Nov 13 17:28:41 2001
| +++ linux/arch/i386/kernel/io_apic.c	Tue Dec 18 15:10:45 2001
| @@ -172,6 +172,7 @@
|  int pirq_entries [MAX_PIRQS];
|  int pirqs_enabled;
|  int skip_ioapic_setup;
| +int pintimer_setup;
|  
|  static int __init ioapic_setup(char *str)
|  {
| @@ -179,7 +180,14 @@
|  	return 1;
|  }
|  
| +static int __init do_pintimer_setup(char *str)
| +{
| +	pintimer_setup = 1;
| +	return 1;
| +}
| +
|  __setup("noapic", ioapic_setup);
| +__setup("pintimer", do_pintimer_setup);
|  
|  static int __init ioapic_pirq_setup(char *str)
|  {
| @@ -1524,27 +1532,31 @@
|  		printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to IO-APIC\n");
|  	}
|  
| -	printk(KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... ");
| -	if (pin2 != -1) {
| -		printk("\n..... (found pin %d) ...", pin2);
| -		/*
| -		 * legacy devices should be connected to IO APIC #0
| -		 */
| -		setup_ExtINT_IRQ0_pin(pin2, vector);
| -		if (timer_irq_works()) {
| -			printk("works.\n");
| -			if (nmi_watchdog == NMI_IO_APIC) {
| -				setup_nmi();
| -				check_nmi_watchdog();
| +	if ( pintimer_setup )
| +		printk(KERN_INFO "...skipping 8259A init for IRQ0\n");
| +	else {
| +		printk(KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... ");
| +		if (pin2 != -1) {
| +			printk("\n..... (found pin %d) ...", pin2);
| +			/*
| +			 * legacy devices should be connected to IO APIC #0
| +			 */
| +			setup_ExtINT_IRQ0_pin(pin2, vector);
| +			if (timer_irq_works()) {
| +				printk("works.\n");
| +				if (nmi_watchdog == NMI_IO_APIC) {
| +					setup_nmi();
| +					check_nmi_watchdog();
| +				}
| +				return;
|  			}
| -			return;
| +			/*
| +			 * Cleanup, just in case ...
| +			 */
| +			clear_IO_APIC_pin(0, pin2);
|  		}
| -		/*
| -		 * Cleanup, just in case ...
| -		 */
| -		clear_IO_APIC_pin(0, pin2);
| +		printk(" failed.\n");
|  	}
| -	printk(" failed.\n");
|  
|  	if (nmi_watchdog) {
|  		printk(KERN_WARNING "timer doesnt work through the IO-APIC - disabling NMI Watchdog!\n");
| -
| To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
| the body of a message to majordomo@vger.kernel.org
| More majordomo info at  http://vger.kernel.org/majordomo-info.html
| Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2002-03-19  2:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-11 21:08 Linux 2.4.19-pre3 Marcelo Tosatti
2002-03-11 22:40 ` Eyal Lebedinsky
2002-03-11 23:03   ` Alan Cox
2002-03-11 22:55 ` Stephan von Krawczynski
2002-03-12  1:50   ` Mike Fedyk
2002-03-12 11:06   ` Stephan von Krawczynski
2002-03-11 23:04 ` Eyal Lebedinsky
2002-03-11 23:14   ` Keith Owens
2002-03-12 15:49   ` DevilKin
2002-03-21 12:06   ` [patch] Don't offer CONFIG_INDYDOG on non-ip22 machines Adrian Bunk
2002-03-22 21:13     ` Marcelo Tosatti
2002-03-11 23:21 ` Linux 2.4.19-pre3 Eyal Lebedinsky
2002-03-12  1:40   ` Takeo Saito
2002-03-12  0:04 ` J.A. Magallon
2002-03-12  0:37 ` Ken Brownfield
2002-03-19  2:41   ` Ken Brownfield [this message]
2002-03-19 16:22     ` I/O APIC fixed in 2.4.19-pre3 & 2.5.6 (was Re: Linux 2.4.19-pre3) Bill Davidsen
2002-03-20  0:34       ` Ken Brownfield
2002-03-20  4:36         ` Bill Davidsen
2002-03-12 10:35 ` Linux 2.4.19-pre3 Gerd Knorr
2002-03-12 17:24   ` Trond Myklebust
2002-03-12 17:47   ` Gerd Knorr
2002-03-12 13:01 ` Karsten Weiss
2002-03-12 13:17   ` Jens Axboe
2002-03-12 13:37   ` Alan Cox
2002-03-12 13:46   ` Jens Axboe
2002-03-12 19:02     ` Marcelo Tosatti
2002-03-13  8:09       ` Jens Axboe
2002-03-13  9:00         ` Andre Hedrick
2002-03-13  9:27           ` Jens Axboe
2002-03-13  9:33             ` Andre Hedrick
2002-03-13 17:32               ` Andre Hedrick
2002-03-13 17:40                 ` Jens Axboe
2002-03-13 18:52                   ` Andre Hedrick
2002-03-14  4:41           ` Marcelo Tosatti
2002-03-14  6:28             ` Andre Hedrick
2002-03-14  3:32         ` Michal Jaegermann
2002-03-12 14:47   ` J.A. Magallon
2002-03-12 13:31 ` Jurgen Philippaerts
2002-03-12 15:43 ` Geert Uytterhoeven
2002-03-12 21:59 ` Paul Mackerras
2002-03-20  2:40 I/O APIC fixed in 2.4.19-pre3 & 2.5.6 (was Re: Linux 2.4.19-pre3) PlasmaJohn
2002-03-20  4:30 ` Bill Davidsen

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=20020318204106.A24611@asooo.flowerfire.com \
    --to=ken@irridia.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@ds2.pg.gda.pl \
    --cc=manfred@colorfullife.com \
    --cc=marcelo@conectiva.com.br \
    --cc=mhunter@archway.com \
    --cc=torvalds@transmeta.com \
    /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;
as well as URLs for NNTP newsgroup(s).