mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans Lambrechts <hans.lambrechts@skynet.be>
To: linux-kernel@vger.kernel.org
Subject: Re: 2.4.21-pre2: CPU0 handles all interrupts
Date: Mon, 30 Dec 2002 12:40:04 +0100	[thread overview]
Message-ID: <200212301240.04998.hans.lambrechts@skynet.be> (raw)
In-Reply-To: <1041212142.1474.33.camel@irongate.swansea.linux.org.uk>

On Monday 30 December 2002 02:35, you wrote:
> On Sat, 2002-12-28 at 17:03, Ron Cooper wrote:
> > Mine does this too.  2.4.20.  Iwill dp400 board running dual 2.4Ghz
> > Xeons with HT enabled.
> >
> > I have to boot by passing "noapic" to the kernel, otherwise
> > /cat/proc/interrupts will show the interrupt numbers wrong,
> > however. not doing this changes nothing.
>
> "noapic" will deliver all IRQ's to IRQ0. Note btw - IRQ numbers *do*
> change in APIC mode

Hi Alan,
maybe this snippet from patch-2.4.21-pre2.gz is the culprit:

diff -Naur -X /home/marcelo/lib/dontdiff linux-2.4.20/arch/i386/kernel/apic.c linux-2.4.21/arch/i386/kernel/apic.c
--- linux-2.4.20/arch/i386/kernel/apic.c        2002-12-18 18:27:05.000000000 +0000
+++ linux-2.4.21/arch/i386/kernel/apic.c        2002-12-18 18:58:08.000000000 +0000
@@ -261,6 +261,16 @@
        apic_write_around(APIC_LVT1, value);
 }

+static unsigned long calculate_ldr(unsigned long old)
+{
+       unsigned long id;
+       if(clustered_apic_mode == CLUSTERED_APIC_XAPIC)
+               id = physical_to_logical_apicid(hard_smp_processor_id());
+       else
+               id = 1UL << smp_processor_id();
+       return (old & ~APIC_LDR_MASK)|SET_APIC_LOGICAL_ID(id);
+}
+
 void __init setup_local_APIC (void)
 {
        unsigned long value, ver, maxlvt;
@@ -298,15 +308,16 @@
                 * for us. Otherwise put the APIC into clustered or flat
                 * delivery mode. Must be "all ones" explicitly for 82489DX.
                 */
-               apic_write_around(APIC_DFR, APIC_DFR_FLAT);
+               if(clustered_apic_mode == CLUSTERED_APIC_XAPIC)
+                       apic_write_around(APIC_DFR, APIC_DFR_CLUSTER);
+               else
+                       apic_write_around(APIC_DFR, APIC_DFR_FLAT);

                /*
                 * Set up the logical destination ID.
                 */
                value = apic_read(APIC_LDR);
-               value &= ~APIC_LDR_MASK;
-               value |= (1<<(smp_processor_id()+24));
-               apic_write_around(APIC_LDR, value);
+               apic_write_around(APIC_LDR, calculate_ldr(value));
        }


  parent reply	other threads:[~2002-12-30 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-28  9:56 Hans Lambrechts
2002-12-28 17:03 ` Ron Cooper
2002-12-30  1:35   ` Alan Cox
2002-12-30  3:30     ` Ron Cooper
2002-12-30 11:40     ` Hans Lambrechts [this message]
2002-12-30 13:39       ` Alan Cox
2002-12-29  0:51 ` Alistair Riddell

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=200212301240.04998.hans.lambrechts@skynet.be \
    --to=hans.lambrechts@skynet.be \
    --cc=linux-kernel@vger.kernel.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®