From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Len Brown <lenb@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-pci@vger.kernel.org,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: [PATCH 2/7] x86/acpi: calling mp_config_acpi_gsi in mp_register_gsi -v2
Date: Wed, 06 May 2009 10:06:15 -0700 [thread overview]
Message-ID: <4A01C387.7090103@kernel.org> (raw)
In-Reply-To: <4A01C35C.7060207@kernel.org>
it seems that change about calling mp_config_acpi_gsi in acpi_pci_irq_enable()
never get into mainline.
actually we could call that in mp_register_gsi with struct device...
also could make mp_config_acpi_gsi to be static
v2: some calling could have to be pci device, need to check that
[Impact: make update_mptable working]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/include/asm/mpspec.h | 9 -----
arch/x86/kernel/acpi/boot.c | 66 +++++++++++++++++++++++++-----------------
2 files changed, 40 insertions(+), 35 deletions(-)
Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/mpspec.h
+++ linux-2.6/arch/x86/include/asm/mpspec.h
@@ -77,17 +77,8 @@ extern int mp_register_gsi(struct device
int active_high_low);
extern int acpi_probe_gsi(void);
#ifdef CONFIG_X86_IO_APIC
-extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
- u32 gsi, int triggering, int polarity);
extern int mp_find_ioapic(int gsi);
extern int mp_find_ioapic_pin(int ioapic, int gsi);
-#else
-static inline int
-mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
- u32 gsi, int triggering, int polarity)
-{
- return 0;
-}
#endif
#else /* !CONFIG_ACPI: */
static inline int acpi_probe_gsi(void)
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/acpi/boot.c
+++ linux-2.6/arch/x86/kernel/acpi/boot.c
@@ -33,6 +33,7 @@
#include <linux/irq.h>
#include <linux/bootmem.h>
#include <linux/ioport.h>
+#include <linux/pci.h>
#include <asm/pgtable.h>
#include <asm/io_apic.h>
@@ -1158,6 +1159,44 @@ void __init mp_config_acpi_legacy_irqs(v
}
}
+static int mp_config_acpi_gsi(struct device *dev, u32 gsi, int triggering,
+ int polarity)
+{
+#ifdef CONFIG_X86_MPPARSE
+ struct mpc_intsrc mp_irq;
+ struct pci_dev *pdev;
+ unsigned char number;
+ unsigned int devfn;
+ int ioapic;
+ u8 pin;
+
+ if (!acpi_ioapic)
+ return 0;
+ if (!dev)
+ return 0;
+ if (dev->bus != &pci_bus_type)
+ return 0;
+
+ pdev = to_pci_dev(dev);
+ number = pdev->bus->number;
+ devfn = pdev->devfn;
+ pin = pdev->pin;
+ /* print the entry should happen on mptable identically */
+ mp_irq.type = MP_INTSRC;
+ mp_irq.irqtype = mp_INT;
+ mp_irq.irqflag = (triggering == ACPI_EDGE_SENSITIVE ? 4 : 0x0c) |
+ (polarity == ACPI_ACTIVE_HIGH ? 1 : 3);
+ mp_irq.srcbus = number;
+ mp_irq.srcbusirq = (((devfn >> 3) & 0x1f) << 2) | ((pin - 1) & 3);
+ ioapic = mp_find_ioapic(gsi);
+ mp_irq.dstapic = mp_ioapic_routing[ioapic].apic_id;
+ mp_irq.dstirq = mp_find_ioapic_pin(ioapic, gsi);
+
+ save_mp_irq(&mp_irq);
+#endif
+ return 0;
+}
+
int mp_register_gsi(struct device *dev, u32 gsi, int triggering, int polarity)
{
int ioapic;
@@ -1189,6 +1228,7 @@ int mp_register_gsi(struct device *dev,
ioapic_pin);
return gsi;
}
+ mp_config_acpi_gsi(dev, gsi, triggering, polarity);
/*
* Avoid pin reprogramming. PRTs typically include entries
@@ -1208,32 +1248,6 @@ int mp_register_gsi(struct device *dev,
return gsi;
}
-int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
- u32 gsi, int triggering, int polarity)
-{
-#ifdef CONFIG_X86_MPPARSE
- struct mpc_intsrc mp_irq;
- int ioapic;
-
- if (!acpi_ioapic)
- return 0;
-
- /* print the entry should happen on mptable identically */
- mp_irq.type = MP_INTSRC;
- mp_irq.irqtype = mp_INT;
- mp_irq.irqflag = (triggering == ACPI_EDGE_SENSITIVE ? 4 : 0x0c) |
- (polarity == ACPI_ACTIVE_HIGH ? 1 : 3);
- mp_irq.srcbus = number;
- mp_irq.srcbusirq = (((devfn >> 3) & 0x1f) << 2) | ((pin - 1) & 3);
- ioapic = mp_find_ioapic(gsi);
- mp_irq.dstapic = mp_ioapic_routing[ioapic].apic_id;
- mp_irq.dstirq = mp_find_ioapic_pin(ioapic, gsi);
-
- save_mp_irq(&mp_irq);
-#endif
- return 0;
-}
-
/*
* Parse IOAPIC related entries in MADT
* returns 0 on success, < 0 on error
next prev parent reply other threads:[~2009-05-06 17:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-06 17:05 [PATCH 1/7] x86/acpi: remove compress irq trick for 32bit Yinghai Lu
2009-05-06 17:06 ` Yinghai Lu [this message]
2009-05-11 9:52 ` [tip:irq/numa] x86/acpi: call mp_config_acpi_gsi() in mp_register_gsi() tip-bot for Yinghai Lu
2009-05-14 16:20 ` [PATCH 2/7] x86/acpi: calling mp_config_acpi_gsi in mp_register_gsi -v2 Len Brown
2009-05-14 17:43 ` Yinghai Lu
2009-05-06 17:07 ` [PATCH 3/7] x86: fix alloc_mptable Yinghai Lu
2009-05-11 8:22 ` Ingo Molnar
2009-05-11 9:52 ` [tip:irq/numa] x86: fix alloc_mptable() tip-bot for Yinghai Lu
2009-05-06 17:07 ` [PATCH 4/7] x86/acpi: move pin_programmed bit map to io_apic.c Yinghai Lu
2009-05-11 9:52 ` [tip:irq/numa] " tip-bot for Yinghai Lu
2009-05-06 17:08 ` [PATCH 5/7] x86/pci: add 4 more return param in IO_APIC_get_PCI_irq_vector Yinghai Lu
2009-05-07 14:10 ` Ingo Molnar
2009-05-11 8:28 ` Ingo Molnar
2009-05-11 19:40 ` Yinghai Lu
2009-05-11 21:37 ` Ingo Molnar
2009-05-11 22:55 ` [PATCH] x86: introduce io_apic_irq_attr -v2 Yinghai Lu
2009-05-12 10:32 ` Ingo Molnar
2009-05-12 15:17 ` Yinghai Lu
2009-05-12 18:02 ` Yinghai Lu
2009-05-18 7:39 ` [tip:irq/numa] x86, apic: introduce io_apic_irq_attr tip-bot for Yinghai Lu
2009-05-11 9:05 ` [PATCH 5/7] x86/pci: add 4 more return param in IO_APIC_get_PCI_irq_vector Ingo Molnar
2009-05-11 9:52 ` [tip:irq/numa] x86/pci: add 4 more return parameters to IO_APIC_get_PCI_irq_vector() tip-bot for Yinghai Lu
2009-05-06 17:08 ` [PATCH 6/7] x86/acpi: move setup io apic routing out of ACPI macro scope Yinghai Lu
2009-05-11 9:53 ` [tip:irq/numa] x86/acpi: move setup io apic routing out of CONFIG_ACPI scope tip-bot for Yinghai Lu
2009-05-06 17:10 ` [PATCH 7/7] x86/pci: update pirq_enable_irq to setup io apic routing -v2 Yinghai Lu
2009-05-07 14:12 ` Ingo Molnar
2009-05-07 16:52 ` Jesse Barnes
2009-05-11 7:49 ` Ingo Molnar
2009-05-11 9:53 ` [tip:irq/numa] x86/pci: update pirq_enable_irq() to setup io apic routing tip-bot for Yinghai Lu
2009-05-11 9:52 ` [tip:irq/numa] x86/acpi: remove irq-compression trick on 32-bit tip-bot for Yinghai Lu
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=4A01C387.7090103@kernel.org \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@elte.hu \
--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