public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Suresh Siddha <suresh.b.siddha@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] x86, ioapic: Print out irte  with right ioapic index
Date: Fri, 22 Jul 2011 11:18:18 -0700	[thread overview]
Message-ID: <4E29BEEA.4020600@kernel.org> (raw)
In-Reply-To: <CAErSpo5CzU2j81moWLsHDoRxTs5107=AEAWYi3ezy3Xfw86qiQ@mail.gmail.com>


While checking irte dump in dmesg, the print out is confused ioapic index
and real io apic id.

IOAPIC[0]: Set routing entry (1-1 -> 0x31 -> IRQ 1 Mode:0 Active:0 Dest:1)
IOAPIC[1]: Set IRTE entry (P:1 FPD:0 Dst_Mode:1 Redir_hint:1 Trig_Mode:0 Dlvry_Mode:1 Avail:0 Vector:31 Dest:00000001 SID:00FF SQ:0 SVT:1)
IOAPIC[0]: Set routing entry (1-2 -> 0x30 -> IRQ 0 Mode:0 Active:0 Dest:1)
IOAPIC[1]: Set IRTE entry (P:1 FPD:0 Dst_Mode:1 Redir_hint:1 Trig_Mode:0 Dlvry_Mode:1 Avail:0 Vector:30 Dest:00000001 SID:00FF SQ:0 SVT:1)

The system first ioapic id is 1.

Try to fix it with passing ioapic idx instead of phys apic id.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/kernel/apic/io_apic.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/x86/kernel/apic/io_apic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6/arch/x86/kernel/apic/io_apic.c
@@ -1255,7 +1255,7 @@ static void ioapic_register_intr(unsigne
 				      fasteoi ? "fasteoi" : "edge");
 }
 
-static int setup_ioapic_entry(int apic_id, int irq,
+static int setup_ioapic_entry(int ioapic, int irq,
 			      struct IO_APIC_route_entry *entry,
 			      unsigned int destination, int trigger,
 			      int polarity, int vector, int pin)
@@ -1266,6 +1266,7 @@ static int setup_ioapic_entry(int apic_i
 	memset(entry,0,sizeof(*entry));
 
 	if (intr_remapping_enabled) {
+		int apic_id = mpc_ioapic_id(ioapic);
 		struct intel_iommu *iommu = map_ioapic_to_ir(apic_id);
 		struct irte irte;
 		struct IR_IO_APIC_route_entry *ir_entry =
@@ -1301,7 +1302,7 @@ static int setup_ioapic_entry(int apic_i
 			"Redir_hint:%d Trig_Mode:%d Dlvry_Mode:%X "
 			"Avail:%X Vector:%02X Dest:%08X "
 			"SID:%04X SQ:%X SVT:%X)\n",
-			apic_id, irte.present, irte.fpd, irte.dst_mode,
+			ioapic, irte.present, irte.fpd, irte.dst_mode,
 			irte.redir_hint, irte.trigger_mode, irte.dlvry_mode,
 			irte.avail, irte.vector, irte.dest_id,
 			irte.sid, irte.sq, irte.svt);
@@ -1352,7 +1353,7 @@ static void setup_ioapic_irq(int apic_id
 		    irq, trigger, polarity, dest);
 
 
-	if (setup_ioapic_entry(mpc_ioapic_id(apic_id), irq, &entry,
+	if (setup_ioapic_entry(apic_id, irq, &entry,
 			       dest, trigger, polarity, cfg->vector, pin)) {
 		printk("Failed to setup ioapic entry for ioapic  %d, pin %d\n",
 		       mpc_ioapic_id(apic_id), pin);

  reply	other threads:[~2011-07-22 18:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-14 15:31 [PATCH] x86, ioapic: Clean up ioapic/apic_id usage Yinghai Lu
2011-07-15 15:41 ` Bjorn Helgaas
2011-07-22 18:18   ` Yinghai Lu [this message]
2011-07-22 18:19     ` [PATCH 2/2] " Yinghai Lu
2011-07-25  7:29       ` Ingo Molnar
2011-07-25  7:28     ` [PATCH 1/2] x86, ioapic: Print out irte with right ioapic index Ingo Molnar
2011-07-29 22:33       ` [PATCH 0/5] x86, ioapic: Clean up ioapic idx and apic id usage Yinghai Lu
     [not found]       ` <4E33334D.1030007@kernel.org>
2011-07-29 22:34         ` [PATCH 1/5] x86, ioapic: Passing irq_attr struct pointer with setup_ioapic_irq() Yinghai Lu
2011-07-29 22:34         ` [PATCH 2/5] x86, ioapic: Split setup_ioapic_entry for interrupt remapped version Yinghai Lu
2011-07-29 22:34         ` [PATCH 3/5] x86, ioapic: Print out irte with right ioapic index Yinghai Lu
2011-07-29 22:34         ` [PATCH 4/5] x86, ioapic: Seperate print_IO_APIC() to only print one io apic Yinghai Lu
2011-07-29 22:34         ` [PATCH 5/5] x86, ioapic: Clean up ioapic/apic_id usage Yinghai Lu
2011-10-12  7:33         ` [PATCH 1/5] x86, ioapic: Passing irq_attr struct pointer with setup_ioapic_irq() Yinghai Lu
2011-10-12  7:33         ` [PATCH 2/5] x86, ioapic: Split setup_ioapic_entry for interrupt remapped version Yinghai Lu
2011-10-12  7:33         ` [PATCH 3/5] x86, ioapic: Print out irte with right ioapic index Yinghai Lu
2011-10-12  7:33         ` [PATCH 4/5] x86, ioapic: Seperate print_IO_APIC() to only print one io apic Yinghai Lu
2011-10-12  7:33         ` [PATCH 5/5] x86, ioapic: Clean up ioapic/apic_id usage Yinghai Lu
2011-10-12  7:32       ` [PATCH 0/5 resend] x86, ioapic: Clean up ioapic idx and apic id usage Yinghai Lu
2011-10-12  9:47         ` Ingo Molnar

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=4E29BEEA.4020600@kernel.org \
    --to=yinghai@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nagananda.chumbalkar@hp.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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