From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] ppc64: Some small pci fixes
Date: Mon, 25 Oct 2004 11:06:34 +1000 [thread overview]
Message-ID: <1098666394.16132.14.camel@gaston> (raw)
This patch fixes a few issues in the ppc64 pci code, notably some
incorrect parsing of Open Firmware "ranges" when setting up host
bridge resources that would cause a problem with some future
platforms, a default mapping of the ISA IOs if the OF "isa" node
lacks a "ranges" property, and a safeguard in pci_scan_all_fns()
in case a pci<->OF node mapping cannot be established.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-work/arch/ppc64/kernel/pci.c
===================================================================
--- linux-work.orig/arch/ppc64/kernel/pci.c 2004-10-25 10:36:50.724712968 +1000
+++ linux-work/arch/ppc64/kernel/pci.c 2004-10-25 11:04:50.070413616 +1000
@@ -585,9 +585,11 @@
int rlen = 0;
range = (struct isa_range *) get_property(isa_node, "ranges", &rlen);
- if (rlen < sizeof(struct isa_range)) {
- printk(KERN_ERR "unexpected isa range size: %s\n",
- __FUNCTION__);
+ if (range == NULL || (rlen < sizeof(struct isa_range))) {
+ printk(KERN_ERR "no ISA ranges or unexpected isa range size,"
+ "mapping 64k\n");
+ __ioremap_explicit(phb_io_base_phys, (unsigned long)phb_io_base_virt,
+ 0x10000, _PAGE_NO_CACHE);
return;
}
@@ -652,8 +654,7 @@
cpu_phys_addr = cpu_phys_addr << 32 | ranges[4];
size = (unsigned long)ranges[na+3] << 32 | ranges[na+4];
-
- switch (ranges[0] >> 24) {
+ switch ((ranges[0] >> 24) & 0x3) {
case 1: /* I/O space */
hose->io_base_phys = cpu_phys_addr;
hose->pci_io_size = size;
@@ -862,6 +863,9 @@
else
busdn = bus->sysdata; /* must be a phb */
+ if (busdn == NULL)
+ return 0;
+
/*
* Check to see if there is any of the 8 functions are in the
* device tree. If they are then we need to scan all the
reply other threads:[~2004-10-25 1:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1098666394.16132.14.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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