From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Andreas Koch <koch@esa.informatik.tu-darmstadt.de>
Cc: Linus Torvalds <torvalds@osdl.org>,
linux-pci@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org,
gregkh@suse.de
Subject: Re: PROBLEM: Devices behind PCI Express-to-PCI bridge not mapped
Date: Sun, 5 Jun 2005 20:46:45 +0400 [thread overview]
Message-ID: <20050605204645.A28422@jurassic.park.msu.ru> (raw)
In-Reply-To: <20050604155742.GA14384@erebor.esa.informatik.tu-darmstadt.de>; from koch@esa.informatik.tu-darmstadt.de on Sat, Jun 04, 2005 at 05:57:42PM +0200
On Sat, Jun 04, 2005 at 05:57:42PM +0200, Andreas Koch wrote:
> 2) The last messages right before the oops are
>
> PCI: Bridge 0000:00:1e.0
> IO window 1000-6fff
> MEM window: 01000000-0dffffff
Indeed. From your lspci output:
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d4) (prog-if 01 [Subtractive decode])
It's the "transparent" bridge. The code in setup-bus.c doesn't handle this
properly.
Please try this patch - it should fix two problems:
- in pci_setup_bridge() use bridge resources directly, instead of
the resource pointers in struct pci_bus (this fixes an oops);
- [ioport,iomem]_resource must not be touched in the bus setup code,
otherwise we screw up the whole resource tree.
Ivan.
--- linux/drivers/pci/setup-bus.c.orig Thu Apr 21 04:03:14 2005
+++ linux/drivers/pci/setup-bus.c Sun Jun 5 18:37:57 2005
@@ -149,13 +149,14 @@ pci_setup_bridge(struct pci_bus *bus)
{
struct pci_dev *bridge = bus->self;
struct pci_bus_region region;
+ struct resource *b_res= &bridge->resource[PCI_BRIDGE_RESOURCES];
u32 l, io_upper16;
DBG(KERN_INFO "PCI: Bridge: %s\n", pci_name(bridge));
/* Set up the top and bottom of the PCI I/O segment for this bus. */
- pcibios_resource_to_bus(bridge, ®ion, bus->resource[0]);
- if (bus->resource[0]->flags & IORESOURCE_IO) {
+ pcibios_resource_to_bus(bridge, ®ion, &b_res[0]);
+ if (b_res[0].flags & IORESOURCE_IO) {
pci_read_config_dword(bridge, PCI_IO_BASE, &l);
l &= 0xffff0000;
l |= (region.start >> 8) & 0x00f0;
@@ -180,8 +181,8 @@ pci_setup_bridge(struct pci_bus *bus)
/* Set up the top and bottom of the PCI Memory segment
for this bus. */
- pcibios_resource_to_bus(bridge, ®ion, bus->resource[1]);
- if (bus->resource[1]->flags & IORESOURCE_MEM) {
+ pcibios_resource_to_bus(bridge, ®ion, &b_res[1]);
+ if (b_res[1].flags & IORESOURCE_MEM) {
l = (region.start >> 16) & 0xfff0;
l |= region.end & 0xfff00000;
DBG(KERN_INFO " MEM window: %08lx-%08lx\n",
@@ -199,8 +200,8 @@ pci_setup_bridge(struct pci_bus *bus)
pci_write_config_dword(bridge, PCI_PREF_LIMIT_UPPER32, 0);
/* Set up PREF base/limit. */
- pcibios_resource_to_bus(bridge, ®ion, bus->resource[2]);
- if (bus->resource[2]->flags & IORESOURCE_PREFETCH) {
+ pcibios_resource_to_bus(bridge, ®ion, &b_res[2]);
+ if (b_res[2].flags & IORESOURCE_PREFETCH) {
l = (region.start >> 16) & 0xfff0;
l |= region.end & 0xfff00000;
DBG(KERN_INFO " PREFETCH window: %08lx-%08lx\n",
@@ -270,6 +271,8 @@ find_free_bus_resource(struct pci_bus *b
for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
r = bus->resource[i];
+ if (r == &ioport_resource || r == &iomem_resource)
+ continue;
if (r && (r->flags & type_mask) == type && !r->parent)
return r;
}
next prev parent reply other threads:[~2005-06-05 16:47 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-03 23:28 PROBLEM: Devices behind PCI Express-to-PCI bridge not mapped Andreas Koch
2005-06-04 0:22 ` Linus Torvalds
2005-06-04 1:33 ` Andreas Koch
2005-06-04 1:55 ` Linus Torvalds
2005-06-04 2:26 ` Andreas Koch
2005-06-04 4:50 ` Linus Torvalds
2005-06-04 15:57 ` Andreas Koch
2005-06-05 16:46 ` Ivan Kokshaysky [this message]
2005-06-06 0:27 ` Andreas Koch
2005-06-06 14:43 ` Ivan Kokshaysky
2005-06-08 17:34 ` Andreas Koch
2005-06-08 22:36 ` Ivan Kokshaysky
2005-06-09 0:29 ` Andreas Koch
2005-06-09 4:04 ` Benjamin Herrenschmidt
2005-06-09 13:54 ` Ivan Kokshaysky
2005-06-09 17:54 ` Andreas Koch
2005-06-09 22:38 ` Andreas Koch
2005-06-09 23:20 ` Linus Torvalds
2005-06-10 14:33 ` Andreas Koch
2005-06-10 14:48 ` Ivan Kokshaysky
2005-06-10 20:47 ` Andreas Koch
2005-06-10 23:50 ` Sean Bruno
2005-06-14 15:19 ` Sean Bruno
2005-06-16 14:20 ` Andreas Koch
2005-06-16 17:20 ` Peter Buckingham
2005-06-16 20:53 ` Sean Bruno
2005-06-16 21:05 ` Peter Buckingham
2005-06-16 21:12 ` Roland Dreier
2005-06-16 21:21 ` Peter Buckingham
2005-06-17 9:54 ` Ivan Kokshaysky
2005-06-17 16:34 ` Peter Buckingham
2005-06-17 16:51 ` Sean Bruno
2005-06-17 17:59 ` Sean Bruno
2005-06-18 7:45 ` Ivan Kokshaysky
2005-06-18 17:55 ` Sean Bruno
2005-06-20 16:51 ` Peter Buckingham
2005-06-20 21:31 ` Peter Buckingham
2005-06-20 23:39 ` Peter Buckingham
2005-06-04 15:17 ` Linus Torvalds
2005-06-04 6:38 ` Greg KH
2005-06-04 6:51 ` Grant Grundler
2005-06-04 7:12 ` Grant Grundler
2005-06-04 7:19 ` Greg KH
2005-06-04 6:46 ` Greg KH
2005-06-04 16:16 ` Andreas Koch
2005-06-11 5:33 linux
2005-06-11 10:26 ` Ivan Kokshaysky
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=20050605204645.A28422@jurassic.park.msu.ru \
--to=ink@jurassic.park.msu.ru \
--cc=gregkh@suse.de \
--cc=koch@esa.informatik.tu-darmstadt.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--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;
as well as URLs for NNTP newsgroup(s).