From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH][BUG] Stop multiple pci_claim_resource() call for the same
Date: Mon, 16 Jan 2006 04:45:23 +0000 [thread overview]
Message-ID: <43CB24E3.8030006@jp.fujitsu.com> (raw)
Hi,
I encountered the following problems:
o Reading /proc/iomem cause endless loop.
o request_mem_region() for PCI-to-PCI bridge fails.
This problem is caused by the bug that pci_claim_resource() is called
multiple times for the same P2P bridge's resource structure if P2P
bridge requires their own PCI I/O resources.
The patch below fixes this bug.
Thanks,
Kenji Kaneshige
This patch fixes the bug that pci_claim_resource() is called multiple
times for the same P2P bridge's resource structures if P2P bridges
require their own PCI I/O resources.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
arch/ia64/pci/pci.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
Index: linux-2.6.15/arch/ia64/pci/pci.c
=================================--- linux-2.6.15.orig/arch/ia64/pci/pci.c 2006-01-11 21:51:43.000000000 +0900
+++ linux-2.6.15/arch/ia64/pci/pci.c 2006-01-11 22:20:51.000000000 +0900
@@ -454,14 +454,13 @@
return 0;
}
-static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
+static void __devinit
+pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
{
struct pci_bus_region region;
int i;
- int limit = (dev->hdr_type = PCI_HEADER_TYPE_NORMAL) ? \
- PCI_BRIDGE_RESOURCES : PCI_NUM_RESOURCES;
- for (i = 0; i < limit; i++) {
+ for (i = start; i < limit; i++) {
if (!dev->resource[i].flags)
continue;
region.start = dev->resource[i].start;
@@ -472,6 +471,16 @@
}
}
+static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
+{
+ pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES);
+}
+
+static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev)
+{
+ pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES);
+}
+
/*
* Called after each bus is probed, but before its children are examined.
*/
@@ -482,7 +491,7 @@
if (b->self) {
pci_read_bridge_bases(b);
- pcibios_fixup_device_resources(b->self);
+ pcibios_fixup_bridge_resources(b->self);
}
list_for_each_entry(dev, &b->devices, bus_list)
pcibios_fixup_device_resources(dev);
reply other threads:[~2006-01-16 4:45 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=43CB24E3.8030006@jp.fujitsu.com \
--to=kaneshige.kenji@jp.fujitsu.com \
--cc=linux-ia64@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