From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Cc: jayalk@intworks.biz
Subject: [PATCH] PCI Allow OutOfRange PIRQ table address
Date: Mon, 27 Jun 2005 22:32:51 -0700 [thread overview]
Message-ID: <11199367711777@kroah.com> (raw)
In-Reply-To: <20050628053022.GA1588@kroah.com>
[PATCH] PCI Allow OutOfRange PIRQ table address
I updated this to remove unnecessary variable initialization, make
check_routing be inline only and not __init, switch to strtoul, and
formatting fixes as per Randy Dunlap's recommendations.
I updated this to change pirq_table_addr to a long, and to add a warning
msg if the PIRQ table wasn't found at the specified address, as per thread
with Matthew Wilcox.
In our hardware situation, the BIOS is unable to store or generate it's PIRQ
table in the F0000h-100000h standard range. This patch adds a pci kernel
parameter, pirqaddr to allow the bootloader (or BIOS based loader) to inform
the kernel where the PIRQ table got stored. A beneficial side-effect is that,
if one's BIOS uses a static address each time for it's PIRQ table, then
pirqaddr can be used to avoid the $pirq search through that address block each
time at boot for normal PIRQ BIOSes.
Signed-off-by: Jaya Kumar <jayalk@intworks.biz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
commit 120bb4246a99cc6e9cc976573fcbcd0ee9d544ef
tree d447957833d89dbd049259f813530fa8cc81d206
parent 020f46a39eb7b99a575b9f4d105fce2b142acdf1
author jayalk@intworks.biz <jayalk@intworks.biz> Mon, 21 Mar 2005 20:20:42 -0800
committer Greg Kroah-Hartman <gregkh@suse.de> Mon, 27 Jun 2005 21:52:38 -0700
Documentation/kernel-parameters.txt | 4 +++
arch/i386/pci/common.c | 6 +++-
arch/i386/pci/irq.c | 51 +++++++++++++++++++++++++----------
arch/i386/pci/pci.h | 1 +
4 files changed, 47 insertions(+), 15 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1030,6 +1030,10 @@ running once the system is up.
irqmask=0xMMMM [IA-32] Set a bit mask of IRQs allowed to be assigned
automatically to PCI devices. You can make the kernel
exclude IRQs of your ISA cards this way.
+ pirqaddr=0xAAAAA [IA-32] Specify the physical address
+ of the PIRQ table (normally generated
+ by the BIOS) if it is outside the
+ F0000h-100000h range.
lastbus=N [IA-32] Scan all buses till bus #N. Can be useful
if the kernel is unable to find your secondary buses
and you want to tell it explicitly which ones they are.
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -25,7 +25,8 @@ unsigned int pci_probe = PCI_PROBE_BIOS
int pci_routeirq;
int pcibios_last_bus = -1;
-struct pci_bus *pci_root_bus = NULL;
+unsigned long pirq_table_addr;
+struct pci_bus *pci_root_bus;
struct pci_raw_ops *raw_pci_ops;
static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
@@ -188,6 +189,9 @@ char * __devinit pcibios_setup(char *st
} else if (!strcmp(str, "biosirq")) {
pci_probe |= PCI_BIOS_IRQ_SCAN;
return NULL;
+ } else if (!strncmp(str, "pirqaddr=", 9)) {
+ pirq_table_addr = simple_strtoul(str+9, NULL, 0);
+ return NULL;
}
#endif
#ifdef CONFIG_PCI_DIRECT
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -58,6 +58,35 @@ struct irq_router_handler {
int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL;
/*
+ * Check passed address for the PCI IRQ Routing Table signature
+ * and perform checksum verification.
+ */
+
+static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr)
+{
+ struct irq_routing_table *rt;
+ int i;
+ u8 sum;
+
+ rt = (struct irq_routing_table *) addr;
+ if (rt->signature != PIRQ_SIGNATURE ||
+ rt->version != PIRQ_VERSION ||
+ rt->size % 16 ||
+ rt->size < sizeof(struct irq_routing_table))
+ return NULL;
+ sum = 0;
+ for (i=0; i < rt->size; i++)
+ sum += addr[i];
+ if (!sum) {
+ DBG("PCI: Interrupt Routing Table found at 0x%p\n", rt);
+ return rt;
+ }
+ return NULL;
+}
+
+
+
+/*
* Search 0xf0000 -- 0xfffff for the PCI IRQ Routing Table.
*/
@@ -65,23 +94,17 @@ static struct irq_routing_table * __init
{
u8 *addr;
struct irq_routing_table *rt;
- int i;
- u8 sum;
+ if (pirq_table_addr) {
+ rt = pirq_check_routing_table((u8 *) __va(pirq_table_addr));
+ if (rt)
+ return rt;
+ printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n");
+ }
for(addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) {
- rt = (struct irq_routing_table *) addr;
- if (rt->signature != PIRQ_SIGNATURE ||
- rt->version != PIRQ_VERSION ||
- rt->size % 16 ||
- rt->size < sizeof(struct irq_routing_table))
- continue;
- sum = 0;
- for(i=0; i<rt->size; i++)
- sum += addr[i];
- if (!sum) {
- DBG("PCI: Interrupt Routing Table found at 0x%p\n", rt);
+ rt = pirq_check_routing_table(addr);
+ if (rt)
return rt;
- }
}
return NULL;
}
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -27,6 +27,7 @@
#define PCI_ASSIGN_ALL_BUSSES 0x4000
extern unsigned int pci_probe;
+extern unsigned long pirq_table_addr;
/* pci-i386.c */
next prev parent reply other threads:[~2005-06-28 6:25 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-28 5:30 [GIT PATCH] PCI patches for 2.6.12 Greg KH
2005-06-28 5:32 ` Greg KH [this message]
2005-06-28 5:32 ` [PATCH] pci: remove deprecates Greg KH
2005-06-28 5:32 ` Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Make pcibios_fixup_bus() hot-plug safe Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: ACPI based root bridge hot-add Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Fix pci_enable_device() for p2p bridges Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Link newly created pci child bus to its parent on creation Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Prevent duplicate bus numbers when scanning PCI bridge Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Take the PCI lock when modifying pci bus or device lists Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Make the PCI remove routines safe for failed hot-plug Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Remove hot-plugged devices that could not be allocated resources Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Read bridge resources when fixing up the bus Greg KH
2005-06-28 5:32 ` [PATCH] acpi hotplug: clean up notify handlers on acpiphp unload Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Allow ACPI .add and .start operations to be done independently Greg KH
2005-06-28 5:32 ` [PATCH] acpi hotplug: convert acpiphp to use generic resource code Greg KH
2005-06-28 5:32 ` [PATCH] acpi bridge hotadd: Export the interface to get PCI id for an ACPI handle Greg KH
2005-06-28 5:32 ` [PATCH] acpi hotplug: fix slot power-down problem with acpiphp Greg KH
2005-06-28 5:32 ` [PATCH] acpi hotplug: decouple slot power state changes from physical hotplug Greg KH
2005-06-28 5:32 ` [PATCH] acpi hotplug: aCPI based root bridge hot-add Greg KH
2005-06-28 5:32 ` [PATCH] ACPI based I/O APIC hot-plug: ia64 support Greg KH
2005-06-28 5:32 ` [PATCH] ACPI based I/O APIC hot-plug: add interfaces Greg KH
2005-06-28 5:32 ` [PATCH] PCI: fix-pci-mmap-on-ppc-and-ppc64.patch Greg KH
2005-06-28 5:32 ` [PATCH] ACPI based I/O APIC hot-plug: acpiphp support Greg KH
2005-06-28 5:32 ` [PATCH] PCI: DMA bursting advice Greg KH
2005-06-28 5:32 ` [PATCH] cpqphp: fix oops during unload without probe Greg KH
2005-06-28 5:32 ` [PATCH] PCI: clean up the MSI code a bit Greg KH
2005-06-28 5:32 ` [PATCH] PCI: fix up errors after dma bursting patch and CONFIG_PCI=n Greg KH
2005-06-28 5:32 ` [PATCH] PCI: add proper MCFG table parsing to ACPI core Greg KH
2005-06-28 5:32 ` [PATCH] PCI: make drivers use the pci shutdown callback instead of the driver core callback Greg KH
2005-06-28 5:32 ` [PATCH] PCI: use the MCFG table to properly access pci devices (i386) Greg KH
2005-06-28 5:32 ` [PATCH] PCI: use the MCFG table to properly access pci devices (x86-64) Greg KH
2005-06-29 16:33 ` [PATCH] acpi bridge hotadd: ACPI based root bridge hot-add Grant Grundler
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=11199367711777@kroah.com \
--to=gregkh@suse.de \
--cc=greg@kroah.com \
--cc=jayalk@intworks.biz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/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